<< nan_conv2nan Data Correlation and Covariance nan_corrcoef >>

NaN Toolbox >> NaN Toolbox > Data Correlation and Covariance > nan_cor

nan_cor

calculates the correlation matrix

Calling Sequence

nan_cor(X);
nan_cor(X,Y);
c = nan_cor(...);

Parameters

c :

correlation matrix

Description

X and Y can contain missing values encoded with NaN. NaN's are skipped, NaN do not result in a NaN output. (Its assumed that the occurence of NaN's is uncorrelated) The output gives NaN only if there are insufficient input data

COR(X); calculates the (auto-)correlation matrix of X

COR(X,Y); calculates the crosscorrelation between X and Y

NOTE: Under certain circumstances (Missing values and small number of samples) abs(COR) can be larger than 1. If you need abs(COR)<=1, use CORRCOEF. CORRCOEF garantees abs(COR)<=1.

See also

Bibliography

http://mathworld.wolfram.com/CorrelationCoefficient.html

Authors


<< nan_conv2nan Data Correlation and Covariance nan_corrcoef >>