相关分析:修订间差异

来自决策链云智库
无编辑摘要
(页面内容被替换为“2002年,Higham<ref>{{cite journal|title=Computing the nearest correlation matrix—a problem from finance|journal=IMA Journal of Numerical Analysis|date=2002|first=Nicholas J.|last=Higham|volume=22|issue=3|pages=329–343|doi=10.1093/imanum/22.3.329|citeseerx=10.1.1.661.2180}}</ref> 使用弗罗贝尼乌斯范数定义了接近度的概念,并提供了一种使用迪克斯特拉投影算法计算最近…”)
标签替换
第1行: 第1行:
{{Short description|统计学概念}}
{{About|统计数据中的相关性和依赖性||Correlation (disambiguation)}}
[[File:Correlation examples2.svg|thumb|400px|right|几组(''x'',&nbsp;''y'')点,以及每组的[[Pearson correlation coefficient|皮尔逊相关系数]]。这些相关性反映了线性关系的噪声性和方向(顶部行),但不包括该关系的斜率(中间),以及非线性关系的许多方面(底部)。注意:中间的图形斜率为0,但在这种情况下,相关系数是未定义的,因为''Y''的方差为零。]]
在[[statistics|统计学]]中,'''相关性'''或'''依赖性'''是指两个[[random variable|随机变量]]或[[bivariate data|双变量数据]]之间的任何统计关系,无论其是否[[causality|因果]]。尽管从广义上讲,“相关性”可能指任何类型的关联,在统计学中,它通常指的是一对变量''[[line (geometry)|线性地]]''相关的程度。熟悉的相关现象示例包括[[human height|父母身高]]与其后代之间的相关性,以及商品价格与消费者愿意购买数量之间的相关性,正如所谓的[[demand curve|需求曲线]]所描述的。
相关性之所以有用,是因为它们可以指示出可以在实践中利用的预测关系。例如,电力公司可能在温和的天气下根据电力需求和天气之间的相关性减少发电量。在这个例子中,存在一个[[causality|因果关系]],因为[[extreme weather|极端天气]]导致人们使用更多的电力进行取暖或制冷。然而,一般而言,存在相关性并不足以推断出存在因果关系(即[[correlation does not imply causation|相关性并不意味着因果性]])。
正式地说,如果随机变量不满足[[independence (probability theory)|概率独立性]]的数学特性,它们就是''依赖的''。在非正式用语中,''相关性''与''依赖性''是同义的。然而,在技术意义上使用时,相关性指的是[[Conditional expectation|测试变量及其各自期望值]]之间的几种特定类型的数学运算之一。本质上,相关性是衡量两个或多个变量之间关系的度量。有几种[[correlation coefficient|相关系数]],通常用[math]\rho[/math]或[math]r[/math]表示,用以衡量相关程度。其中最常见的是''[[Pearson product-moment correlation coefficient|皮尔逊相关系数]]'',它只对两个变量之间的线性关系敏感(即使当其中一个变量是另一个的非线性函数时,这种关系也可能存在)。其他的相关系数——如''[[Spearman's rank correlation coefficient|斯皮尔曼等级相关]]''——已被开发出来,比皮尔逊的更加[[robust statistics|健壮]],即对非线性关系更敏感。<ref>Croxton, Frederick Emory; Cowden, Dudley Johnstone; Klein, Sidney (1968) ''Applied General Statistics'', Pitman. {{ISBN|9780273403159}} (page 625)</ref><ref>Dietrich, Cornelius Frank (1991) ''Uncertainty, Calibration and Probability: The Statistics of Scientific and Industrial Measurement'' 2nd Edition, A. Higler. {{ISBN|9780750300605}} (Page 331)</ref><ref>Aitken, Alexander Craig (1957) ''Statistical Mathematics'' 8th Edition. Oliver & Boyd. {{ISBN|9780050013007}}  (Page 95)</ref> [[Mutual information|互信息]]也可以用来衡量两个变量之间的依赖性。
==皮尔逊积矩相关系数==
{{Main|Pearson product-moment correlation coefficient}}
[[File:Pearson Correlation Coefficient and associated scatterplots.png|thumb|各种数据集的散点图示例,展示了不同的相关系数。]]
两个量之间依赖关系的最常见度量是[[Pearson product-moment correlation coefficient]](PPMCC),即“皮尔逊相关系数”,通常简称为“相关系数”。它通过取我们数值数据集中所讨论的两个变量的协方差与它们方差的平方根的比值获得。数学上,简单地将两个变量的[[covariance]]除以它们[[standard deviation]]的乘积。[[Karl Pearson]]从[[Francis Galton]]的一个类似但略有不同的想法中发展出了这个系数。<ref name="thirteenways">{{cite journal | last1 = Rodgers | first1 = J. L. | last2 = Nicewander | first2 = W. A. | year = 1988 | title = Thirteen ways to look at the correlation coefficient | journal = The American Statistician | volume = 42 | issue = 1| pages = 59–66 | jstor=2685263 | doi=10.1080/00031305.1988.10475524}}</ref>
皮尔逊积矩相关系数试图通过在两个变量的数据集中建立最佳拟合线,基本上展示了预期值,而所得到的皮尔逊相关系数表明实际数据集与预期值的偏离程度。根据我们的皮尔逊相关系数的符号,如果数据集中的变量之间存在某种关系,我们可能会得到负相关或正相关。{{cn|date=November 2023}}
两个[[random variables]] <math>X</math> 和 <math>Y</math> 之间的总体相关系数 <math>\rho_{X,Y}</math>,它们具有[[expected value]]s <math>\mu_X</math> 和 <math>\mu_Y</math> 以及[[standard deviation]]s <math>\sigma_X</math> 和 <math>\sigma_Y</math>,定义如下:
<math display=block>\rho_{X,Y} = \operatorname{corr}(X,Y) = {\operatorname{cov}(X,Y) \over \sigma_X \sigma_Y} = {\operatorname{E}[(X-\mu_X)(Y-\mu_Y)] \over \sigma_X\sigma_Y}, \quad \text{if}\ \sigma_{X}\sigma_{Y}>0.</math>
其中 <math>\operatorname{E}</math> 是[[expected value]]运算符,<math>\operatorname{cov}</math> 表示[[covariance]],<math>\operatorname{corr}</math> 是相关系数的广泛使用的替代符号。只有当两个标准差都是有限且正数时,皮尔逊相关才有定义。纯粹用[[moment (mathematics)|moments]]表示的替代公式是:
<math display=block>\rho_{X,Y} =  {\operatorname{E}(XY)-\operatorname{E}(X)\operatorname{E}(Y)\over \sqrt{\operatorname{E}(X^2)-\operatorname{E}(X)^2}\cdot \sqrt{\operatorname{E}(Y^2)-\operatorname{E}(Y)^2} }</math>
===相关性和独立性===
[[Cauchy–Schwarz inequality]]的一个推论是皮尔逊相关系数的[[absolute value]]不大于1。因此,相关系数的值范围在−1和+1之间。在完美的直接(增长)线性关系(相关)情况下,相关系数为+1,在完美的逆向(减少)线性关系('''反相关''')情况下,相关系数为−1,<ref>Dowdy, S. and Wearden, S. (1983). "Statistics for Research", Wiley. {{ISBN|0-471-08602-9}} pp 230</ref> 在所有其他情况下,相关系数为 <math>(-1,1)</math> 之间的某个值,表明变量之间的[[linear dependence]]程度。当它接近零时,关系较少(更接近无关)。相关系数越接近−1或1,变量之间的相关性越强。
==皮尔逊积矩相关系数==
{{Main|Pearson product-moment correlation coefficient}}
[[File:Pearson Correlation Coefficient and associated scatterplots.png|thumb|各种数据集的散点图示例,展示了不同的相关系数。]]
当两个变量是[[statistical independence|独立的]]时,皮尔逊相关系数为0,但反之不一定成立,因为相关系数只检测两个变量之间的线性依赖。简单来说,如果两个随机变量X和Y是独立的,那么它们是不相关的;但如果两个随机变量不相关,它们可能是独立的,也可能不是。
[math display=block]\begin{align}
X,Y \text{ 独立} \quad & \Rightarrow \quad \rho_{X,Y} = 0 \quad (X,Y \text{ 不相关})\\
\rho_{X,Y} = 0 \quad (X,Y \text{ 不相关})\quad & \nRightarrow \quad X,Y \text{ 独立}
\end{align}[/math]
例如,假设随机变量 <math>X</math> 关于零对称分布,并且 <math>Y=X^2</math>。那么 <math>Y</math> 完全由 <math>X</math> 决定,因此 <math>X</math> 和 <math>Y</math> 是完全依赖的,但它们的相关性为零;它们是[[uncorrelated|不相关的]]。然而,在特殊情况下,当 <math>X</math> 和 <math>Y</math> 是[[Joint normality|联合正态分布]]时,不相关性等同于独立性。
尽管不相关的数据不一定意味着独立性,但如果随机变量的[[mutual information|互信息]]为0,可以检查它们是否独立。
===样本相关系数===
对于一组 <math>n</math> 次测量的对 <math>(X_i,Y_i)</math>(由 <math>i=1,\ldots,n</math> 索引),可以使用''样本相关系数''来估计 <math>X</math> 和 <math>Y</math> 之间的总体皮尔逊相关系数 <math>\rho_{X,Y}</math>。样本相关系数定义如下:
:<math>
r_{xy} \quad \overset{\underset{\mathrm{def}}{}}{=} \quad \frac{\sum\limits_{i=1}^n (x_i-\bar{x})(y_i-\bar{y})}{(n-1)s_x s_y}
=\frac{\sum\limits_{i=1}^n (x_i-\bar{x})(y_i-\bar{y})}
{\sqrt{\sum\limits_{i=1}^n (x_i-\bar{x})^2 \sum\limits_{i=1}^n (y_i-\bar{y})^2}},
[/math]
其中 <math>\overline{x}</math> 和 <math>\overline{y}</math> 分别是 <math>X</math> 和 <math>Y</math> 的样本[[arithmetic mean|算术平均值]],<math>s_x</math> 和 <math>s_y</math> 是 <math>X</math> 和 <math>Y</math> 的[[Standard deviation#Corrected sample standard deviation|校正样本标准差]]。
<math>r_{xy}</math> 的等效表达式是:
:<math>
\begin{align}
r_{xy} &=\frac{\sum x_iy_i-n \bar{x} \bar{y}}{n s'_x s'_y} \\[5pt]
&=\frac{n\sum x_iy_i-\sum x_i\sum y_i}{\sqrt{n\sum x_i^2-(\sum x_i)^2}~\sqrt{n\sum y_i^2-(\sum y_i)^2}}.
\end{align}
[/math]
其中 <math>s'_x</math> 和 <math>s'_y</math> 分别是 <math>X</math> 和 <math>Y</math> 的[[Standard deviation#Uncorrected sample standard deviation|未校正样本标准差]]。
如果 <math>x</math> 和 <math>y</math> 是包含测量误差的测量结果,相关系数的实际限制不是−1到+1,而是更小的范围。<ref>{{cite journal|last=Francis|first=DP|author2=Coats AJ|author3=Gibson D|title=How high can a correlation coefficient be?|journal=Int J Cardiol|year=1999|volume=69|pages=185–199|doi=10.1016/S0167-5273(99)00028-5|issue=2|pmid=10549842}}</ref> 对于单独自变量的线性模型,[[Coefficient of determination|决定系数(R平方)]]是 <math>r_{xy}</math>,即皮尔逊积矩系数的平方。
==示例==
考虑下表中给出的 {{mvar|X}} 和 {{mvar|Y}} 的[[joint probability distribution|联合概率分布]]。
:{| class="wikitable" style="text-align:center;"
|+ <math>\mathrm{P}(X=x,Y=y)</math>
! {{diagonal split header|{{mvar|x}}|{{mvar|y}}}}
!&minus;1
!0
!1
|-
!0
|0
|{{sfrac|1|3}}
|0
|-
!1
|{{sfrac|1|3}}
|0
|{{sfrac|1|3}}
|}
==联合分布的边缘分布==
针对这个联合分布,其边缘分布如下所示:
:[math]\mathrm{P}(X=x)=
\begin{cases}
\frac 1 3 & \quad \text{对于 } x=0 \\
\frac 2 3 & \quad \text{对于 } x=1
\end{cases}
[/math]
:[math]\mathrm{P}(Y=y)=
\begin{cases}
\frac 1 3 & \quad \text{对于 } y=-1 \\
\frac 1 3 & \quad \text{对于 } y=0 \\
\frac 1 3 & \quad \text{对于 } y=1
\end{cases}
[/math]
这导致了以下期望值和方差:
:[math]\mu_X = \frac 2 3[/math]
:[math]\mu_Y = 0[/math]
:[math]\sigma_X^2 = \frac 2 9[/math]
:[math]\sigma_Y^2 = \frac 2 3[/math]
因此:
: [math]
\begin{align}
\rho_{X,Y} & = \frac{1}{\sigma_X \sigma_Y} \mathrm{E}[(X-\mu_X)(Y-\mu_Y)] \\[5pt]
& = \frac{1}{\sigma_X \sigma_Y} \sum_{x,y}{(x-\mu_X)(y-\mu_Y) \mathrm{P}(X=x,Y=y)} \\[5pt]
& = \left(1-\frac 2 3\right)(-1-0)\frac{1}{3} + \left(0-\frac 2 3\right)(0-0)\frac{1}{3} + \left(1-\frac 2 3\right)(1-0)\frac{1}{3} = 0.
\end{align}
[/math]
==秩相关系数==
{{Main|Spearman's rank correlation coefficient|Kendall tau rank correlation coefficient}}
像[[Spearman's rank correlation coefficient]](斯皮尔曼等级相关系数)和[[Kendall's tau|Kendall的秩相关系数 (τ)]]这样的秩相关系数,用来衡量随着一个变量增加,另一个变量也倾向于增加的程度,而不要求这种增加必须通过线性关系来表示。如果当一个变量增加时,另一个变量''减少'',秩相关系数将是负的。通常认为这些秩相关系数是皮尔逊系数的替代品,用于减少计算量或使系数对分布中的非正态性不那么敏感。然而,这种观点在数学上并无太多依据,因为秩相关系数衡量的是与[[Pearson product-moment correlation coefficient]](皮尔逊积矩相关系数)不同类型的关系,并且最好被视为不同类型的关联度量,而不是人口相关系数的另一种度量。<ref name="Yule and Kendall">Yule, G.U and Kendall, M.G. (1950), "An Introduction to the Theory of Statistics", 14th Edition (5th Impression 1968). Charles Griffin & Co. pp 258–270</ref><ref name="Kendall Rank Correlation Methods">Kendall, M. G. (1955) "Rank Correlation Methods", Charles Griffin & Co.</ref>
为了说明秩相关的性质及其与线性相关的区别,考虑以下四对数字 <math>(x,y)</math>:
:(0,&nbsp;1), (10,&nbsp;100), (101,&nbsp;500), (102,&nbsp;2000)。
当我们从一对数到另一对数时,<math>x</math>增加,<math>y</math>也增加。这种关系是完美的,意味着<math>x</math>的增加''总是''伴随着<math>y</math>的增加。这意味着我们有一个完美的秩相关,斯皮尔曼和肯德尔的相关系数都是1,而在这个例子中皮尔逊积矩相关系数为0.7544,表明这些点远离直线。同样地,如果<math>y</math>在<math>x</math>''增加''时总是''减少'',秩相关系数将是-1,而皮尔逊积矩相关系数可能接近-1,也可能不接近,这取决于这些点与直线的接近程度。尽管在完美秩相关的极端情况下,两个系数都是相等的(都是+1或-1),但通常情况下并非如此,因此两个系数的值不能有意义地进行比较。<ref name="Yule and Kendall"/>例如,对于三对数(1,&nbsp;1) (2,&nbsp;3) (3,&nbsp;2),斯皮尔曼系数是1/2,而肯德尔系数是&nbsp;1/3。
==其他衡量随机变量相依性的方法==
{{See also|Pearson product-moment correlation coefficient#Variants}}
仅靠相关系数所提供的信息并不足以定义随机变量之间的依赖结构。<ref name="wilmottM.com">{{cite journal|author=Mahdavi Damghani B.|title=The Non-Misleading Value of Inferred Correlation: An Introduction to the Cointelation Model|journal=Wilmott Magazine|volume=2013|issue=67|pages=50–61|year=2013|doi=10.1002/wilm.10252 }}</ref> 在某些特殊情况下,例如当分布是[[multivariate normal distribution]]时,相关系数完全定义了依赖结构。在[[elliptical distribution]]的情况下,它描述了等密度的(超)椭圆;然而,它并不完全描述依赖结构(例如,[[multivariate t-distribution]]的自由度决定了尾部依赖的程度)。
[[Distance correlation]]<ref>{{cite journal | last1 = Székely | first1 = G. J. Rizzo | last2 = Bakirov | first2 = N. K. | year = 2007 | title = Measuring and testing independence by correlation of distances | journal = [[Annals of Statistics]] | volume = 35 | issue = 6| pages = 2769–2794 | doi = 10.1214/009053607000000505 | arxiv = 0803.4101 | s2cid = 5661488 }}</ref><ref>{{cite journal | last1 = Székely | first1 = G. J. | last2 = Rizzo | first2 = M. L. | year = 2009 | title = Brownian distance covariance | journal = Annals of Applied Statistics | volume = 3 | issue = 4| pages = 1233–1303 | doi = 10.1214/09-AOAS312 | pmid = 20574547 | pmc = 2889501 | arxiv = 1010.0297 }}</ref> 被引入是为了弥补Pearson相关系数的不足,即它可能对依赖的随机变量为零;零距离相关性意味着独立。
随机依赖系数<ref>Lopez-Paz D. and Hennig P. and Schölkopf B. (2013). "The Randomized Dependence Coefficient", "[[Conference on Neural Information Processing Systems]]" [ Reprint]</ref> 是一个基于[[Copula (probability theory)|copula]]的多变量随机变量之间依赖性的计算效率高的衡量方法。RDC对随机变量的非线性缩放不变,能够发现广泛的功能关联模式,并在独立时取值为零。
对于两个[[binary data|二元变量]],[[odds ratio]]衡量它们的依赖性,并取非负数值范围,可能为无穷大:{{tmath|[0, +\infty]}}。相关的统计量如[[Yule's Y|Yule's ''Y'']]和[[Yule's Q|Yule's ''Q'']]将其规范化到类似相关系数的范围{{tmath|[-1, 1]}}。[[logistic regression|逻辑模型]]将赔率比推广,用于模拟依赖变量是离散的情况,且可能有一个或多个独立变量。
[[correlation ratio]]、基于[[Entropy (information theory)|熵]]的[[mutual information]]、[[total correlation]]、[[dual total correlation]]和[[polychoric correlation]]都能够检测更一般的依赖性,考虑它们之间的[[copula (statistics)|copula]]也是如此,而[[coefficient of determination]]将相关系数推广到[[multiple regression]]。
==对数据分布的敏感性==
{{Further|Pearson product-moment correlation coefficient#Sensitivity to the data distribution}}
变量{{mvar|X}}和{{mvar|Y}}之间的依赖程度不取决于这些变量表达的尺度。也就是说,如果我们分析{{mvar|X}}和{{mvar|Y}}之间的关系,大多数相关度量不会受到将{{mvar|X}}转换为[math]a + bX[/math]和{{mvar|Y}}转换为[math]c + dY[/math]的影响,其中a、b、c和d是常数(b和d为正数)。这适用于某些相关统计量以及它们的[[Population (statistics)|人口]]类似物。一些相关统计量,如秩相关系数,也对{{mvar|X}}和/或{{mvar|Y}}的边缘分布的[[monotone function|单调变换]]保持不变。
[[File:correlation range dependence.svg|300px|right|thumb|当{{mvar|X}}和{{mvar|Y}}两个变量的范围不受限制时,以及{{mvar|X}}的范围限制在区间(0,1)时,展示了{{mvar|X}}与{{mvar|Y}}之间的[[Pearson product moment correlation coefficient|Pearson]]/[[Spearman's rank correlation coefficient|Spearman]]相关系数。]]大多数相关度量对于{{mvar|X}}和{{mvar|Y}}的抽样方式是敏感的。如果在更广范围的值上观察,依赖关系往往更强。因此,如果我们考虑所有成年男性父亲与其儿子身高之间的相关系数,并将其与仅选择身高在165厘米到170厘米之间的父亲时计算的同一相关系数进行比较,后者情况下的相关性会更弱。已经开发出几种技术试图纠正一个或两个变量中的范围限制,并且通常在元分析中使用;最常见的是Thorndike的第二和第三案例方程。<ref>{{cite book|last=Thorndike|first=Robert Ladd|title=Research problems and techniques (Report No. 3)|year=1947|publisher=US Govt. print. off.|location=Washington DC}}</ref>
对于{{mvar|X}}和{{mvar|Y}}的某些联合分布,使用中的各种相关度量可能是未定义的。例如,Pearson相关系数是基于[[moment (mathematics)|矩]]定义的,因此如果矩是未定义的,它也将是未定义的。基于[[quantile]]的依赖度量始终是定义的。旨在估计人口依赖度量的基于样本的统计量可能具有或可能不具有如无偏性或[[consistent estimator|渐近一致性]]等理想的统计属性,这取决于采样数据的人口空间结构。
对数据分布的敏感性可以被用作优势。例如,[[scaled correlation]]旨在利用对范围的敏感性来挑选出时间序列中快速组成部分之间的相关性。<ref name = "Nikolicetal">{{cite journal | last1 = Nikolić | first1 = D | last2 = Muresan | first2 = RC | last3 = Feng | first3 = W | last4 = Singer | first4 = W | year = 2012 | title = Scaled correlation analysis: a better way to compute a cross-correlogram | journal = European Journal of Neuroscience | volume = 35| issue = 5| pages = 1–21 | doi = 10.1111/j.1460-9568.2011.07987.x | pmid = 22324876 | s2cid = 4694570 }}</ref>通过以受控方式减少值的范围,过滤掉长时间尺度上的相关性,仅揭示短时间尺度上的相关性。
== 相关矩阵 ==
[math]n[/math]个随机变量[math]X_1,\ldots,X_n[/math]的相关矩阵是一个[math]n \times n[/math]矩阵[math]C[/math],其[math](i,j)[/math]项定义为
:[math]c_{ij}:=\operatorname{corr}(X_i,X_j)=\frac{\operatorname{cov}(X_i,X_j)}{\sigma_{X_i}\sigma_{X_j}},\quad \text{若}\ \sigma_{X_i}\sigma_{X_j}>0.[/math]
因此,对角线上的条目都是[[unity (number)|一]]。如果使用的相关性度量是乘积矩相关系数,相关矩阵与[[standardized variable|标准化随机变量]] [math]X_i / \sigma(X_i)[/math] 的[[covariance matrix|协方差矩阵]]相同,适用于[math]i = 1, \dots, n[/math]。这适用于人口相关矩阵(在这种情况下[math]\sigma[/math]是人口标准差)和样本相关矩阵(在这种情况下[math]\sigma[/math]表示样本标准差)。因此,每个矩阵都必然是[[positive-semidefinite matrix|半正定矩阵]]。此外,如果没有变量的所有值都可以精确地作为其他变量值的线性函数生成,则相关矩阵严格[[positive definite matrix|正定]]。
相关矩阵是对称的,因为[math]X_i[/math]与[math]X_j[/math]之间的相关性与[math]X_j[/math]与[math]X_i[/math]之间的相关性相同。
例如,在[[coefficient of multiple determination#Computation|多重决定系数]]的公式中,相关矩阵是[[multiple regression|多重回归]]中拟合优度的一种度量。
在[[statistical modelling|统计建模]]中,代表变量之间关系的相关矩阵被划分为不同的相关结构,这些结构根据估计所需的参数数量等因素进行区分。例如,在[[Exchangeability|可交换]]相关矩阵中,所有变量对被建模为具有相同的相关性,因此矩阵的所有非对角元素都彼此相等。另一方面,当变量代表时间序列时,经常使用[[Autoregressive model|自回归]]矩阵,因为当测量值时间上更接近时,相关性可能会更大。其他例子包括独立、非结构化、M依赖和托普利茨。
在[[exploratory data analysis|探索性数据分析]]中,[[iconography of correlations|相关性图标]]包括用一个图表替换相关矩阵,其中“显著”相关性由实线(正相关)或虚线(负相关)表示。
=== 最近有效相关矩阵 ===
在某些应用中(例如,仅从部分观察到的数据中构建数据模型),人们希望找到与“近似”相关矩阵(例如,由于计算方式,通常缺乏半正定正性的矩阵)“最接近”的相关矩阵。
2002年,Higham<ref>{{cite journal|title=Computing the nearest correlation matrix—a problem from finance|journal=IMA Journal of Numerical Analysis|date=2002|first=Nicholas J.|last=Higham|volume=22|issue=3|pages=329–343|doi=10.1093/imanum/22.3.329|citeseerx=10.1.1.661.2180}}</ref> 使用[[Frobenius norm|弗罗贝尼乌斯范数]]定义了接近度的概念,并提供了一种使用[[Dykstra's projection algorithm|迪克斯特拉投影算法]]计算最近相关矩阵的方法,该方法可以通过在线Web API实现。<ref>{{Cite web|url=https://portfoliooptimizer.io/|title=Portfolio Optimizer |website=portfoliooptimizer.io|access-date=2021-01-30}}</ref>
2002年,Higham<ref>{{cite journal|title=Computing the nearest correlation matrix—a problem from finance|journal=IMA Journal of Numerical Analysis|date=2002|first=Nicholas J.|last=Higham|volume=22|issue=3|pages=329–343|doi=10.1093/imanum/22.3.329|citeseerx=10.1.1.661.2180}}</ref> 使用[[Frobenius norm|弗罗贝尼乌斯范数]]定义了接近度的概念,并提供了一种使用[[Dykstra's projection algorithm|迪克斯特拉投影算法]]计算最近相关矩阵的方法,该方法可以通过在线Web API实现。<ref>{{Cite web|url=https://portfoliooptimizer.io/|title=Portfolio Optimizer |website=portfoliooptimizer.io|access-date=2021-01-30}}</ref>
这激发了人们对该主题的兴趣,随后几年中产生了新的理论(例如,计算具有因子结构的最近相关矩阵<ref>{{cite journal|title=Computing a Nearest Correlation Matrix with Factor Structure.|journal= SIAM J. Matrix Anal. Appl.|date=2010|first1=Rudiger|last1=Borsdorf|first2=Nicholas J.|last2=Higham|first3=Marcos|last3=Raydan|volume=31|issue=5|pages=2603–2622|doi=10.1137/090776718|url= http://eprints.maths.manchester.ac.uk/1523/1/SML002603.pdf}}</ref>)和数值(例如,使用[[Newton's method]]计算最近相关矩阵<ref>{{cite journal|title=A quadratically convergent Newton method for computing the nearest correlation matrix.|journal= SIAM J. Matrix Anal. Appl.|date=2006|first1=HOUDUO|last1=Qi|first2=DEFENG|last2=Sun|volume=28|issue=2|pages=360–385|doi=10.1137/050624509}}</ref>)方面的结果。
==随机过程的不相关性和独立性==
类似地,对于两个随机过程[math]\left\{ X_t \right\}_{t\in\mathcal{T}}[/math]和[math]\left\{ Y_t \right\}_{t\in\mathcal{T}}[/math]:如果它们是独立的,那么它们是不相关的。<ref name=KunIlPark>{{cite book | author=Park, Kun Il| title=Fundamentals of Probability and Stochastic Processes with Applications to Communications| publisher=Springer | year=2018 | isbn=978-3-319-68074-3}}</ref>{{rp|p. 151}} 这个陈述的相反可能不成立。即使两个变量不相关,它们也可能不是彼此独立的。
==常见误解==
===相关性和因果关系===
{{Main|Correlation does not imply causation}} {{See also|Normally distributed and uncorrelated does not imply independent}}
常规的格言“[[correlation does not imply causation]]”意味着不能单独使用相关性来推断变量之间的因果关系。<ref>{{cite journal | last=Aldrich | first=John | journal=Statistical Science | volume=10 | issue=4 | year=1995 | pages=364–376 | title=Correlations Genuine and Spurious in Pearson and Yule | jstor=2246135 | doi=10.1214/ss/1177009870| doi-access=free }}</ref> 这个格言不应被理解为相关性不能指示因果关系的潜在存在。然而,相关性背后的原因(如果有的话)可能是间接和未知的,高相关性也与[[identity (mathematics)|同一性]]关系([[tautology (logic)|重言式]])重叠,其中不存在因果过程。因此,两个变量之间的相关性不是建立因果关系(无论哪个方向)的充分条件。
儿童年龄和身高之间的相关性相对因果关系较为明确,但人们的情绪和健康之间的相关性则不那么明显。情绪改善是否导致健康改善,或者良好的健康是否导致情绪好转,或者两者都有?或者还有其他因素在两者之下?换句话说,相关性可以被视为可能因果关系的证据,但不能指明这种因果关系(如果有的话)可能是什么。
=== 简单线性相关性 ===
[[File:Anscombe's quartet 3.svg|thumb|325px|right|[[Anscombe's quartet]]:四组数据,它们的相关系数均为0.816]]
皮尔逊相关系数用于表示两个变量之间''线性''关系的强度,但其值通常无法完全刻画它们的关系。<ref>{{cite journal |first=Babak |last=Mahdavi Damghani |year=2012|title=测量相关性的误导性价值 |journal=[[Wilmott (magazine)|Wilmott Magazine]] |volume=2012 |issue=1 |pages=64–73 |doi=10.1002/wilm.10167|s2cid=154550363 }}</ref> 特别是,如果给定[math]X[/math]的[math]Y[/math]的[[条件期望|条件均值]],记作[math]\operatorname{E}(Y \mid X)[/math],不是[math]X[/math]的线性函数,那么相关系数将无法完全确定[math]\operatorname{E}(Y \mid X)[/math]的形式。
相邻图片展示了[[Anscombe's quartet]]的[[散点图]],这是由[[Francis Anscombe]]创建的四对不同变量组成的集合。<ref>{{cite journal | last=Anscombe | first=Francis J. | year=1973 | title=统计分析中的图形 | journal=The American Statistician | volume=27 | issue=1 | pages=17–21 | jstor=2682899 | doi=10.2307/2682899}}</ref> 这四个[math]y[/math]变量具有相同的平均值(7.5)、方差(4.12)、相关系数(0.816)和回归线([math display="inline"]y=3+0.5x[/math])。然而,如图所示,这些变量的分布非常不同。第一个(左上角)似乎呈正态分布,并符合人们对两个相关变量在正态性假设下的预期。第二个(右上角)不是正态分布;虽然两个变量之间的明显关系可以观察到,但它不是线性的。在这种情况下,皮尔逊相关系数并未表明存在精确的函数关系:只是表明该关系在多大程度上可以被线性关系近似。在第三种情况(左下角)中,线性关系是完美的,除了一个[[离群值]],它的影响足以将相关系数从1降低到0.816。最后,第四个例子(右下角)展示了当一个离群值足以产生高相关系数的另一个例子,尽管两个变量之间的关系不是线性的。
这些例子表明,相关系数作为[[总结统计量]],不能替代对数据的视觉检查。有时认为这些例子表明皮尔逊相关假设数据遵循[[正态分布]],但这只是部分正确。<ref name="thirteenways"/> 皮尔逊相关可以准确地计算任何具有有限[[协方差矩阵]]的分布,这包括实际遇到的大多数分布。然而,皮尔逊相关系数(连同样本均值和方差)只是[[充分统计量]],如果数据来自[[多元正态分布]]。因此,只有当数据来自多元正态分布时,皮尔逊相关系数才能完全刻画变量之间的关系。
==双变量正态分布==
如果一对随机变量[math](X,Y)[/math]遵循[[双变量正态分布]],则给定[math]Y[/math]的条件下[math]X[/math]的条件均值[math]\operatorname{\boldsymbol\mathcal E}(X \mid Y)[/math]是[math]Y[/math]的线性函数,而给定[math]X[/math]的条件下[math]Y[/math]的条件均值[math]\operatorname{\boldsymbol\mathcal E}(Y \mid X)[/math]是[math]X[/math]的线性函数。[math]X[/math]和[math]Y[/math]之间的相关系数[math]\rho_{X,Y}[/math],以及[math]X[/math]和[math]Y[/math]的[[边缘分布|边缘]]均值和方差确定了这种线性关系:
:<math>\operatorname{\boldsymbol\mathcal E}(Y \mid X ) = \operatorname{\boldsymbol\mathcal E}(Y) + \rho_{X,Y} \cdot \sigma_Y \cdot \frac{X-\operatorname{\boldsymbol\mathcal E}(X)}{\sigma_X},</math>
其中[math]\operatorname{\boldsymbol\mathcal E}(X)[/math]和[math]\operatorname{\boldsymbol\mathcal E}(Y)[/math]分别是[math]X[/math]和[math]Y[/math]的期望值,[math]\sigma_X[/math]和[math]\sigma_Y[/math]分别是[math]X[/math]和[math]Y[/math]的标准差。
经验相关系数[math]r[/math]是相关系数[math]\rho[/math]的[[估计|估计值]]。对[math]\rho[/math]的分布估计由以下公式给出:
: <math display="block">\pi ( \rho \mid r ) =
\frac{\Gamma(N)}{\sqrt{ 2\pi } \cdot
\Gamma( N - \tfrac{1}{2})} \cdot
\bigl( 1 - r^2 \bigr)^{\frac{N - 2}{2}} \cdot
\bigl( 1 - \rho^2 \bigr)^{\frac{N - 3}{2}} \cdot
\bigl( 1 - r \rho \bigr)^{- N + \frac{3}{2}} \cdot F_\mathsf{Hyp} \left(\tfrac{3}{2}, -\tfrac{1}{2}; N - \tfrac{1}{2}; \frac{1 + r \rho}{2} \right)</math>
其中[math]F_\mathsf{Hyp}[/math]是[[高斯超几何函数]]。
这个密度既是贝叶斯[[后验概率|后验]]密度,也是精确的最佳[[置信度分布]]密度。<ref>{{cite journal |last=Taraldsen |first=Gunnar |date=2021 |title=关于相关性的置信密度 |journal=Sankhya A |volume=85 |pages=600–616 |lang=en |s2cid=244594067 |issn=0976-8378 |doi=10.1007/s13171-021-00267-y |doi-access=free}}</ref><ref>{{cite report |last=Taraldsen |first=Gunnar |date=2020 |title=关于相关性的信心 |lang=en |type=preprint |doi=10.13140/RG.2.2.23673.49769 |website=researchgate.net |url=http://rgdoi.net/10.13140/RG.2.2.23673.49769}}</ref>
==另请参阅==
{{Portal|Mathematics}}
{{Further|Correlation (disambiguation)}}
{{cols|colwidth=26em}}
* [[自相关]]
* [[典型相关]]
* [[决定系数]]
* [[协整]]
* [[一致性相关系数]]
* [[共分型相关]]
* [[消除衰减的相关]]
* [[相关函数]]
* [[相关差距]]
* [[协方差]]
* [[协方差和相关]]
* [[互相关]]
* [[生态相关]]
* [[未解释的方差比例]]
* [[遗传相关]]
* [[古德曼和克鲁斯卡尔的lambda]]
* [[相关图像学]]
* [[虚假相关]]
* [[类间相关]]
* [[类内相关]]
* [[数据挖掘中的提升]]
* [[平均依赖性]]
* [[可修改区域单元问题]]
* [[多重相关]]
* [[点二项相关系数]]
* [[象限计数比]]
* [[伪相关]]
* [[统计相关比率]]
* [[次独立性]]
  {{colend}}
==引用==
{{Reflist}}
==延伸阅读==
* {{cite book |author=Cohen, J. |author2=Cohen P. |author3=West, S.G. |author4=Aiken, L.S.|author4-link= Leona S. Aiken |name-list-style=amp |year=2002 |title=Applied multiple regression/correlation analysis for the behavioral sciences |edition=3rd |publisher=Psychology Press |isbn= 978-0-8058-2223-6 }}
* {{springer|title=Correlation (in statistics)|id=p/c026560}}
* {{cite book|last1=Oestreicher|first1=J. & D. R.|title=Plague of Equals: A science thriller of international disease, politics and drug discovery|date=February 26, 2015|publisher=Omega Cat Press|location=California|isbn=978-0963175540|pages=408}}

2024年1月21日 (日) 12:44的版本

2002年,Higham[1] 使用弗罗贝尼乌斯范数定义了接近度的概念,并提供了一种使用迪克斯特拉投影算法计算最近相关矩阵的方法,该方法可以通过在线Web API实现。[2]

  1. Higham, Nicholas J. (2002). "Computing the nearest correlation matrix—a problem from finance". IMA Journal of Numerical Analysis. 22 (3): 329–343. CiteSeerX 10.1.1.661.2180. doi:10.1093/imanum/22.3.329.
  2. "Portfolio Optimizer". portfoliooptimizer.io. Retrieved 2021-01-30.