@@ -229,9 +229,11 @@ age being younger than 38 Mya is equal to 0, using this value to offset
229229a prior distribution on the root-age.
230230
231231First specify the occurrence-time of the fossil.
232- ```
233- tHesperocyon <- 38.0
234- ```
232+
233+ {% snippet scripts/m_BDP_bears.Rev %}
234+ tHesperocyon <- 38.0
235+ {% endsnippet %}
236+
235237We will assume a lognormal prior on the root age that is offset by the
236238observed age of * Hesperocyon gregarius* . We can use the previous
237239analysis by {% cite DosReis2012 %} to parameterize the lognormal prior on the root
@@ -241,22 +243,28 @@ distribution to equal $49 - 38 = 11$ Mya. Given the expected value of
241243the lognormal (` mean_ra ` ) and a standard deviation (` stdv_ra ` ), we can
242244also compute the location parameter of the lognormal (` mu_ra ` ).
243245
246+ {% snippet scripts/m_BDP_bears.Rev %}
244247 mean_ra <- 11.0
245248 stdv_ra <- 0.25
246249 mu_ra <- ln(mean_ra) - ((stdv_ra* stdv_ra) * 0.5)
250+ {% endsnippet %}
247251
248252With these parameters we can instantiate the root age stochastic node
249253with the offset value.
250254
255+ {% snippet scripts/m_BDP_bears.Rev %}
251256 root_time ~ dnLognormal(mu_ra, stdv_ra, offset=tHesperocyon)
257+ {% endsnippet %}
252258
253259### Time Tree Stochastic Node
254260
255261Now that we have specified all of the parameters of the birth-death
256262process, we can create our stochastic node representing the tree
257263topology and divergence times.
258264
265+ {% snippet scripts/m_BDP_bears.Rev %}
259266 timetree ~ dnBDP(lambda=birth_rate, mu=death_rate, rho=rho, rootAge=root_time, samplingStrategy="uniform", condition="nTaxa", taxa=taxa)
267+ {% endsnippet %}
260268
261269### Creating a Node-Age Variable
262270
@@ -267,27 +275,35 @@ taxa using the `clade()` function. This will not restrict this node to
267275be monophyletic, but just create a node that is the MRCA of the taxa
268276listed (even if that node has descendants that are not named).
269277
270- clade_Ursidae <- clade("Ailuropoda_melanoleuca","Tremarctos_ornatus","Helarctos_malayanus", "Ursus_americanus","Ursus_thibetanus","Ursus_arctos","Ursus_maritimus","Melursus_ursinus")
278+ {% snippet scripts/m_BDP_bears.Rev %}
279+ clade_Ursidae <- clade("Ailuropoda_melanoleuca","Tremarctos_ornatus","Helarctos_malayanus","Ursus_americanus","Ursus_thibetanus","Ursus_arctos","Ursus_maritimus","Melursus_ursinus")
280+ {% endsnippet %}
271281
272282Once we have defined the node, we can create a deterministic node to
273283monitor its age.
274284
285+ {% snippet scripts/m_BDP_bears.Rev %}
275286 tmrca_Ursidae := tmrca(timetree,clade_Ursidae)
287+ {% endsnippet %}
276288
277289### Proposals on the Time Tree
278290
279291Next, create the vector of moves. These tree moves act on node ages:
280292
281- moves.append( mvNodeTimeSlideUniform(timetree, weight=30.0) ) )
293+ {% snippet scripts/m_BDP_bears.Rev %}
294+ moves.append( mvNodeTimeSlideUniform(timetree, weight=30.0 ) )
282295 moves.append( mvSlide(root_time, delta=2.0, tune=true, weight=10.0) )
283296 moves.append( mvScale(root_time, lambda=2.0, tune=true, weight=10.0) )
284297 moves.append( mvTreeScale(tree=timetree, rootAge=root_time, delta=1.0, tune=true, weight=3.0) )
298+ {% endsnippet %}
285299
286300Then, we will add moves that will propose changes to the tree topology.
287301
302+ {% snippet scripts/m_BDP_bears.Rev %}
288303 moves.append( mvNNI(timetree, weight=8.0) )
289304 moves.append( mvNarrow(timetree, weight=8.0) )
290305 moves.append( mvFNPR(timetree, weight=8.0) )
306+ {% endsnippet %}
291307
292308Now save and close the file. This file, with all the model
293309specifications will be loaded by other ` Rev ` files.
0 commit comments