You are on page 1of 2

Correlation coefficients

Syntax

r = corrcoef(X)

r = corrcoef(X,Y)

Arguments

X:Matrix where each row is an observation and each column is a


variable.

Y:Matrix where each row is an observation and each column is a


variable.

x = randn(30,4); % uncorrelated data

x(:,4) = sum(x,2); % introduce correlation

f = fints((today:today+29)', x); % create a fints object using x

[r,p] = corrcoef(x); % compute sample correlation and p-values

[i,j] = find(p<0.05); % find significant correlations

[i,j] % display their (row,col) indices

ans =

4 1

3 2

2 3
1 4

Class support for inputs X,Y: float: double and single.

You might also like