Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

logLik.nongaussian

Log-likelihood of a Non-Gaussian State Space Model


Description

Computes the log-likelihood of a non-Gaussian state space model of bssm package.

Usage

## S3 method for class 'nongaussian'
logLik(
  object,
  particles,
  method = "psi",
  max_iter = 100,
  conv_tol = 1e-08,
  seed = sample(.Machine$integer.max, size = 1),
  ...
)

Arguments

object

Model model.

particles

Number of samples for particle filter or importance sampling. If 0, approximate log-likelihood based on the Gaussian approximation is returned.

method

Sampling method, default is psi-auxiliary filter ("psi"), other choices are "bsf" bootstrap particle filter, and "spdk", which uses the importance sampling approach by Shephard and Pitt (1997) and Durbin and Koopman (1997).

max_iter

Maximum number of iterations for Gaussian approximation algorithm.

conv_tol

Tolerance parameter for the approximation algorithm.

seed

Seed for the random number generator.

...

Ignored.

Examples

model <- ssm_ung(y = c(1,4,3), Z = 1, T = 1, R = 0.5, P1 = 2,
  distribution = "poisson")
  
model2 <- bsm_ng(y = c(1,4,3), sd_level = 0.5, P1 = 2,
  distribution = "poisson")
logLik(model, particles = 0)
logLik(model2, particles = 0)
logLik(model, particles = 10, seed = 1)
logLik(model2, particles = 10, seed = 1)

bssm

Bayesian Inference of Non-Linear and Non-Gaussian State Space Models

v1.1.4
GPL (>= 2)
Authors
Jouni Helske [aut, cre] (<https://orcid.org/0000-0001-7130-793X>), Matti Vihola [aut] (<https://orcid.org/0000-0002-8041-7222>)
Initial release
2021-04-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.