Usage
mcmc.popsize(tree,nstep, thinning=1, burn.in=0,progress.bar=TRUE, method.prior.changepoints=c("hierarchical", "fixed.lambda"), max.nodes=30, lambda=0.5, gamma.shape=0.5, gamma.scale=2, method.prior.heights=c("skyline", "constant", "custom"), prior.height.mean, prior.height.var)
extract.popsize(mcmc.out, credible.interval=0.95, time.points=200, thinning=1, burn.in=0)
"plot"(x, show.median=TRUE, show.years=FALSE, subst.rate, present.year, ...)
"lines"(x, show.median=TRUE,show.years=FALSE, subst.rate, present.year, ...)
Arguments
tree
Either an ultrametric tree (i.e. an object of class "phylo"
),
or coalescent intervals (i.e. an object of class "coalescentIntervals"
).
nstep
Number of MCMC steps, i.e. length of the Markov chain (suggested value: 10,000-50,000).
thinning
Thinning factor (suggest value: 10-100).
burn.in
Number of steps dropped from the chain to allow for a burn-in phase (suggest value: 1000).
progress.bar
Show progress bar during the MCMC run.
method.prior.changepoints
If hierarchical
is chosen (the default) then the smoothing parameter lambda is drawn from
a gamma distribution with some specified shape and scale parameters.
Alternatively, for fixed.lambda
the value of lambda is a given constant.
max.nodes
Upper limit for the number of internal nodes of the approximating spline (default: 30).
lambda
Smoothing parameter. For method="fixed.lambda"
the specifed value of lambda determines
the mean of the prior distribution for the number of internal nodes of the approximating
spline for the demographic function (suggested value: 0.1-1.0).
gamma.shape
Shape parameter of the gamma function from which lambda
is drawn for
method="hierarchical"
.
gamma.scale
Scale parameter of the gamma function from which lambda
is drawn for
method="hierarchical"
.
method.prior.heights
Determines the prior for the heights of the change points.
If custom
is chosen then two functions describing the mean and variance
of the heigths in depence of time have to be specified (via prior.height.mean
and prior.height.var
options). Alternatively, two built-in priors are available:
constant
assumes constant population size and variance determined by Felsenstein
(1992), and skyline
assumes a skyline plot (see Opgen-Rhein et al. 2004 for
more details).
prior.height.mean
Function describing the mean of the prior distribution for the heights
(only used if method.prior.heights = custom
).
prior.height.var
Function describing the variance of the prior distribution for the heights
(only used if method.prior.heights = custom
).
mcmc.out
Output from mcmc.popsize
- this is needed as input for extract.popsize
.
credible.interval
Probability mass of the confidence band (default: 0.95).
time.points
Number of discrete time points in the table output by extract.popsize
.
x
Table with population size versus time, as computed by extract.popsize
.
show.median
Plot median rather than mean as point estimate for demographic function (default: TRUE).
show.years
Option that determines whether the time is plotted in units of
of substitutions (default) or in years (requires specification of substution rate
and year of present).
subst.rate
Substitution rate (see option show.years).
present.year
Present year (see option show.years).
...
Further arguments to be passed on to plot
.