Description Usage Arguments Value Examples
View source: R/make_BayesCMR.R
This function generates a structure containing the necessary functions for a CMR analysis of a fossil dataset.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
Obs |
a matrix with size number of taxa by number of intervals (n). Each taxon has a row with 0's (unobserved) and 1's (observed) for each interval in the analysis. Oldest interval is first column. |
dts |
a vector of interval durations. Defaults to a series of 1's if not supplied. Oldest interval is first entry. |
data |
a data frame with putative drivers. |
pfix |
a switch to select which approach is used to solve the identifiability problem in the model. If |
priorPars |
list of lists of the parameters for the priors. First list is parameters for baseline rates, then list of parameters for covariates and third is list of parameters for ln of standard deviation of random effects))). Defaults to |
modeltype |
sets the type parameterisation of the rates of speciation and extinction. 'I' and 'II' specifies that the probabilities of extinction and seniority are calculated based on actual durations of intervals, whereas 'III' and 'IV' uses the differences between mid-points of intervals. 'I' and 'III' uses a basic implementation of probability of extinction as 1 - exp(-rate * dt). Models 'II' and 'IV' use a more detailed functional relationship between rate and probability, following Raup (1984): (µ*((exp((lambda-µ)*dt))-1))/(lambda*((exp((lambda-µ)*dt)))-µ). Modeltype 'V' implements a temporally uninformed model, estimating the probabilities directly (or rather their logit). |
spec/ext/samp |
are formulas specifying the particular model. Use |
priorsMu |
distribution used for prior for the baseline rates - a probability density function. Default is |
priorsCov |
distribution used for prior for the driver coefficients - a probability density function. Default is |
priorsStd |
distribution used for prior for log of the standard deviation of the random effects - a probability density function. Default is |
The function returns an object of class CMR_model. This most important output is out$probfun which is a function for the posterior. This output can be fed directly into the sampler MCMC_CMR. It also returns $Obs
and $dts
as well as the full call (exlcluding default settings), $call
1 2 3 4 5 6 7 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.