View source: R/confidence_bands.R
| irf_bands | R Documentation |
Constructs confidence bands for structural impulse responses by drawing from the joint asymptotic distribution of the estimator and the common component (Theorem 2.3 of Tugan 2021). This is a parametric simulation, not a residual bootstrap.
irf_bands(
fit,
n_periods,
shock = 1L,
diff_vars = integer(0),
identification = c("short_run", "long_run"),
n_draw = 500L,
level = 0.95,
seed = NULL
)
fit |
An object of class |
n_periods |
Positive integer. Number of IRF horizons. |
shock |
Positive integer. Index of the structural shock (default 1). |
diff_vars |
Integer vector. Variables to cumulate (default none). |
identification |
Character. |
n_draw |
Positive integer. Number of simulation draws (default 500). |
level |
Numeric in (0, 1). Confidence level (default 0.95). |
seed |
Optional integer seed for reproducibility. |
For each of the n_draw repetitions, the function:
Draws \beta^{(b)} \sim N(\hat\beta - \hat b, \hat V) where
\hat b and \hat V are the estimated bias and variance from
asymptotic_var.
Draws the common component \tilde C_{i,t,k} from a normal with
mean \hat F_t \hat\lambda_i and standard deviation
\sqrt{\hat\Xi^*_{i,t,k} / I + \hat\Xi^{**}_{i,t,k} / T},
capturing cross-sectional and time-series uncertainty in factor estimation.
Computes the IRF at (\beta^{(b)}, \tilde C^{(b)}).
The median and the (1-\mathrm{level})/2 and
(1+\mathrm{level})/2 quantiles across draws give the point estimate
and confidence bands.
An object of class "pvarife_bands" with components:
Point estimate (median across draws, bias-corrected),
K \times n\_periods.
Lower confidence bound, K \times n\_periods.
Upper confidence bound, K \times n\_periods.
The confidence level used.
"asymptotic".
Tugan, M. (2021). Panel VAR models with interactive fixed effects. Econometrics Journal, 24, 225–246. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1093/ectj/utaa021")}
bootstrap_irf_bands, compute_irf
sim <- sim_pvarife(n_units = 20, n_time = 15, n_vars = 2,
n_lags = 1, n_factors = 1, seed = 1)
fit <- pvarife(sim$y, n_lags = 1, n_factors = 1, n_out = 5, n_in = 3)
bands <- irf_bands(fit, n_periods = 6, n_draw = 100, seed = 42)
plot(bands)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.