Learn R Programming

sdetorus (version 0.1.10)

driftMvm: Drift for the MvM diffusion

Description

Drift for the Langevin diffusion associated to the Multivariate von Mises (MvM) in dimension p.

Usage

driftMvm(x, alpha, mu, A = 0)

Value

A matrix of the same size as x containing the drift.

Arguments

x

matrix of size c(n, p) with the evaluation points for the drift.

alpha

vector of length p with the strength of the drift in the diagonal (\(\sin\) terms).

mu

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

A

matrix of size c(p, p) with the strength of the drift in cross terms (\(\cos\)-\(\sin\) terms). The diagonal has to be zero.

Details

See Section 2.2.1 in García-Portugués et al. (2019) for details.

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. tools:::Rd_expr_doi("10.1007/s11222-017-9790-2")

Examples

Run this code
# 1D
x <- seq(-pi, pi, l = 200)
plot(x, x, type = "n", ylab = "drift")
for (i in 0:20) {
  lines(x, driftMvm(x = x, alpha = 3 * i / 20, mu = 0, A = 0),
        col = rainbow(21)[i + 1])
}

# 2D
x <- seq(-pi, pi, l = 100)
plotSurface2D(x, x, f = function(x) sqrt(rowSums(driftMvm(x = x,
              alpha = c(2, 2), mu = c(-1, -1),
              A = rbind(c(0, 0), c(0, 0)))^2)),
              fVect = TRUE)

Run the code above in your browser using DataLab