corrcoef
Correlation coefficients
๐ Syntax
R = corrcoef(M)
๐ฅ Input argument
M - a vector or matrix
๐ค Output argument
R - Correlation coefficients of M.
๐ Description
R = corrcoef(M) returns the matrix of correlation coefficients forM, where the columns ofM represent random variables and the rows represent observations.
The Pearson correlation coefficient between variables
and
is:
where
and
are the sample means, and
,
are the standard deviations.
The correlation coefficient ranges from -1 to +1, where -1 indicates perfect negative correlation, +1 indicates perfect positive correlation, and 0 indicates no linear correlation.
๐ก Example
๐ See also
๐ History
Version
๐ Description
1.0.0
initial version
Last updated
Was this helpful?