dnPhyloOrnsteinUhlenbeckStateDependent - Phylogenetic state-dependent Ornstein-Uhlenbeck process
| characterHistory : | CharacterHistory (pass by const reference) |
| The character history object from which we obtain the state indices. | |
| alpha : | RealPos (pass by const reference) |
| The rate of attraction/selection (per state). | |
| Default : 0 | |
| theta : | Real (pass by const reference) |
| The optimum value (per state). | |
| Default : 1 | |
| sigma : | RealPos (pass by const reference) |
| The rate of random drift (per state). | |
| Default : 1 | |
| rootValue : | Real (pass by const reference) |
| The value of the continuous trait at root. | |
| Default : NULL | |
| rootTreatment : | String (pass by value) |
| Whether the root value should be assumed to be equal to the optimum at the root (the default), assumed to be a random variable distributed according to the equilibrium state of the OU process, or whether to estimate the ancestral value as an independent parameter. | |
| Default : optimum | |
| Options : optimum|equilibrium|parameter | |
| nSites : | Natural (pass by value) |
| The number of sites which is used for the initialized (random draw) from this distribution. | |
| Default : 1 |
# setup for a two-state phyloOUSD model
num_states = 2 # 0 and 1 are the only states
# option 1: conditioning on a fixed character history
char_hist = readCharacterHistory( simmap_path )[1]
# option 2: joint inference of character history
Q <- fnJC(num_disc_states)
X ~ dnPhyloCTMCDASiteIID(tree, Q, branchRates=1, type="Standard")
# set state-dependent OU parameters
for (i in 1:num_states){
theta[i] ~ dnUniform(-10, 10)
alpha[i] ~ dnLognormal(ln(2), 0.587405)
sigma2[i] ~ dnLognormal(1, 0.587405)
}
# basic use of the function (assuming the continuous trait value at the root is the same at the state-specific optimum)
Y ~ dnPhyloOUSD(char_hist, theta=theta, rootTreatment="optimum", alpha=alpha, sigma=sigma2^0.5)