Description Usage Arguments Details Value References Examples
Simulate traits under ougbm model given a set of model parameters, regression parameters, tree and ancestral values.
1 | ougbmmodel(model.params, reg.params, root = root, tree = tree)
|
model.params |
A vector of model parameters including alpha.y: force parameter of response trait, 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, σ^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 ougbm 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. (2020). Modeling rate of adaptive trait evolution using Cox–Ingersoll–Ross process: An Approximate Bayesian Computation approach. Computational Statistics & Data Analysis, 145, 106924.
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,1,0.2)
names(model.params)<-c("alpha.y","sigmasq.x","tau")
reg.params<-c(0,1,1)
names(reg.params)<-c("b0","b1","b2")
ougbmmodel(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.