Learn R Programming

sdetorus (version 0.1.10)

dTpdOu: Transition probability density of the univariate OU diffusion

Description

Transition probability density of the univariate Ornstein--Uhlenbeck (OU) diffusion $$dX_t=\alpha(\mu - X_t)dt+\sigma dW_t, X_0=x_0.$$

Usage

dTpdOu(x, x0, t, alpha, mu, sigma, log = FALSE)

meantOu(x0, t, alpha, mu)

vartOu(t, alpha, sigma)

covstOu(s, t, alpha, sigma)

Value

A vector of the same length as x containing the evaluation of the density.

Arguments

x

vector with the evaluation points.

x0

initial point.

t, s

time between observations.

alpha

strength of the drift.

mu

unconditional mean of the diffusion.

sigma

diffusion coefficient.

log

flag to indicate whether to compute the logarithm of the density.

Details

The transition probability density is a normal density with mean meantOu and variance vartOu. See dTpdMou for the multivariate case (less efficient for dimension one).

Examples

Run this code
x <- seq(-4, 4, by = 0.01)
plot(x, dTpdOu(x = x, x0 = 3, t = 0.1, alpha = 1, mu = -1, sigma = 1),
     type = "l", ylim = c(0, 1.5), xlab = "x", ylab = "Density",
     col = rainbow(20)[1])
for (i in 2:20) {
  lines(x, dTpdOu(x = x, x0 = 3, t = i / 10, alpha = 1, mu = -1, sigma = 1),
        col = rainbow(20)[i])
}

Run the code above in your browser using DataLab