Skip to content

TreeSlicer: Example 2

Louis edited this page Dec 11, 2018 · 11 revisions

Setting change-point times at equally spaced intervals between the tMRCA and the present

In this example we set change-point times to be equally spaced between the tMRCA and the most recent sample (the present, as in the figure below. This is usually used for the effective reproductive number (Re) or the birthrate. Thus, shifts in the Re are placed at equidistant intervals between the tMRCA and the present (t1-t4), i.e. the time between the tMRCA (1924) and t1 (1938) is the same as the time between each of the other shifts (e.g. t2 and t3, 1952-1966). Thus, only the first interval (between t0 and t1 is longer than the others, because it incorporates the origin branch).

Equidistant change-point times between the tMRCA and the present

Keep in mind that the time of the origin represents the start of the outbreak, which is in general older than the tMRCA of the sampled tree. (In methods based on the Kingman coalescent the origin is not estimated and the process stops at the tMRCA).

Why do this?

The default behaviour of BDSKY is to place change-point times at equally spaced intervals between the origin and the present, as below.

Equidistant change-point times between the origin and the present

For most applications this is sufficient. However, when the origin branch is longer than one of the intervals, a change-point time will be placed on the origin branch (as below). This is problematic, because there is no information to identify rate-changes on the origin branch. Therefore, in some cases, equidistant change-point times between the origin and the present can cause problems with convergence and result in biased estimates.

Equidistant change-point times between the origin and the present

Without TreeSlicer

It is not possible to set equidistant change-point times between the tMRCA and the present using just BDSKY, without also fixing the tree.

The closest alternative is to condition the likelihood on the tMRCA of the tree, instead of the origin of the outbreak (by setting the option conditionOnRoot).

<distribution id="BirthDeathSkySerial" 
              spec="beast.evolution.speciation.BirthDeathSkylineModel" 
              tree="@Tree"
              reproductiveNumber="@reproductiveNumber" 
              becomeUninfectiousRate="@becomeUninfectiousRate" 
              samplingProportion="@samplingProportion" 
              conditionOnRoot="true"/>

Equidistant change-point times between the origin and the present

With TreeSlicer

Clone this wiki locally