Logo

scikits.statsmodels.sandbox.stats.diagnostic.neweywestcov

scikits.statsmodels.sandbox.stats.diagnostic.neweywestcov(resid, x)[source]

Did not run yet

from regstats2

if idx(29) % HAC (Newey West)
L = round(4*(nobs/100)^(2/9));
% L = nobs^.25; % as an alternative
hhat = repmat(residuals',p,1).*X';
xuux = hhat*hhat';
for l = 1:L;
    za = hhat(:,(l+1):nobs)*hhat(:,1:nobs-l)';
    w = 1 - l/(L+1);
    xuux = xuux + w*(za+za');
end
d = struct;
d.covb = xtxi*xuux*xtxi;

Previous topic

sm.sandbox.stats.diagnostic.unitroot_adf

Next topic

sm.sandbox.stats.diagnostic.recursive_olsresiduals

This Page