| compare_rounds | R Documentation |
Decomposes the forecast revision between two rounds – "inflation for 2027-Q1 is 0.4pp higher than we said in June: why?" – into the contributions of new data (outturns), data revisions, calibration changes, changed conditions, and judgment, by re-running the full pipeline swapping one ingredient at a time. The contributions telescope, so they sum to the total revision exactly; the final step is verified against the new round's archived forecast.
compare_rounds(old, new, variables = NULL, store = "rounds")
## S3 method for class 'qpm_revision'
plot(x, variable = NULL, ...)
old, new |
|
variables |
Variables to decompose (default: all). |
store |
Round store used when |
x |
A |
variable |
Variable to plot. |
... |
Unused. |
Requirements: both rounds must use the same model structure and the
same observables, and their data must carry "YYYY-Qq" period labels
so the calendars align. Comparison covers the calendar quarters both
rounds forecast.
An object of class qpm_revision: a data frame with one row
per variable and overlap period, columns old, new, total, and
the five contributions. Print shows waterfall tables; plot()
draws stacked contribution bars across the overlap.
m <- qpm_template("bkl")
obs <- simulate(qpm_solve(m), nsim = 44, seed = 1, burn = 20)
obs$period <- next_quarters("2015-Q4", 44)
rA <- qpm_round("June", m, obs[1:40, c("period", "pi", "i", "q")], horizon = 8)
rB <- qpm_round("September", m, obs[, c("period", "pi", "i", "q")], horizon = 8)
rB <- add_judgment(rB, pi = stats::setNames(0.3, rB$forecast$periods[2]),
author = "desk", rationale = "tariff")
rev <- compare_rounds(rA, rB)
rev
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.