View source: R/sample-trajectories.R
| rTrajWn2D | R Documentation | 
Simulation of the Wrapped Normal (WN) diffusion in 2D by subsampling a fine trajectory obtained by the Euler discretization.
rTrajWn2D(x0, alpha, mu, sigma, rho = 0, N = 100, delta = 0.01,
  NFine = ceiling(N * delta/deltaFine), deltaFine = min(delta/100, 0.001))
x0 | 
 vector of length   | 
alpha | 
 vector of length   | 
mu | 
 a vector of length   | 
sigma | 
 vector of length   | 
rho | 
 correlation coefficient of   | 
N | 
 number of discretization steps in the resulting trajectory.  | 
delta | 
 discretization step.  | 
NFine | 
 number of discretization steps for the fine trajectory. Must
be larger than   | 
deltaFine | 
 discretization step for the fine trajectory. Must be
smaller than   | 
The fine trajectory is subsampled using the indexes
seq(1, NFine + 1, by = NFine / N).
A matrix of size c(N + 1, 2) containing x0 in the
first entry and the discretized trajectory.
samp <- rTrajWn2D(x0 = c(0, 0), alpha = c(1, 1, -0.5), mu = c(pi, pi),
                    sigma = c(1, 1), N = 1000, delta = 0.01)
plot(samp, xlim = c(-pi, pi), ylim = c(-pi, pi), pch = 19, cex = 0.25,
     xlab = expression(X[t]), ylab = expression(Y[t]), col = rainbow(1000))
linesTorus(samp[, 1], samp[, 2], col = rainbow(1000))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.