Skip to contents

Evaluates the normalizing constant for the posterior of a fitted DLM.

Usage

eval_dlm_norm_const(model, lin.pred = model$n > 2 * model$k)

Arguments

model

fitted_dlm: A fitted_dlm object.

lin.pred

boolean: A flag indicating if the normalizing constant should be calculated using the linear predictors.

Value

A scalar representing the normalizing constant for the posterior of a fitted DLM.

See also

Other auxiliary functions for fitted_dlm objects: coef.fitted_dlm(), fit_model(), forecast.fitted_dlm(), simulate.fitted_dlm(), smoothing(), update.fitted_dlm()

Examples


data <- c(AirPassengers)

level <- polynomial_block(rate = 1, order = 2, D = 0.95)
season <- harmonic_block(rate = 1, order = 2, period = 12, D = 0.975)

outcome <- Poisson(lambda = "rate", data = data)

fitted.data <- fit_model(level, season,
  AirPassengers = outcome
)
eval_dlm_norm_const(fitted.data)
#> [1] -1316.08