euler1D {sdetorus} | R Documentation |
Simulation of trajectories of the WN or vM diffusion in 1D
Description
Simulation of the Wrapped Normal (WN) diffusion or von Mises (vM) diffusion by the Euler method in 1D, for several starting values.
Usage
euler1D(x0, alpha, mu, sigma, N = 100L, delta = 0.01, type = 1L,
maxK = 2L, expTrc = 30)
Arguments
x0 |
vector of length |
alpha |
drift parameter. |
mu |
mean parameter. Must be in |
sigma |
diffusion coefficient. |
N |
number of discretization steps. |
delta |
discretization step. |
type |
integer giving the type of diffusion. Currently, only |
maxK |
maximum absolute value of the windings considered in the computation of the WN. |
expTrc |
truncation for exponential: |
Value
A matrix of size c(nx0, N + 1)
containing the nx0
discretized trajectories. The first column corresponds to the vector x0
.
Examples
N <- 100
nx0 <- 20
x0 <- seq(-pi, pi, l = nx0 + 1)[-(nx0 + 1)]
set.seed(12345678)
samp <- euler1D(x0 = x0, mu = 0, alpha = 3, sigma = 1, N = N,
delta = 0.01, type = 2)
tt <- seq(0, 1, l = N + 1)
plot(rep(0, nx0), x0, pch = 16, col = rainbow(nx0), xlim = c(0, 1))
for (i in 1:nx0) linesCirc(tt, samp[i, ], col = rainbow(nx0)[i])
[Package sdetorus version 0.1.10 Index]