prediction_interval: Prediction intervals for DSGE models

View source: R/prediction-tools.R

prediction_intervalR Documentation

Prediction intervals for DSGE models

Description

Computes point predictions and prediction intervals using the one-step-ahead innovation variance from the Kalman filter.

Usage

prediction_interval(object, level = 0.95, ...)

Arguments

object

A "dsge_fit" object.

level

Confidence level for prediction intervals (default 0.95).

...

Additional arguments passed to predict().

Value

An object of class "dsge_prediction_interval" with components fit, lower, upper, se, level, and variables.

Examples


  m <- dsge_model(
    obs(y ~ z),
    state(z ~ rho * z),
    start = list(rho = 0.5)
  )
  set.seed(1)
  z <- numeric(100); for (i in 2:100) z[i] <- 0.8 * z[i-1] + rnorm(1)
  fit <- estimate(m, data = data.frame(y = z))
  pi <- prediction_interval(fit, level = 0.95)
  print(pi)



dsge documentation built on Sept. 25, 2026, 5:08 p.m.