Simulates from the stationary density of the WN diffusion in 2D.
rStatWn2D(n, mu, alpha, sigma, rho = 0)
A matrix of dimension c(n, 2)
containing the samples from the stationary distribution.
sample size.
a vector of length 2
giving the mean.
vector of length 3
parametrizing the A
matrix as in alphaToA
.
vector of length 2
containing the square root of the diagonal of
correlation coefficient of
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)
Run the code above in your browser using DataLab