coef.fitted_dlm {kDGLM}R Documentation

coef.fitted_dlm

Description

Evaluates the predictive values for the observed values used to fit the model and its latent states. Predictions can be made with smoothed values, with filtered values or h-steps ahead.

Usage

## S3 method for class 'fitted_dlm'
coef(
  object,
  t.eval = seq_len(object$t),
  lag = -1,
  pred.cred = 0.95,
  eval.pred = FALSE,
  eval.metric = FALSE,
  ...
)

Arguments

object

fitted_dlm: The fitted model to be use for evaluation.

t.eval

numeric: A vector of positive integers indicating the time index from which to extract predictions. The default is to extract to evaluate the model at all observed times.

lag

integer: The relative offset for forecast. Values for time t will be calculated based on the filtered values of time t-h. If lag is negative, then the smoothed distribution for the latent states will be used.

pred.cred

numeric: The credibility level for the C.I..

eval.pred

boolean: A flag indicating if the predictions should be calculated.

eval.metric

boolean: A flag indicating if the model density (f(M|y)) should be calculated. Only used when lag<0.

...

Extra arguments passed to the coef method.

Value

A list containing:

See Also

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

Examples

# Poisson case
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
)

var.vals <- coef(fitted.data)


[Package kDGLM version 1.2.0 Index]