Description Usage Arguments Details Value References Examples
Simulate traits under OUOU model given a set of model parameters, regression parameters, tree and ancestral values.
1 | ououmodel(model.params, reg.params, root = root, tree = tree)
|
model.params |
A vector of model parameters including alpha.y: force parameter of response trait, alpha.x: force parameter of covariate, theta.x: optimum parameter of covariate, sigmasq.x: rate parameter of covariate and tau rate parameter of response trait |
reg.params |
A vector of regression paramters including b0: intercept parameter of regression, b1: slope parameter of first covariate, b2: slope paramter of the second covariate |
root |
A vector of numerical values for root of species estimated from |
tree |
An ape: tree object stored in phylo format |
The model requires user to input model parameters α_y,α_x,θ_x, σ^2_x,τ and regression parameters b_0,b_1,b_2, a tree object, trait dataset (one response, two covariate), ancestral values(root) which is estimated by BM or OU model from geiger
. Then the algorithm starts from the root and apply the tree traversal algorithm to simulate trait on each node according the OUOU dynamics.
Returns the trait vectors Y=(y_1,y_2,\cdots,y_n)', X_1=(x_{1,1},x_{1.2},\cdots,x_{1,n})',X_2=(x_{2,1},x_{2,2},\cdots,x_{2,n})' simulated from the model.
Jhwueng, D-C. (2019) Statistical modeling for adaptive trait evolution. Under review.
Jhwueng, D-C., and Vasileios Maroulas. "Adaptive trait evolution in random environment." Journal of Applied Statistics 43.12 (2016): 2310-2324.
Hansen, Thomas F., Jason Pienaar, and Steven Hecht Orzack. "A comparative method for studying adaptation to a randomly evolving environment." Evolution: International Journal of Organic Evolution 62.8 (2008): 1965-1977.
1 2 3 4 5 6 7 8 9 | library(ape)
tree<-rcoal(5)
tree<-reorder(tree,"postorder")
root<-list(y.ou.sigmsq=1 ,y.ou.root=0, x1.ou.root=0, x2.ou.root=0,x1.bm.root=0, x2.bm.root=0)
model.params<-c(0.5,0.25,0,1,0.2)
names(model.params)<-c("alpha.y","alpha.x","theta.x","sigmasq.x","tau")
reg.params<-c(0,1,1)
names(reg.params)<-c("b0","b1","b2")
ououmodel(model.params,reg.params,root=root,tree=tree)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.