driftWn {sdetorus} | R Documentation |
Drift for the WN diffusion
Description
Drift for the Langevin diffusion associated to the
(multivariate) Wrapped Normal (WN) in dimension p
.
Usage
driftWn(x, A, mu, Sigma, invSigmaA = NULL, maxK = 2, expTrc = 30)
Arguments
x |
matrix of size |
A |
matrix of size |
mu |
vector of length |
Sigma |
diffusion matrix, of size |
invSigmaA |
the matrix |
maxK |
maximum absolute value of the windings considered in the computation of the WN. |
expTrc |
truncation for exponential: |
Details
See Section 2.2.2 in García-Portugués et al. (2019) for details.
driftWn1D
and driftWn2D
are more
efficient for the 1D and 2D cases.
Value
A matrix of the same size as x
containing the drift.
References
García-Portugués, E., Sørensen, M., Mardia, K. V. and Hamelryck, T. (2019) Langevin diffusions on the torus: estimation and applications. Statistics and Computing, 29(2):1–22. doi:10.1007/s11222-017-9790-2
Examples
# 1D
x <- seq(-pi, pi, l = 200)
plot(x, x, type = "n", ylab = "drift")
for (i in 1:20) {
lines(x, driftWn(x = cbind(x), A = 1 * i / 20, mu = 0, Sigma = 1),
col = rainbow(20)[i])
}
# 2D
x <- seq(-pi, pi, l = 100)
plotSurface2D(x, x, f = function(x) sqrt(rowSums(
driftWn(x = x, A = alphaToA(alpha = c(1, 1, 0.5),
sigma = c(1.5, 1.5)), mu = c(0, 0),
Sigma = diag(c(1.5^2, 1.5^2)))^2)), fVect = TRUE)