approxMleWnPairs: Approximate MLE of the WN diffusion in 2D from a sample of...

View source: R/mle.R

approxMleWnPairsR Documentation

Approximate MLE of the WN diffusion in 2D from a sample of initial and final pairs of angles.

Description

Approximate Maximum Likelihood Estimation (MLE) for the Wrapped Normal (WN) diffusion, using the wrapped Ornstein–Uhlenbeck diffusion and assuming initial stationarity.

Usage

approxMleWnPairs(data, delta, start = c(0, 0, 1, 1, 0, 1, 1),
  alpha = rep(NA, 3), mu = rep(NA, 2), sigma = rep(NA, 2), rho = NA,
  lower = c(-pi, -pi, 0.01, 0.01, -25, 0.01, 0.01, -0.99), upper = c(pi,
  pi, 25, 25, 25, 25, 25, 0.99), maxK = 2, expTrc = 30, ...)

Arguments

data

a matrix of dimension c(n, p).

delta

discretization step.

start

starting values, a matrix with p columns, with each entry representing a different starting value.

alpha

vector of length 3 parametrizing the A matrix as in alphaToA.

mu

a vector of length 2 giving the mean.

sigma

vector of length 2 containing the square root of the diagonal of \Sigma, the diffusion matrix.

rho

correlation coefficient of \Sigma.

lower, upper

bound for box constraints as in method "L-BFGS-B" of optim.

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.

...

further parameters passed to mleOptimWrapper.

Value

Output from mleOptimWrapper.

Examples

mu <- c(0, 0)
alpha <- c(1, 2, 0.5)
sigma <- c(1, 1)
rho <- 0.5
set.seed(4567345)
begin <- rStatWn2D(n = 200, mu = mu, alpha = alpha, sigma = sigma)
end <- t(apply(begin, 1, function(x) rTrajWn2D(x0 = x, alpha = alpha,
                                               mu = mu, sigma = sigma,
                                               rho = rho, N = 1,
                                               delta = 0.1)[2, ]))
data <- cbind(begin, end)
approxMleWnPairs(data = data, delta = 0.1,
                 start = c(2, pi/2, 2, 0.5, 0, 2, 1, 0.5))

sdetorus documentation built on Aug. 21, 2023, 1:08 a.m.