Computes a moving-block bootstrap sample for the reduced form errors of a VAR(p) model. Optionally bootstraps a matrix of instruments M.
Value
A list containing:
eps_boot: (T-p) x N matrix of bootstrapped residuals (centered)
M_boot: (T-p) x K matrix of bootstrapped instruments (centered), or empty matrix if M not provided
Details
The moving block bootstrap preserves the temporal dependence structure in the residuals. The default block size follows the recommendation from "Proxy SVARs: Asymptotic Theory, Bootstrap Inference, and the Effects of Income Tax Changes in the United States".
Both residuals and instruments are centered to preserve their sample properties. For instruments, only non-zero values are centered (to handle sparse instruments).
Examples
if (FALSE) { # \dontrun{
# Bootstrap residuals only
eps <- matrix(rnorm(200), 100, 2)
result <- fmbb_var(eps, lags = 2, BlockSize = 0)
eps_boot <- result$eps_boot
# Bootstrap residuals and instruments
M <- matrix(rnorm(100), 100, 1)
result <- fmbb_var(eps, lags = 2, BlockSize = 0, M)
M_boot <- result$M_boot
} # }
