dTpdMou: Transition probability density of the multivariate OU...

View source: R/OU.R

dTpdMouR Documentation

Transition probability density of the multivariate OU diffusion

Description

Transition probability density of the multivariate Ornstein–Uhlenbeck (OU) diffusion

dX_t=A(\mu - X_t)dt+\Sigma^\frac{1}{2}dW_t, X_0=x_0.

Usage

dTpdMou(x, x0, t, A, mu, Sigma, eigA = NULL, log = FALSE)

meantMou(t, x0, A, mu, eigA = NULL)

covtMou(t, A, Sigma, eigA = NULL)

Arguments

x

matrix of with p columns containing the evaluation points.

x0

initial point.

t

time between observations.

A

the drift matrix, of size c(p, p).

mu

unconditional mean of the diffusion.

Sigma

square of the diffusion matrix, a matrix of size c(p, p).

eigA

optional argument containing eigen(A) for reuse.

log

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

Details

The transition probability density is a multivariate normal with mean meantMou and covariance covtMou. See dTpdOu for the univariate case (more efficient).

solve(A) %*% Sigma has to be a covariance matrix (symmetric and positive definite) in order to have a proper transition density. For the bivariate case, this can be ensured with the alphaToA function. In the multivariate case, it is ensured if Sigma is isotropic and A is a covariance matrix.

Value

A matrix of the same size as x containing the evaluation of the density.

Examples

x <- seq(-4, 4, by = 0.1)
xx <- as.matrix(expand.grid(x, x))
isRStudio <- identical(.Platform$GUI, "RStudio")
if (isRStudio) {
  manipulate::manipulate(
    image(x, x, matrix(dTpdMou(x = xx, x0 = c(1, 2), t = t,
                               A = alphaToA(alpha = c(1, 2, 0.5),
                                            sigma = 1:2),
                               mu = c(0, 0), Sigma = diag((1:2)^2)),
                       nrow = length(x), ncol = length(x)),
          zlim = c(0, 0.25)), t = manipulate::slider(0.1, 5, step = 0.1))
}

egarpor/sdetorus documentation built on March 4, 2024, 1:23 a.m.