logLikWouPairs | R Documentation |
Computation of the loglikelihood for a WN diffusion (with diagonal diffusion matrix) from a sample of initial and final pairs of angles.
logLikWouPairs(x, t, alpha, mu, sigma, rho = 0, maxK = 2L, expTrc = 30)
x |
a matrix of dimension |
t |
either a scalar or a vector of length |
alpha |
vector of length |
mu |
a vector of length |
sigma |
vector of length |
rho |
correlation coefficient of |
maxK |
maximum absolute value of the windings considered in the computation of the WN. |
expTrc |
truncation for exponential: |
A negative penalty is added if positive definiteness is violated. If the output value is Inf, -100 * N is returned instead.
A scalar giving the final loglikelihood, defined as the sum of the loglikelihood of the initial angles according to the stationary density and the loglikelihood of the transitions from initial to final angles.
set.seed(345567)
x <- toPiInt(matrix(rnorm(200, mean = pi), ncol = 4, nrow = 50))
alpha <- c(2, 1, -0.5)
mu <- c(0, pi)
sigma <- sqrt(c(2, 1))
# The same
logLikWouPairs(x = x, t = 0.5, alpha = alpha, mu = mu, sigma = sigma)
sum(
log(dStatWn2D(x = x[, 1:2], alpha = alpha, mu = mu, sigma = sigma)) +
log(dTpdWou2D(x = x[, 3:4], x0 = x[, 1:2], t = 0.5, alpha = alpha, mu = mu,
sigma = sigma))
)
# Different times
logLikWouPairs(x = x, t = (1:50) / 50, alpha = alpha, mu = mu, sigma = sigma)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.