| parameter_sensitivity | R Documentation |
Evaluates the sensitivity of key model outputs to one-at-a-time parameter perturbations. For each free parameter, the model is re-solved at theta +/- delta, and changes in the log-likelihood, impulse responses, steady state, and policy matrix are recorded.
parameter_sensitivity(x, ...)
## S3 method for class 'dsge_fit'
parameter_sensitivity(
x,
what = c("loglik", "irf"),
delta = 0.01,
irf_horizon = 20L,
...
)
## S3 method for class 'dsge_bayes'
parameter_sensitivity(
x,
what = c("loglik", "irf"),
delta = 0.01,
irf_horizon = 20L,
...
)
x |
A |
... |
Additional arguments (currently unused). |
what |
Character vector specifying which outputs to assess.
Any subset of |
delta |
Numeric. Perturbation size as a fraction of the parameter value. Default is 0.01 (1 percent). |
irf_horizon |
Integer. Number of IRF periods. Default is 20. |
For each parameter \theta_j, the model is solved at
\theta_j (1 + \delta) and \theta_j (1 - \delta).
The numerical derivative is approximated as a central difference.
Elasticities are reported as (\theta_j / f) \cdot (df / d\theta_j),
representing the percentage change in the output for a 1 percent change
in the parameter.
An object of class "dsge_sensitivity" containing:
Data frame of log-likelihood sensitivities (if requested).
Data frame of IRF sensitivities (if requested).
Data frame of steady-state sensitivities (if requested).
Data frame of policy matrix sensitivities (if requested).
Character vector of parameter names.
Perturbation fraction used.
m <- dsge_model(
obs(y ~ z),
state(z ~ rho * z),
start = list(rho = 0.5)
)
set.seed(1)
z <- numeric(100); for (i in 2:100) z[i] <- 0.8*z[i-1]+rnorm(1)
fit <- estimate(m, data = data.frame(y = z))
sa <- parameter_sensitivity(fit)
print(sa)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.