OU: Distribution of an Ornstein-Uhlenbeck Process at Time t,...

Description Usage Arguments Details Value Functions Examples

Description

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

Usage

1
2
3
4
5
6
7
8
9
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

1
2
3
4
5
6
7
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) 

POUMM documentation built on Oct. 27, 2020, 5:06 p.m.