dStatWn2D: Stationary density of a WN diffusion (with diagonal diffusion...

View source: R/RcppExports.R

dStatWn2DR Documentation

Stationary density of a WN diffusion (with diagonal diffusion matrix) in 2D

Description

Stationary density of the WN diffusion.

Usage

dStatWn2D(x, alpha, mu, sigma, rho = 0, maxK = 2L, expTrc = 30)

Arguments

x

a matrix of dimension c(n, 2) containing angles. They all must be in [\pi,\pi) so that the truncated wrapping by maxK windings is able to capture periodicity.

alpha

vector of length 3 parametrizing the A matrix as in alphaToA.

mu

a vector of length 2 giving the mean.

sigma

vector of length 2 containing the square root of the diagonal of \Sigma, the diffusion matrix.

rho

correlation coefficient of \Sigma.

maxK

maximum absolute value of the windings considered in the computation of the WN.

expTrc

truncation for exponential: exp(x) with x <= -expTrc is set to zero. Defaults to 30.

Value

A vector of size n containing the stationary density evaluated at x.

Examples

set.seed(345567)
alpha <- c(2, 1, -1)
sigma <- c(1.5, 2)
Sigma <- diag(sigma^2)
A <- alphaToA(alpha = alpha, sigma = sigma)
mu <- c(pi, pi)
dStatWn2D(x = toPiInt(matrix(1:20, nrow = 10, ncol = 2)), mu = mu,
          alpha = alpha, sigma = sigma)
dTpdWou(t = 10, x = toPiInt(matrix(1:20, nrow = 10, ncol = 2)), A = A,
         mu = mu, Sigma = Sigma, x0 = mu)
xth <- seq(-pi, pi, l = 100)
contour(xth, xth, matrix(dStatWn2D(x = as.matrix(expand.grid(xth, xth)),
                                   alpha = alpha, sigma = sigma, mu = mu),
                         nrow = length(xth), ncol = length(xth)), nlevels = 50)
points(rStatWn2D(n = 1000, mu = mu, alpha = alpha, sigma = sigma), col = 2)

sdetorus documentation built on Aug. 21, 2023, 1:08 a.m.

Related to dStatWn2D in sdetorus...