partial correlation

10 visualizaciones (últimos 30 días)
Jessica
Jessica el 16 de Abr. de 2012
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

Respuestas (1)

Peter Perkins
Peter Perkins el 16 de Abr. de 2012
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.

Categorías

Más información sobre Frequently-used Algorithms en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by