2
$\begingroup$

I am running a simple OLS regression with HAC adjustment (i.e. Heteroschedasticity and Autocorrelation adjustment) using the following function in hac() in matlab.

My regression is simple in that I am regressing against a vector of ones only:

$Y = \alpha + \epsilon$

In Matlab, the implementation is as follows (this is only to show how it is implemented, but the variables are not the true ones I use in my real example):

Y = rand(500,1);
X = ones(500, 1);  
hac(X, Y, 'intercept', false, 'weights','BT','display','full')

However, for my real variable Y, I get the error that matrix is not positive definite. I am not sure why that would be at all, since I am regressing against one variable only, which is constant 1!

On the other hand, when I run a simple OLS, then there is no error. Something must be happening when the HAC adjustment is done.

Any help would be appreciated. Thank you!

$\endgroup$
1
$\begingroup$

Is it possible that the "meat" of your sandwich is 0 because you include all residuals in HAC with equal weights?

That is, if that is case, in

$\hat V= n(X'X)^{-1}(X'\hat\Omega X)(X'X)^{-1}$

we have that

$$nX'\hat\Omega X = \left(\sum_t\hat u_t\right)^2,$$

which is zero by the FOC of OLS $\sum_t\hat u_t=0$ when, as is the case here, the regression has a constant.

$\endgroup$
  • $\begingroup$ True.. But then how come it only happens in some datasets, and not others? $\endgroup$ – Mayou Feb 27 '15 at 17:03
  • $\begingroup$ Might depend on how MATLAB takes its decisions when choosing the bandwidth - as in the other post, I cannot help with MATLAB, unfortunately. $\endgroup$ – Christoph Hanck Feb 27 '15 at 18:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.