Rev Language Reference


dnPhyloOrnsteinUhlenbeckStateDependent - Phylogenetic state-dependent Ornstein-Uhlenbeck process

Univariate Ornstein-Uhlenbeck process over an augmented phylogeny (i.e., discrete character history)

Aliases

  • dnPhyloOUSD
  • dnPhOUSD

Usage

dnPhyloOrnsteinUhlenbeckStateDependent(CharacterHistory characterHistory, RealPos alpha, Real theta, RealPos sigma, Real rootValue, String rootTreatment, Natural nSites)

Arguments

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

Domain Type

Details

The phylogenetic state-dependent Ornstein-Uhlenbeck process is an extension to Hansen's (1997) Ornstein-Uhlenbeck process with state-dependent optima. The probability is computed using a pruning algorithm, which is derived from FitzJohn's (2012) pruning algorithm for a phylogenetic state-independent Ornstein-Uhlenbeck process. Specifically, `dnPhyloOUSD` uses an augmented tree structure, i.e., the character history with different character states (also referred to as "regimes"; Hansen 1997). Shifts in the character state are discrete, do not occur concurrently with speciation events, and can be represented by nodes of degree 2. As such, each branch in the augmented tree structure takes exactly one character state. Under this process, branches of the same character state share the same OU parameters (`alpha`, `theta`, `sigma`). These character states can correspond to the states of an observed discrete character. Applications of this model include: 1. State-dependent continuous trait evolution conditional on discrete character history In this application, the discrete character history (in `simmap` format) is read (using `readCharacterHistory`) and specified in the `characterHistory` argument. The `alpha`, `theta`, and `sigma` arugments represent the state-dependent OU parameters that control continuous trait evolution in different discrete character states. Furthermore, the assumed continuous trait value at the root is specified using the `rootTreatment` argument. The continuous trait observations are fixed to the tips using `.clamp()`. 2. Joint inference of discrete character history and state-dependent continuous trait evolution In this application, the discrete character evolution is modeled using the distribution `dnPhyloCTMCDASiteIID` (see Landis et al. 2013, May and Moore 2020). The character history is retrieved from the distribution (using `.characterHistories`) and specified in the `characterHistory` argument. Other parameter specifications are same as above.

Example

# 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)

See Also