rStatWn2D {sdetorus} | R Documentation |
Simulation from the stationary density of a WN diffusion in 2D
Description
Simulates from the stationary density of the WN diffusion in 2D.
Usage
rStatWn2D(n, mu, alpha, sigma, rho = 0)
Arguments
n |
sample size. |
mu |
a vector of length |
alpha |
vector of length |
sigma |
vector of length |
rho |
correlation coefficient of |
Value
A matrix of dimension c(n, 2)
containing the samples from the stationary distribution.
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)
plot(rStatWn2D(n = 1000, mu = mu, alpha = alpha, sigma = sigma))
points(toPiInt(mvtnorm::rmvnorm(n = 1000, mean = mu,
sigma = solve(A) %*% Sigma / 2,
method = "chol")), col = 2)
[Package sdetorus version 0.1.10 Index]