hac Function does not deliver result, bug in script

Hi everyone,
I'm trying to use the hac funciton to do heteroscedasticity and autocorrelation robust regression. When I run the hac function, the debugger point out an issue in line 539 of the hac skript that runs automatically when the hac function is used.
PhiHat = w(1)*(V'*V);
for i = 1:T-p-1
LagCov = (V(1+i:T-p,:)'*V(1:T-p-i,:));
PhiHat = PhiHat+w(i+1)*(LagCov+LagCov'); %line 539
end
Does anyone know how to solve this?

Answers (0)

Asked:

on 14 May 2020

Edited:

on 15 May 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!