forecast.dsge_dsgevar: Forecasts from a DSGE-VAR Posterior

View source: R/dsge-var-forecast.R

forecast.dsge_dsgevarR Documentation

Forecasts from a DSGE-VAR Posterior

Description

Produces unconditional fan-chart forecasts from a DSGE-VAR posterior returned by bayes_dsge_var or bayes_dsge_var_mh. For each posterior draw of the VAR coefficients and innovation covariance, the function iterates the VAR forward for horizon periods, drawing innovations from the posterior N(0, \Sigma); quantiles across draws give the fan chart.

Usage

## S3 method for class 'dsge_dsgevar'
forecast(object, horizon = 12L, n_paths = 1L, ...)

## S3 method for class 'dsge_dsgevar_mh'
forecast(object, horizon = 12L, n_paths = 1L, ...)

Arguments

object

A dsge_dsgevar or dsge_dsgevar_mh object.

horizon

Integer. Forecast horizon. Default 12.

n_paths

Integer. Number of forecast paths to simulate per posterior draw (each draw uses fresh innovation shocks). Default 1.

...

Additional arguments (currently unused).

Value

An object of class c("dsge_dsgevar_forecast", "dsge_forecast") containing:

forecasts

Tidy data frame (period, variable, value, sd) reporting the posterior mean and standard deviation of the forecast at each (variable, horizon).

forecast_paths

Array (horizon x n_var x total_paths) of individual simulated forecast paths.

history

In-sample data (un-demeaned) for plotting.

horizon, var_names

Inputs.


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