Estimate long run variance of errors through Andrews' method
ps_andrews_hac(x)
a numeric value representing the long run variance of errors
vector of residuals
This function computes the long run variance of residuals of an lm model by means of Andrews' with Quadratic Spectral kernel and fixed bandwidth. The code is an adaptation of Phillips and Sul (2007)'s code, which was written in GAUSS.
Andrews, D. W., 1991. Heteroskedasticity and autocorrelation consistent covariance matrix estimation. Econometrica: Journal of the Econometric Society, 817-858.
Phillips, P. C.; Sul, D., 2007. Transition modeling and econometric convergence tests. Econometrica 75 (6), 1771-1855.