Effacer les filtres
Effacer les filtres

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

1 vue (au cours des 30 derniers jours)
Simon
Simon le 4 Juin 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 commentaires
Leah
Leah le 4 Juin 2013
So are you just going to do a Durbin-Watson test inside the loop?
Simon
Simon le 5 Juin 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

Connectez-vous pour commenter.

Réponse acceptée

Simon
Simon le 6 Juin 2013
Bump

Plus de réponses (0)

Catégories

En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by