Driscoll and Kraay Panel robust covariance matrix
Robust covariance matrix for panel data of Driscoll and Kraay.
Assumes we have a panel of time series where the time index is available. The time index is assumed to represent equal spaced periods. At least one observation per period is required.
results : result instance
nlags : int or None
time : ndarray of int
weights_func : callable
use_correction : ‘cluster’ or ‘hac’ or False
cov : ndarray, (k_vars, k_vars)
Tested against STATA xtscc package, which uses no small sample correction
This first averages relevant variables for each time period over all individuals/groups, and then applies the same kernel weighted averaging over time as in HAC.
Warning: In the example with a short panel (few time periods and many individuals) with mainly across individual variation this estimator did not produce reasonable results.
Options might change when other kernels besides Bartlett and uniform are available.
Daniel Hoechle, xtscc paper Driscoll and Kraay