Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mlandis
Created November 6, 2014 03:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlandis/ba54b19884db58177368 to your computer and use it in GitHub Desktop.
Save mlandis/ba54b19884db58177368 to your computer and use it in GitHub Desktop.
# io
fp = "./"
fn = fp + "prior_timetree.txt"
# make a tree variable
n_tips = 10
for (i in 1:n_tips) { names[i] = "T"+i }
t ~ dnUniformTimeTree(originTime=1.0, taxonNames=names)
# create a vector of moves
mvi = 1
mv[mvi++] = mvNNI(t, 2.0)
mv[mvi++] = mvNarrow(t, 5.0)
mv[mvi++] = mvFNPR(t, 2.0)
mv[mvi++] = mvSubtreeScale(t, 5.0)
mv[mvi++] = mvNodeTimeSlideUniform(t, 10.0)
# create a vector of monitors
mni = 1
mn[mni++] = mnScreen(t)
mn[mni++] = mnFile(t,file=fn)
# create the model from the DAG
mdl = model(t)
# create and run MCMC
ch = mcmc(mdl, mn, mv)
ch.run(1000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment