| shock_decomposition.dsge_solution | R Documentation |
Decomposes the observed variables into the contributions of each structural shock. At each time t, the observed deviation from steady state is written as a sum of contributions from current and past shocks plus the initial condition contribution.
## S3 method for class 'dsge_solution'
shock_decomposition(x, data, ...)
shock_decomposition(x, ...)
## S3 method for class 'dsge_fit'
shock_decomposition(x, ...)
## S3 method for class 'dsge_bayes'
shock_decomposition(x, ...)
x |
A |
data |
Matrix or data frame of observed data with columns matching
the model's observable names. Required when |
... |
Additional arguments (currently unused). |
The state-space solution gives:
x_t = H^t x_0 + \sum_{j=1}^{t} H^{t-j} M \varepsilon_j
The historical decomposition partitions the observed variables
y_t = Z x_t into the contribution of each structural shock
\varepsilon_j^{(k)} accumulated through the propagation mechanism.
The sum of all contributions (including the initial condition term)
reproduces the smoothed observables exactly.
An object of class "dsge_decomposition" containing:
A 3D array with dimensions
[T, n_obs, n_shocks + 1]. The last slice contains the initial
condition contribution.
Character vector of observed variable names.
Character vector of shock names (plus "initial").
T x n_obs matrix of observed data (deviations).
m <- dsge_model(
obs(y ~ z),
state(z ~ rho * z),
start = list(rho = 0.5)
)
set.seed(1)
e <- rnorm(100)
z <- numeric(100); for (i in 2:100) z[i] <- 0.8*z[i-1]+e[i]
fit <- estimate(m, data = data.frame(y = z))
hd <- shock_decomposition(fit)
plot(hd)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.