prediction_accuracy: Prediction accuracy measures for a fitted DSGE model

View source: R/prediction-tools.R

prediction_accuracyR Documentation

Prediction accuracy measures for a fitted DSGE model

Description

Computes root mean squared error (RMSE), mean absolute error (MAE), and mean error (bias) of one-step-ahead predictions.

Usage

prediction_accuracy(object, ...)

Arguments

object

A "dsge_fit" object.

...

Additional arguments (currently unused).

Value

An object of class "dsge_prediction_accuracy" containing:

rmse

Named numeric vector of RMSE by variable.

mae

Named numeric vector of MAE by variable.

bias

Named numeric vector of mean error by variable.

n

Number of observations.

variables

Variable names.

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))
  acc <- prediction_accuracy(fit)
  print(acc)



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