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  (12)

Data  (6)

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:

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 2023).

Text

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

CMS

Wolfram Language. 2007. "Correlation." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2023. 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_2023_correlation, author="Wolfram Research", title="{Correlation}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/Correlation.html}", note=[Accessed: 19-March-2024 ]}

BibLaTeX

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