robust_vcov: Robust (sandwich) variance-covariance matrix

View source: R/robust-vcov.R

robust_vcovR Documentation

Robust (sandwich) variance-covariance matrix

Description

Computes the sandwich (Huber-White) variance-covariance matrix for ML-estimated DSGE model parameters. This provides standard errors that are robust to model misspecification.

Usage

robust_vcov(object, ...)

Arguments

object

A "dsge_fit" object estimated via ML.

...

Additional arguments passed to methods (e.g., step for numerical gradient step size).

Details

The sandwich estimator is: V_robust = inv(H) B inv(H), where H is the Hessian of the negative log-likelihood and B is the outer product of the per-observation score vectors.

Value

An object of class "dsge_robust_vcov" containing:

vcov

Robust variance-covariance matrix.

se

Robust standard errors.

se_conventional

Conventional (Hessian-based) standard errors for comparison.

param_names

Parameter names.

Examples


  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))
  rv <- robust_vcov(fit)
  print(rv)



dsge documentation built on Sept. 25, 2026, 5:08 p.m.