MATLAB Answers

0

How do I write a loop in Matlab

Asked by Robert Henson on 16 Apr 2019
Latest activity Commented on by Walter Roberson
on 16 Apr 2019
How do I write a (double) loop in Matlab that goes through multiple pairs of interest to compute the ADF or Johansen test to see if they cointegrate.

  1 Comment

Maybe something like
rows = size(YourMatrix,1);
for J = 1 : rows
for K = J+1 : rows
result(J,K,:) = jcitest(YourMatrix([J K],:));
result(K,J,:) = result(J,K,:);
end
end

Sign in to comment.

Tags

Products

0 Answers