rTpdWn2D {sdetorus} | R Documentation |
Simulation from the approximated transition distribution of a WN diffusion in 2D
Description
Simulates from the approximate transition density of the WN diffusion in 2D.
Usage
rTpdWn2D(n, x0, t, mu, alpha, sigma, rho = 0, maxK = 2L, expTrc = 30)
Arguments
n |
sample size. |
x0 |
a matrix of dimension |
t |
vector of length |
mu |
a vector of length |
alpha |
vector of length |
sigma |
vector of length |
rho |
correlation coefficient of |
maxK |
maximum absolute value of the windings considered in the computation of the WN. |
expTrc |
truncation for exponential: |
Value
An array of dimension c(n, 2, nx0)
containing the n
samples of the transition distribution,
conditioned on that the process was at x0
at t
instants ago. The samples are all in [\pi,\pi)
.
Examples
alpha <- c(3, 2, -1)
sigma <- c(0.5, 1)
mu <- c(pi, pi)
x <- seq(-pi, pi, l = 100)
t <- 0.5
image(x, x, matrix(dTpdWou2D(x = as.matrix(expand.grid(x, x)),
x0 = matrix(rep(0, 100 * 2),
nrow = 100 * 100, ncol = 2),
t = t, mu = mu, alpha = alpha, sigma = sigma,
maxK = 2, expTrc = 30), nrow = 100, ncol = 100),
zlim = c(0, 0.5))
points(rTpdWn2D(n = 500, x0 = rbind(c(0, 0)), t = t, mu = mu, alpha = alpha,
sigma = sigma)[, , 1], col = 3)
points(stepAheadWn2D(x0 = rbind(c(0, 0)), delta = t / 500,
A = alphaToA(alpha = alpha, sigma = sigma),
mu = mu, sigma = sigma, N = 500, M = 500, maxK = 2,
expTrc = 30), col = 4)