prl_sim_traits_continuous: Simulate Continuous Traits on a Phylogeny

Description Usage Arguments

View source: R/simulate_models.R

Description

Simulate Continuous Traits on a Phylogeny

Usage

1
2
prl_sim_traits_continuous(x, family = c("gaussian"), n_trait = 1,
  root_value = 0, initial_rate = 2, tau = 5, sd = 0.25)

Arguments

x

Object to be simulated from. Can be either a phurl object generated from phurl_prepare_data, or an object of class phylo

family

What error structure to use in the simulations? Can be a character vector of length n_trait to use different families for different traits.

n_trait

Number of traits to simulate.

root_value

A vector of root values for each trait. Will be recycled to length n_trait

initial_rate

Vector of standard deviations for initial rates. Rate at which traits are diverging after first split (will be drawn from a normal distribution with sd = initial_rate). Will be recycled to length n_trait

tau

A vector tau values. This parameter controls the degree to which trait evolution rates change at phylogeny nodes. Rate changes are sampled from a gaussian distribution with mean zero and sd equal to tau, scaled by the edge length of the parent edge. Will be recycled to length n_trait

sd

Gaussian error of final tip-level observations. Standard deviation of noise added to tip-level trait values. Only used if family="gaussian"


rdinnager/phurl documentation built on Dec. 8, 2019, 3:06 p.m.