partial correlation
조회 수: 13 (최근 30일)
이전 댓글 표시
Hello,
I'd like to calculate the partial correlation between a set of time series of 100 time points each. I put the time series into a matrix, in which the rows correspond to the 100 Time Points and the columns to the number of observations. I tried to calculate it with the following script:
s = size(matrix,2);
X = eye(s);
for i = 1:s; for j = 1:s; d=setdiff(1:s,[i j]); [X(i,j), P(i,j)]=partialcorr(matrix(:,i),matrix(:,j),matrix(:,d));end;end;
Unfortunately it doesn't work and Matlab generates the following error message:
??? Error using ==> corr
Too many input arguments.
Error in ==> partialcorr at 204
coef = corr(resid(:,1:dx),resid(:,dx+1:dx+dy),'type','pearson');
I can't work out a solution on my own. Can anybody help? I would greatly apreciate it.
Cheers, Jessica
댓글 수: 0
답변 (1개)
Peter Perkins
2012년 4월 16일
Most likely you have a function named corr on your path other than the one in the Statistics Toolbox. Type "which corr -all" to find and remove it.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Frequently-used Algorithms에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!