driftWn: Drift for the WN diffusion

View source: R/drifts.R

driftWnR 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 c(n, p) with the evaluation points for the drift.

A

matrix of size c(p, p) giving the drift strength.

mu

vector of length p with the unconditional mean of the diffusion.

Sigma

diffusion matrix, of size c(p, p).

invSigmaA

the matrix solve(Sigma) %*% A (optional).

maxK

maximum absolute value of the windings considered in the computation of the WN.

expTrc

truncation for exponential: exp(x) with x <= -expTrc is set to zero. Defaults to 30.

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. \Sexpr[results=rd]{tools:::Rd_expr_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)

egarpor/sdetorus documentation built on March 4, 2024, 1:23 a.m.