필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
Simon
Simon 2013년 6월 4일
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
Leah
Leah 2013년 6월 4일
So are you just going to do a Durbin-Watson test inside the loop?
Simon
Simon 2013년 6월 5일
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

댓글을 달려면 로그인하십시오.

채택된 답변

Simon
Simon 2013년 6월 6일
Bump

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by