mvFossilSiteTimeSlideUniform - Move to simultaneously update the ages of site-linked fossils
| tree : | TimeTree (<stochastic> pass by reference) |
| The tree on which this move operates. | |
| origin : | RealPos (pass by reference) |
| The variable for the origin of the process giving a maximum age. | |
| Default : NULL | |
| max : | RealPos (pass by reference) |
| The variable for the maximum age of this fossil site. | |
| Default : NULL | |
| min : | RealPos (pass by reference) |
| The variable for the minimun age of this fossil site. | |
| Default : NULL | |
| taxa : | Taxon[] (pass by reference) |
| A vector of taxon objects with fossils from the same site | |
| Default : NULL | |
| delta : | RealPos (pass by value) |
| The window size parameter. | |
| Default : 1 | |
| tune : | Bool (pass by value) |
| Should we tune the window size during burnin? | |
| Default : TRUE | |
| weight : | RealPos (pass by value) |
| The weight determines the relative frequency with which this move will be attempted. For details, see the description of the 'moveschedule' parameter on the documentation page for 'mcmc()'. | |
| Default : 1 | |
| tuneTarget : | Probability (pass by value) |
| The acceptance probability targeted by auto-tuning. | |
| Default : 0.44 |
# Assume that the min/max ages of each taxon have been read from a TSV file
# Extract all fossil taxa in the tree
fossils = fbd_tree.getFossils()
# Specify a uniform prior spanning the age uncertainty range of each fossil
for(i in 1:fossils.size())
{
t[i] := tmrca(fbd_tree, clade(fossils[i]))
a[i] = fossils[i].getMinAge()
b[i] = fossils[i].getMaxAge()
F[i] ~ dnUniform(t[i] - b[i], t[i] - a[i])
F[i].clamp( 0 )
}
# Create a vector including all fossils known from the same site
sitelinked_fossils[1] = taxon("fossil_X")
sitelinked_fossils[2] = taxon("fossil_Y")
sitelinked_fossils[3] = taxon("fossil_Z")
# Add a move to update the ages of these fossils simultaneously
moves.append( mvFossilSiteSlideUniform(fbd_tree, origin_time, taxa=sitelinked_fossils,
weight=10.0) )
# The ages of the remaining fossils should be updated independently
nonsitelinked_fossils = fossils
nonsitelinked_fossils.erase( sitelinked_fossils )
for(i in 1:nonsitelinked_fossils.size())
{
moves.append( mvFossilTimeSlideUniform(fbd_tree, origin_time,
tip=nonsitelinked_fossils[i], weight=5.0) )
}