Skip to contents

Computes a moving-block bootstrap sample for the reduced form errors of a VAR(p) model. Optionally bootstraps a matrix of instruments M.

Usage

fmbb_var(eps, lags, BlockSize, M = NULL)

Arguments

eps

(T-p) x N matrix of VAR residuals

lags

Integer lag order p of the VAR model

BlockSize

Integer block size for moving block bootstrap. If 0 or negative, automatically computed as round(5.03 * T^0.25)

M

Optional (T-p) x K matrix of instruments to bootstrap (default = NULL)

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
} # }