| qpm_decompose | R Documentation |
Splits the smoothed history of every variable into the additive
contributions of each structural shock plus the carry-over of the
pre-sample initial state: with smoothed shocks e_t,
a_t = sum_j c_j(t) + c_0(t), c_j(t) = P c_j(t-1) + Q_j e_{j,t}
The contributions sum exactly to the smoothed state (deviations from steady state); this identity is verified internally.
qpm_decompose(fit, vars = NULL)
## S3 method for class 'qpm_decomposition'
plot(x, var = NULL, drop_zero = TRUE, periods = NULL, ...)
fit |
A |
vars |
Variables to keep (default: all declared variables). |
x |
A |
var |
Variable to plot. |
drop_zero |
Drop components that never contribute. |
periods |
Optional integer window of period indices to display
(e.g. |
... |
Unused. |
A long data frame of class qpm_decomposition with columns
period, variable, component (shock names plus "initial"),
and value (contribution, in deviations from steady state).
plot() draws a stacked-bar decomposition with the smoothed total
overlaid.
sol <- qpm_solve(qpm_template("bkl"))
obs <- simulate(sol, nsim = 60, seed = 3, burn = 20)
fit <- qpm_filter(sol, obs[, c("period", "pi", "i", "q")])
dec <- qpm_decompose(fit)
plot(dec, var = "pi")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.