本文主要是介绍协方差和协相关(Covariance and Correlation),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
本文主要是记录与这两个概念相关的概念。看中文或者英文时,尝尝容易弄混。
内容
- 1 covariance和correleation
- 2 covariance matrix和correlation matrix
- 3 cross-covariance和cross-correlation
- 4 autocovariance和autocorrelation
对于两个随机信号X, Y
1 covariance和correleation
covariance:
c o v X Y = σ X Y = E [ ( X − μ X ) ( Y − μ Y ) ] cov_{XY}=\sigma _{XY}=E\left[ \left( X-\mu _X \right) \left( Y-\mu _Y \right) \right] covXY=σXY=E[(X−μX)(Y−μY)]
correlation:
c o r r X Y = ρ X Y = E [ ( X − μ X ) ( Y − μ Y ) ] / ( σ X σ Y ) corr_{XY}=\rho _{XY}=E\left[ \left( X-\mu _X \right) \left( Y-\mu _Y \right) \right] /\left( \sigma _X\sigma _Y \right) corrXY=ρXY=E[(X−μX)(Y−μY)]/(σXσY)
因此
ρ X Y = σ X Y / ( σ X σ Y ) \rho _{XY}=\sigma _{XY}/\left( \sigma _X\sigma _Y \right) ρXY=σXY/(σXσY)
如果Y=X,那么 σ X Y = σ X X = ( σ X ) 2 \sigma _{XY}=\sigma _{XX}=(\sigma_{X})^2 σXY=σXX=(σX)2, ρ X Y = 1 \rho_{XY}=1 ρXY=1
2 covariance matrix和correlation matrix
这个是对于多维随机变量来说的,也就是 X = [ X 1 , X 2 , . . . , X m ] X=[X_1,X_2,...,X_m] X=[X1,X2,...,Xm], Y = [ Y 1 , Y 2 , . . . , Y n ] Y=[Y_1,Y_2,...,Y_n] Y=[Y1,Y2,...,Yn],那么
c o v X Y = [ c o v X i Y j ] ( m , n ) c o r r X Y = [ c o r r X i Y j ] ( m , n ) cov_{XY}=\left[ cov_{X_iY_j} \right] _{\left( m,n \right)} \\ corr_{XY}=\left[ corr_{X_iY_j} \right] _{\left( m,n \right)} covXY=[covXiYj](m,n)corrXY=[corrXiYj](m,n)
3 cross-covariance和cross-correlation
这是对于平稳随机信号来说的,也就是信号的平均值和方差随时间是不变的
E ( X n ) = E ( x n + m ) E(X_n)=E(x_{n+m}) E(Xn)=E(xn+m), V a r ( X n ) = V a r ( X n + m ) Var(X_n)=Var(X_{n+m}) Var(Xn)=Var(Xn+m)
cross-covariance
σ X Y ( m ) = E [ ( X n − μ X ) ( Y n + m − μ Y ) ] \sigma _{XY}(m)=E\left[ \left( X_n-\mu _X \right) \left( Y_{n+m}-\mu _Y \right) \right] σXY(m)=E[(Xn−μX)(Yn+m−μY)]
cross-correlation
ρ X Y ( m ) = E [ ( X n − μ X ) ( Y n + m − μ Y ) ] / ( σ X σ Y ) \rho _{XY}(m)=E\left[ \left( X_n-\mu _X \right) \left( Y_{n+m}-\mu _Y \right) \right] /\left( \sigma _X\sigma _Y \right) ρXY(m)=E[(Xn−μX)(Yn+m−μY)]/(σXσY)
cross-covariance, cross-correlation与n的位置无关,只与时刻之间的间隔m有关
4 autocovariance和autocorrelation
autocovariance
σ X X ( m ) = E [ ( X n − μ X ) ( X n + m − μ X ) ] \sigma _{XX}\left( m \right) =E\left[ \left( X_n-\mu _X \right) \left( X_{n+m}-\mu _X \right) \right] σXX(m)=E[(Xn−μX)(Xn+m−μX)]
autocorrelation
ρ X X ( m ) = E [ ( X n − μ X ) ( X n + m − μ X ) ] / ( σ X 2 ) \rho _{XX}\left( m \right) =E\left[ \left( X_n-\mu _X \right) \left( X_{n+m}-\mu _X \right) \right] /\left( \sigma _{X}^{2} \right) ρXX(m)=E[(Xn−μX)(Xn+m−μX)]/(σX2)
这篇关于协方差和协相关(Covariance and Correlation)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!