Auxiliary function for evaluating normalizing constant for the posterior of a fitted DLM.
Source:R/main.R
eval_dlm_norm_const.Rd
Evaluates 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
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