qpm_condition: Conditional forecasts: impose paths, back out the shocks

View source: R/condition.R

qpm_conditionR Documentation

Conditional forecasts: impose paths, back out the shocks

Description

Imposes hard conditions on future values of model variables and finds the minimum-norm structural shocks (in standard-deviation units, optionally restricted to instruments) that deliver them. This is how a policy question becomes a forecast: "what if the policy rate is held at 3.5 for four quarters?" or "what paths are consistent with inflation back at target by 2027?".

Usage

qpm_condition(fc, ..., anticipated = FALSE, instruments = NULL)

Arguments

fc

A qpm_forecast from qpm_forecast(), or a qpm_round (its forecast is conditioned and the round returned).

...

Named conditions: one argument per variable, each a named vector of levels by period, e.g. i = c("2026-Q4" = 3.5, "2027-Q1" = 3.5) or pi4 = c(h4 = 2).

anticipated

Logical; announced-at-start (TRUE) vs period-by-period surprises (FALSE, default).

instruments

Character vector of shocks allowed to move; default all shocks.

Details

The anticipated switch is the economics: TRUE means the whole conditioned path is announced at the start of the forecast, so expectations react immediately (forward-looking variables move before the conditioning bites); FALSE means the implied shocks arrive as period-by-period surprises. The two produce materially different paths in any forward-looking model, and practitioners frequently do not know which one their tools assume.

Fan bands are recomputed as the Gaussian conditional distribution of the path given the conditions (using all shocks), so conditioned points have (near) zero width. The mean path uses only the chosen instruments; when instruments is restricted, mean and bands answer slightly different questions – see Antolin-Diaz, Petrella and Rubio-Ramirez (2021) for the full treatment, which is on the qpmR roadmap.

Value

The conditioned qpm_forecast, with ⁠$shocks_implied⁠ (raw units), ⁠$shocks_implied_std⁠ (standard deviations), and the conditions recorded. Printing summarizes the implied shocks and flags any larger than two standard deviations.

Examples

sol <- qpm_solve(qpm_template("bkl"))
fc <- qpm_forecast(sol, horizon = 8)
hold <- qpm_condition(fc, i = c(h1 = 9.5, h2 = 9.5, h3 = 9.5, h4 = 9.5),
                      anticipated = TRUE, instruments = "eps_i")
hold

qpmR documentation built on Sept. 29, 2026, 5:10 p.m.