Learn R Programming

kDGLM (version 1.2.0)

eval_dlm_norm_const: Auxiliary function for evaluating normalizing constant for the posterior of a fitted DLM.

Description

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

Usage

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

Value

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

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.

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

Run this code

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)

Run the code above in your browser using DataLab