Learn R Programming

ntwk (version 1.0.0)

likelihood_fn: Likelihood function for the GrOU process with penalty.

Description

Likelihood function for the GrOU process with penalty.

Usage

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

Run this code
# NOT RUN {
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))
# }

Run the code above in your browser using DataLab