partial correlation

10 ビュー (過去 30 日間)
Jessica
Jessica 2012 年 4 月 16 日
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

回答 (1 件)

Peter Perkins
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.

カテゴリ

Help Center および File ExchangeFrequently-used Algorithms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by