OU {POUMM}R Documentation

Distribution of an Ornstein-Uhlenbeck Process at Time tt, Given Initial State at Time 00

Description

An Ornstein-Uhlenbeck (OU) process represents a continuous time Markov chain parameterized by an initial state x0x_0, selection strength α>0\alpha>0, long-term mean θ\theta, and time-unit variance σ2\sigma^2. Given x0x_0, at time tt, the state of the process is characterized by a normal distribution with mean x0exp(αt)+θ(1exp(αt))x_0 exp(-\alpha t) + \theta (1 - exp(-\alpha t)) and variance σ2(1exp(2αt))/(2α)\sigma^2 (1-exp(-2 \alpha t)) / (2 \alpha). In the limit α>0\alpha -> 0, the OU process converges to a Brownian motion process with initial state x0x_0 and time-unit variance σ2\sigma^2 (at time tt, this process is characterized by a normal distribution with mean x0x_0 and variance tσ2t \sigma^2.

Usage

dOU(z, z0, t, alpha, theta, sigma, log = TRUE)

rOU(n, z0, t, alpha, theta, sigma)

meanOU(z0, t, alpha, theta)

varOU(t, alpha, sigma)

sdOU(t, alpha, sigma)

Arguments

z

Numeric value or vector of size n.

z0

Numeric value or vector of size n, initial value(s) to condition on.

t

Numeric value or vector of size n, denoting the time-step.

alpha, theta, sigma

Numeric values or n-vectors, parameters of the OU process; alpha and sigma must be non-negative. A zero alpha is interpreted as the Brownian motion process in the limit alpha -> 0.

log

Logical indicating whether the returned density should is on the logarithmic scale.

n

Integer, the number of values to sample.

Details

Similar to dnorm and rnorm, the functions described in this help-page support single values as well as vectors for the parameters z, z0, t, alpha, theta and sigma.

Value

dOU returns the conditional probability density(ies) of the elements in z, given the initial state(s) z0, time-step(s) t and OU-parameters by alpha, theta and sigma.

rOU returns a numeric vector of length n, a random sample from the conditional distribution(s) of one or n OU process(es) given initial value(s) and time-step(s).

meanOU returns the expected value of the OU-process at time t.

varOU returns the expected variance of the OU-process at time t.

sdOU returns the standard deviation of the OU-process at time t.

Functions

Examples

z0 <- 8
t <- 10
n <- 100000
sample <- rOU(n, z0, t, 2, 3, 1)
dens <- dOU(sample, z0, t, 2, 3, 1)
var(sample)  # around 1/4
varOU(t, 2, 1) 


[Package POUMM version 2.1.7 Index]