hOUwie.sim.Rd
Simulates a discrete and continuous character following the hOUwie model. The function first evolves a discrete character based on the Q matrix provided. Next, it will evolve a continuous character following the given OU parameters and simulated discrete character. Like the hOUwie model, transitions between discrete states are assumed to take place half-way between nodes.
hOUwie.sim(phy,
Q,
root.freqs,
alpha,
sigma.sq,
theta0,
theta)
A phylogenetic tree, in ape
“phylo” format.
A transition rate matrix with dimensions nStates
by nStates
describing rates of change between discrete states.
A vector nStates
long with probabilities of the root being in a particular state. For example, for a binary discrete character a root prior of c(1, 0)
would fix the root state in state 1.
A vector nStates
long which gives alpha parameter of the OU model. For a BM model set this to be near 0.
A vector nStates
long which gives the evolutionary rate parameter of the OU model.
A numeric value giving the starting value of the continuous character at the root.
A vector nStates
long which gives the phenotypic optima for each regime state.
The simulation protocol follows the hOUwie model where stochastic maps being produced are based on a node-by-node simulation. I.e., we first simulate the node states given the parameters and then branches are paintined based on transitions occuring half-way between the nodes.
a dataframe of sp (species), reg (discrete character states), and x (continuous character values).
the history of the discrete character presented as a stochastic map.