View source: R/phylopars_main.R
simtraits | R Documentation |
Simulates traits for phylopars
estimation.
simtraits(ntaxa = 15, ntraits = 4, nreps = 1, nmissing = 0, tree, v, anc,
intraspecific, model="BM", parameters, nsim, return.type="data.frame")
ntaxa |
Either number of taxa ( |
ntraits |
Number of traits to be simulated. |
nreps |
Number of replicates per trait per species to simulate. |
nmissing |
Number of randomly missing trait values. |
tree |
Either number of taxa ( |
v |
Trait covariance ( |
anc |
Value for ancestral state at root node. |
intraspecific |
Optional value for within-species variance. |
model |
Model of evolution (default="BM"). Other options include "OUfixedRoot", "OUrandomRoot", "lambda", "kappa", "delta", "EB". |
parameters |
List of parameters for the model. alpha for the selection strength in the OU model, lambda, kappa, delta, or rate for the EB model. |
nsim |
Number of simulations to perform (default is 1) |
return.type |
Default is "data.frame". Can also specify "matrix" if nreps=1. |
trait_data |
Data for |
tree |
The original phylogenetic tree (either provided to the function or generated internally) |
sim_tree |
The transformed tree on which trait simulations were performed (identical to tree if model="BM") |
original_X |
If within-species variation is simulated, original_X is the original species mean values before adding within-species variation. |
Eric W. Goolsby eric.goolsby.evolution@gmail.com
Bruggeman J, Heringa J and Brandt BW. (2009) PhyloPars: estimation of missing parameter values using phylogeny. Nucleic Acids Research 37: W179-W184.
Harmon Luke J, Jason T Weir, Chad D Brock, Richard E Glor, and Wendell Challenger. 2008. GEIGER: investigating evolutionary radiations. Bioinformatics 24:129-131.
# simulate data
sim_data <- simtraits(ntaxa = 15,ntraits = 4,nreps = 3,nmissing = 10)
# estimate parameters under Brownian motion
# pheno_error = TRUE assumes intraspecific variation
# pheno_correlated = FALSE assumes intraspecific variation is not correlated
# phylo_correlated = TRUE assumed traits are correlated
PPE <- phylopars(trait_data = sim_data$trait_data,tree = sim_data$tree,
pheno_error = TRUE,phylo_correlated = TRUE,pheno_correlated = FALSE)
PPE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.