The Python package statsmodels
provides a use_correction
option when computing HAC standard errors for an OLS model, which purportedly corrects for small sample size. When I dug into the code however, I encountered the following comment:
just guessing on correction factor, need reference
This caused a little alarm, since this correction factor significantly affects the interpretation of my fit.
The correction factor, as far as I understand the code, seems to consist in simply multiplying the usual HAC covariance matrix with $n / (n - k)$, where $n$ is the number of observations and $k$ the number of parameters in the model. While this seems plausible, I am no expert, and would very much (like the code's author) appreciate a justification or reference for this factor.
statsmodels
does have different options for HC0 and HAC: statsmodels.org/dev/generated/… $\endgroup$statsmodels
is computing the equivalent of HC1 in the article you linked to, but for the HAC covariance matrix instead of the HC0 one. $\endgroup$