likelihood_fn: Likelihood function for the GrOU process with penalty.

Description Usage Arguments Value Examples

View source: R/likelihood.R

Description

Likelihood function for the GrOU process with penalty.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
likelihood_fn(
  times,
  data,
  thresholds,
  lambda = NA,
  reg = "l1",
  div = 1e+05,
  gamma = NA,
  use_scaling = FALSE,
  mle = NA,
  log = TRUE
)

Arguments

times

Times at which data is given

data

Values to compute the MLE with.

thresholds

Jump threshold values.

lambda

Penalty parameter (defaults to NA with no penalty).

reg

Type of penalty (l1, l2 or adaptive).

div

Batch size/divisor to avoid large memory allocation.

gamma

Adaptive MLE scaling parameter.

use_scaling

Brownian motion covariance matrix scaling in the likelihood.

mle

MLE for adaptive regularisation.

log

Log-scale for the likelihood or not (defaults to FALSE).

Value

(Log)likelihood of the GrOU process with penalty.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
n <- 1000
d <- 10
times <- seq(n)
delta_time <- 0.01
beta_value <- 0.499
noise <- matrix(rnorm(n * d, sd = sqrt(delta_time)), ncol = d)
data <- construct_path(
  diag(d),
  noise = noise, y_init = rep(0, d), delta_time = delta_time
)
thresholds <- rep(delta_time^beta_value, d)
loglik <- likelihood_fn(
  times = times, data = data,
  thresholds = thresholds,
  lambda = 1, div = 1e2
)
loglik(diag(d))

ntwk documentation built on Sept. 13, 2021, 9:07 a.m.