dTpdPde2D: Transition probability density in 2D by PDE solving

View source: R/pde.R

dTpdPde2DR Documentation

Transition probability density in 2D by PDE solving

Description

Computation of the transition probability density (tpd) of the Wrapped Normal (WN) or Multivariate von Mises (MvM) diffusion, by solving its associated Fokker–Planck Partial Differential Equation (PDE) in 2D.

Usage

dTpdPde2D(Mx = 50, My = 50, x0, t, alpha, mu, sigma, rho = 0,
  type = "WN", Mt = ceiling(100 * t), sdInitial = 0.1, ...)

Arguments

Mx, My

sizes of the equispaced spatial grids in [-\pi,\pi) for each component.

x0

point giving the mean of the initial circular density, an isotropic WN with standard deviations equal to sdInitial.

t

time separating x0 and the evaluation of the tpd.

alpha

for "WN", a vector of length 3 parametrizing the A matrix as in alphaToA. For "vM", a vector of length 3 containing c(alpha[1:2], A[1, 2]), from the arguments alpha and A in driftMvm.

mu

vector of length 2 giving the mean.

sigma

for "WN", a vector of length 2 containing the square root of the diagonal of the diffusion matrix. For "vM", the standard deviation giving the isotropic diffusion matrix.

rho

for "WN", the correlation of the diffusion matrix.

type

either "WN" or "vM".

Mt

size of the time grid in [0, t].

sdInitial

standard deviations of the concentrated WN giving the initial condition.

...

Further parameters passed to crankNicolson2D.

Details

A combination of small sdInitial and coarse space-time discretization (small Mx and Mt) is prone to create numerical instabilities. See Sections 3.4.2, 2.2.1 and 2.2.2 in García-Portugués et al. (2019) for details.

Value

A matrix of size c(Mx, My) with the tpd evaluated at the combinations of seq(-pi, pi, l = Mx + 1)[-(Mx + 1)] and seq(-pi, pi, l = My + 1)[-(My + 1)].

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

M <- 100
x <- seq(-pi, pi, l = M + 1)[-c(M + 1)]
image(x, x, dTpdPde2D(Mx = M, My = M, x0 = c(0, pi), t = 1,
                      alpha = c(1, 1, 0.5), mu = c(pi / 2, 0), sigma = 1:2),
      zlim = c(0, 0.25), col = matlab.like.colorRamps(20),
      xlab = "x", ylab = "y")

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