Is there a way to detect the autocorrelation in a loop?

3 Ansichten (letzte 30 Tage)
Simon
Simon am 4 Jun. 2013
I'm going to perform a little more than 19,000,000 regressions in a loop (and grow a beard), but i need to now if I can detect the auto correlation on these regressions. I am going to have 90 X's and 75 Y's : each of these x's will be stored in a ''pool'' and i will make all combination of 4 x possible (via nchoosek(90,4) ). But It might happen that my Y will also be a X and if so i don't want it to be tested. OR per exemple if one of my X is the Dow and the Y is the SPX it won't be the same but will contain auto correlation. Any ideas?
  2 Kommentare
Leah
Leah am 4 Jun. 2013
So are you just going to do a Durbin-Watson test inside the loop?
Simon
Simon am 5 Jun. 2013
Altough it seems that i get autocorrelation in EVERY test I do according to dwtest. I use this code :
if true
% code
end%%
%%R^2 adjusted
for i = 1:B
REG = LinearModel.fit(F{1,i});
C{1,i}(1,1) = REG.Rsquared.Adjusted;%%For further analysis
P{1,i} = REG.Residuals.Raw; %%My residuals for dwtest, each cell contains 524x4 residuals
G{1,i} = REG.Coefficients; %%For further analysis
end
end
%%Dwtest
for i = 1:B
N{1,i} = dwtest(P{1,i},15);
if N{1,i} == 0
N{1,i} = [];
end
end

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Simon
Simon am 6 Jun. 2013
Bump

Weitere Antworten (0)

Kategorien

Mehr zu Descriptive Statistics finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by