View source: R/growthRateMethods.R
birthDeathMCMC | R Documentation |
Uses Rstan and the No U-turn sampler to approximate the growth rate using the likelihood from Stadler 2009 "On incomplete sampling under birth–death models and connections to the sampling-based coalescent"
birthDeathMCMC(
tree,
maxGrowthRate = 4,
alpha = 0.05,
verbose = TRUE,
nChains = 4,
nCores = 1,
chainLength = 2000
)
tree |
An ultrametric tree subset to include only the clone of interest. Alternatively, a list with several such trees. |
maxGrowthRate |
Sets upper bound on birth rate. Default is 4 but this will depend on the nature of the data |
alpha |
Used for calculation of confidence intervals. 1-alpha confidence intervals used with default of alpha = 0.05 (95 percent confidence intervals) |
verbose |
TRUE or FALSE, should the Rstan MCMC intermediate output and progress be printed? |
nChains |
Number of chains to run in MCMC. Default is 4 |
nCores |
Number of cores to perform MCMC. Default is 1, but chains can be run in parallel |
chainLength |
Number of iterations for each chain in MCMC. Default is 2000 (1000 warm-up + 1000 sampling), increase if stan tells you to |
A dataframe including the net growth rate estimate, confidence intervals, and other important details (clone age estimate, runtime, n, etc.)
internalLengths maxLikelihood which use alternative methods for growth rate estimation from an ultrametric tree.
df <- birthDeathMCMC(cloneRate::exampleUltraTrees[[1]])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.