Correlation

Correlation[v,w]

gives the correlation between the vectors v and w.

Correlation[a,b]

gives the cross-correlation matrix for the matrices a and b.

Correlation[a]

gives the auto-correlation matrix for observations in matrix a.

Correlation[dist]

gives the correlation matrix for the multivariate symbolic distribution dist.

Correlation[dist,i,j]

gives the (i,j)^(th) correlation for the multivariate symbolic distribution dist.

Details

Examples

open allclose all

Basic Examples  (3)

Correlation between two vectors:

Real values:

Correlation matrix for a matrix:

Real values:

Correlation matrix for two matrices:

Real values:

Scope  (14)

Data  (8)

Exact input yields exact output:

Approximate input yields approximate output:

Correlation between vectors of complexes:

Works with large arrays:

A structured array can be used (see the guide):

Find the correlation for data involving quantities:

Correlation between lists of dates:

Correlation between matrices of times:

Distributions and Processes  (6)

Correlation for a continuous multivariate distribution:

Correlation for a discrete multivariate distribution:

Correlation controls the orientation and sharpness of a multivariate probability distribution:

Correlation for derived distributions:

Data distribution:

Correlation matrix for a random process at times s and t:

Correlation matrix for TemporalData at times and :

Applications  (3)

Compute the correlation of two financial time series:

Correlation can be used to measure linear association:

Correlation can only detect monotonic relationships:

HoeffdingD can be used to detect a variety of dependence structures:

Properties & Relations  (7)

The correlation matrix is symmetric and positive semidefinite:

A correlation matrix is a covariance matrix scaled by standard deviations:

Correlation and AbsoluteCorrelation agree for zero mean and unit marginal variances:

SpearmanRho is Correlation applied to ranks:

CorrelationFunction for a process is the off-diagonal entry in the correlation matrix:

Correlation and Covariance are the same for standardized vectors:

The diagonal elements of a correlation matrix are equal to 1:

Wolfram Research (2007), Correlation, Wolfram Language function, https://reference.wolfram.com/language/ref/Correlation.html (updated 2024).

Text

Wolfram Research (2007), Correlation, Wolfram Language function, https://reference.wolfram.com/language/ref/Correlation.html (updated 2024).

CMS

Wolfram Language. 2007. "Correlation." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/Correlation.html.

APA

Wolfram Language. (2007). Correlation. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Correlation.html

BibTeX

@misc{reference.wolfram_2024_correlation, author="Wolfram Research", title="{Correlation}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/Correlation.html}", note=[Accessed: 21-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_correlation, organization={Wolfram Research}, title={Correlation}, year={2024}, url={https://reference.wolfram.com/language/ref/Correlation.html}, note=[Accessed: 21-November-2024 ]}