fit_t_standard {RPANDA} | R Documentation |
Fits standard models of trait evolution incorporating known and nuisance measurement error
Description
Fits Brownian motion (BM), Ornstein-Uhlenbeck (OU), or early burst (EB) models of trait evolution to a given dataset and phylogeny.
Usage
fit_t_standard(phylo, data, model=c("BM","OU","EB"), error=NULL, two.regime=FALSE,
method="Nelder-Mead", echo=TRUE, ...)
Arguments
phylo |
an object of type 'phylo' (see ape documentation); if |
data |
a named vector of trait values with names matching |
model |
model chosen to fit trait data, |
error |
A named vector with standard errors (SE) of trait values for each species (with names matching |
two.regime |
if |
method |
optimization method from |
echo |
prints information to console during fit |
... |
Optional arguments. e.g. "upper=xx", "lower=xx" to specify bounds on the parameter search. "fixedRoot=TRUE" to use an OU model where the root state is assumed fixed (instead of sampled from the stationary distribution) |
Details
Note: if including known measurement error, the model fit incorporates this known error and, in addition, estimates an unknown, nuisance contribution to measurement error. The current implementation does not differentiate between the two, so, for instance, it is not possible to estimate the nuisance measurement error without providing the known, intraspecific error values.
Value
a list with the following elements:
LH |
maximum log-likelihood value |
aic |
Akaike Information Criterion value |
aicc |
AIC value corrected for small sample size |
free.parameters |
number of free parameters from the model |
sig2 |
maximum-likelihood estimate of |
alpha |
maximum-likelihood estimate of |
r |
maximum-likelihood estimate of the slope parameter of early burst model |
z0 |
maximum-likelihood estimate of |
nuisance |
maximum-likelihood estimate of |
convergence |
convergence diagnostics from |
Author(s)
Jonathan Drury jonathan.p.drury@gmail.com
Julien Clavel
See Also
Examples
if(test){
data(Cetacea_clades)
data<-sim_t_tworegime(Cetacea_clades,pars=c(sig2=0.01,r1=-0.01,r2=-0.02),
root.value=0,Nsegments=1000,model="EB")
error<-rep(0.05,length(Cetacea_clades$tip.label))
names(error)<-Cetacea_clades$tip.label
#Fit single-regime models
BM1.fit<-fit_t_standard(Cetacea_clades,data,model="BM",error,two.regime=FALSE)
OU1.fit<-fit_t_standard(Cetacea_clades,data,model="OU",error,two.regime=FALSE)
EB1.fit<-fit_t_standard(Cetacea_clades,data,model="EB",error,two.regime=FALSE)
#Now fit models that incorporate biogeography, NOTE these models take longer to fit
BM2.fit<-fit_t_standard(Cetacea_clades,data,model="BM",error,two.regime=TRUE)
OU2.fit<-fit_t_standard(Cetacea_clades,data,model="OU",error,two.regime=TRUE)
EB2.fit<-fit_t_standard(Cetacea_clades,data,model="EB",error,two.regime=TRUE)
}