【概率论】3.3数学期望、方差与协方差

数学期望、方差与协方差

  • 1.数学期望
    • 1.定义
    • 2.性质
  • 2.方差
    • 1.定义
    • 2.计算公式
    • 3.性质
  • 3.常见分布的期望和方差
  • 4.协方差
    • 1.相关系数
    • 2.协方差矩阵
  • 5.重要公式与结论

1.数学期望

1.定义

离散型: P { X = x i } = p i , E ( X ) = ∑ i x i p i P\left\{ X = x_{i} \right\} = p_{i},E(X) = \sum_{i}^{}{x_{i}p_{i}} P{X=xi}=pi,E(X)=ixipi

连续型: X ∼ f ( x ) , E ( X ) = ∫ − ∞ + ∞ x f ( x ) d x X\sim f(x),E(X) = \int_{- \infty}^{+ \infty}{xf(x)dx} Xf(x),E(X)=+xf(x)dx

2.性质

(1) E ( C ) = C , E [ E ( X ) ] = E ( X ) E(C) = C,E\lbrack E(X)\rbrack = E(X) E(C)=C,E[E(X)]=E(X)

(2) E ( C 1 X + C 2 Y ) = C 1 E ( X ) + C 2 E ( Y ) E(C_{1}X + C_{2}Y) = C_{1}E(X) + C_{2}E(Y) E(C1X+C2Y)=C1E(X)+C2E(Y)

(3) 若 X X X Y Y Y独立,则 E ( X Y ) = E ( X ) E ( Y ) E(XY) = E(X)E(Y) E(XY)=E(X)E(Y)

(4) [ E ( X Y ) ] 2 ≤ E ( X 2 ) E ( Y 2 ) \left\lbrack E(XY) \right\rbrack^{2} \leq E(X^{2})E(Y^{2}) [E(XY)]2E(X2)E(Y2)

2.方差

1.定义

离散型: D ( X ) = ∑ i [ x i − E ( X ) ] 2 p i D(X) = \sum_{i}^{}{\left\lbrack x_{i} - E(X) \right\rbrack^{2}p_{i}} D(X)=i[xiE(X)]2pi

连续型: D ( X ) = ∫ − ∞ + ∞ [ x − E ( X ) ] 2 f ( x ) d x D(X) = {\int_{- \infty}^{+ \infty}\left\lbrack x - E(X) \right\rbrack}^{2}f(x)dx D(X)=+[xE(X)]2f(x)dx

上面这两个公式一般不用,计算都是使用下面这个公式.

2.计算公式

D ( X ) = E [ X − E ( X ) ] 2 = E ( X 2 ) − [ E ( X ) ] 2 D(X) = E\left\lbrack X - E(X) \right\rbrack^{2} = E(X^{2}) - \left\lbrack E(X) \right\rbrack^{2} D(X)=E[XE(X)]2=E(X2)[E(X)]2

标准差 D ( X ) \sqrt{D(X)} D(X)

3.性质

(1)   D ( C ) = 0 , D [ E ( X ) ] = 0 , D [ D ( X ) ] = 0 \ D(C) = 0,D\lbrack E(X)\rbrack = 0,D\lbrack D(X)\rbrack = 0  D(C)=0,D[E(X)]=0,D[D(X)]=0

(2) X X X Y Y Y相互独立,则 D ( X ± Y ) = D ( X ) + D ( Y ) D(X \pm Y) = D(X) + D(Y) D(X±Y)=D(X)+D(Y)

(3)   D ( C 1 X + C 2 ) = C 1 2 D ( X ) \ D\left( C_{1}X + C_{2} \right) = C_{1}^{2}D\left( X \right)  D(C1X+C2)=C12D(X)

(4) 一般有 D ( X ± Y ) = D ( X ) + D ( Y ) ± 2 C o v ( X , Y ) = D ( X ) + D ( Y ) ± 2 ρ D ( X ) D ( Y ) D(X \pm Y) = D(X) + D(Y) \pm 2Cov(X,Y) = D(X) + D(Y) \pm 2\rho\sqrt{D(X)}\sqrt{D(Y)} D(X±Y)=D(X)+D(Y)±2Cov(X,Y)=D(X)+D(Y)±2ρD(X) D(Y)

(5)   D ( X ) < E ( X − C ) 2 , C ≠ E ( X ) \ D\left( X \right) < E\left( X - C \right)^{2},C \neq E\left( X \right)  D(X)<E(XC)2,C=E(X)

(6)   D ( X ) = 0 ⇔ P { X = C } = 1 \ D(X) = 0 \Leftrightarrow P\left\{ X = C \right\} = 1  D(X)=0P{X=C}=1

3.常见分布的期望和方差

分布 期望 方差
0-1分布 p p p p ( 1 − p ) p(1-p) p(1p)
二项分布 n p np np n p ( 1 − p ) np(1-p) np(1p)
泊松分布 λ \lambda λ λ \lambda λ
均匀分布 a + b 2 \frac{a+b}2 2a+b ( b − a ) 2 12 \frac{\left(b-a\right)^2}{12} 12(ba)2
指数分布 1 λ \frac1\lambda λ1 1 λ 2 \frac1{\lambda^2} λ21
正态分布 μ \mu μ σ 2 \sigma^2 σ2
几何分布 1 p \frac1p p1 1 − p p 2 \frac{1-p}{p^2} p21p
瑞利分布 π 2 σ \sqrt{\frac\pi2}\sigma 2π σ σ 2 \sigma^2 σ2

4.协方差

C o v ( X , Y ) = E [ ( X − E ( X ) ( Y − E ( Y ) ) ] Cov(X,Y) = E\left\lbrack (X - E(X)(Y - E(Y)) \right\rbrack Cov(X,Y)=E[(XE(X)(YE(Y))]

1.相关系数

ρ X Y = C o v ( X , Y ) D ( X ) D ( Y ) \rho_{{XY}} = \frac{Cov(X,Y)}{\sqrt{D(X)}\sqrt{D(Y)}} ρXY=D(X) D(Y) Cov(X,Y), k k k阶原点矩 E ( X k ) E(X^{k}) E(Xk);
k k k阶中心矩 E { [ X − E ( X ) ] k } E\left\{ {\lbrack X - E(X)\rbrack}^{k} \right\} E{[XE(X)]k}

性质:

(1)   C o v ( X , Y ) = C o v ( Y , X ) \ Cov(X,Y) = Cov(Y,X)  Cov(X,Y)=Cov(Y,X)

(2)   C o v ( a X , b Y ) = a b C o v ( Y , X ) \ Cov(aX,bY) = abCov(Y,X)  Cov(aX,bY)=abCov(Y,X)

(3)   C o v ( X 1 + X 2 , Y ) = C o v ( X 1 , Y ) + C o v ( X 2 , Y ) \ Cov(X_{1} + X_{2},Y) = Cov(X_{1},Y) + Cov(X_{2},Y)  Cov(X1+X2,Y)=Cov(X1,Y)+Cov(X2,Y)

(4)   ∣ ρ ( X , Y ) ∣ ≤ 1 \ \left| \rho\left( X,Y \right) \right| \leq 1  ρ(X,Y)1

(5)   ρ ( X , Y ) = 1 ⇔ P ( Y = a X + b ) = 1 \ \rho\left( X,Y \right) = 1 \Leftrightarrow P\left( Y = aX + b \right) = 1  ρ(X,Y)=1P(Y=aX+b)=1 ,其中 a > 0 a > 0 a>0

ρ ( X , Y ) = − 1 ⇔ P ( Y = a X + b ) = 1 \rho\left( X,Y \right) = - 1 \Leftrightarrow P\left( Y = aX + b \right) = 1 ρ(X,Y)=1P(Y=aX+b)=1
,其中 a < 0 a < 0 a<0

2.协方差矩阵

  二维随机变量 ( X 1 , X 2 ) (X_1,X_2) (X1,X2)有四个二阶中心矩(假设他们都存在),分别记为
C 11 = E { [ X 1 − E ( X 1 ) ] 2 } C 12 = E { [ X 1 − E ( X 1 ) ] [ X 2 − E ( X 2 ) ] } C 21 = E { [ X 2 − E ( X 2 ) ] [ X 1 − E ( X 1 ) ] } C 22 = E { [ X 2 − E ( X 2 ) ] 2 } C_{11}=E\left\{\left[X_1-E\left(X_1\right)\right]^2\right\}\\C_{12}=E\left\{\left[X_1-E\left(X_1\right)\right]\left[X_2-E\left(X_2\right)\right]\right\}\\C_{21}=E\left\{\left[X_2-E\left(X_2\right)\right]\left[X_1-E\left(X_1\right)\right]\right\}\\C_{22}=E\left\{\left[X2-E\left(X_2\right)\right]^2\right\} C11=E{[X1E(X1)]2}C12=E{[X1E(X1)][X2E(X2)]}C21=E{[X2E(X2)][X1E(X1)]}C22=E{[X2E(X2)]2}将他们排成矩阵的形式
( C 11 C 12 C 21 C 22 ) \begin{pmatrix}C_{11}&C_{12}\\C_{21}&C_{22}\end{pmatrix} (C11C21C12C22)这个矩阵称为随机变量 ( X 1 , X 2 ) (X_1,X_2) (X1,X2)协方差矩阵.
  设 n n n维随机变量 ( X 1 , X 2 , ⋯   , X n ) \left(X_1,X_2,\cdots,X_n\right) (X1,X2,,Xn)的二阶混合中心距
   C i j = C o v ( X i , X j ) = E { [ X i − E ( X i ) ] [ X j − E ( X j ) ] } , i , j = 1 , 2 , ⋯   , n C_{ij}=Cov\left(X_i,X_j\right)=E\left\{\left[X_i-E\left(X_i\right)\right]\left[X_j-E\left(X_j\right)\right]\right\},i,j=1,2,\cdots,n Cij=Cov(Xi,Xj)=E{[XiE(Xi)][XjE(Xj)]},i,j=1,2,,n都存在,则称矩阵
C = ( C 11 C 12 ⋯ C 1 n C 21 C 22 ⋯ C 2 n ⋮ ⋮ ⋮ C n 1 C n 2 ⋯ C n n ) C=\begin{pmatrix}C_{11}&C_{12}&\cdots&C_{1n}\\C_{21}&C_{22}&\cdots&C_{2n}\\\vdots&\vdots&&\vdots\\C_{n1}&C_{n2}&\cdots&C_{nn}\end{pmatrix} C=C11C21Cn1C12C22Cn2C1nC2nCnn n n n维随机变量 ( X 1 , X 2 , ⋯   , X n ) \left(X_1,X_2,\cdots,X_n\right) (X1,X2,,Xn)的协方差矩阵.由于 C i j = C j i ( i ≠ j ; i , j = 1 , 2 , ⋯   , n ) C_{ij}=C_{ji}\left(i\neq j;i,j=1,2,\cdots,n\right) Cij=Cji(i=j;i,j=1,2,,n),因此上述矩阵是一个对称矩阵.

5.重要公式与结论

(1)   D ( X ) = E ( X 2 ) − E 2 ( X ) \ D(X) = E(X^{2}) - E^{2}(X)  D(X)=E(X2)E2(X)

(2)   C o v ( X , Y ) = E ( X Y ) − E ( X ) E ( Y ) \ Cov(X,Y) = E(XY) - E(X)E(Y)  Cov(X,Y)=E(XY)E(X)E(Y)

(3) ∣ ρ ( X , Y ) ∣ ≤ 1 , \left| \rho\left( X,Y \right) \right| \leq 1, ρ(X,Y)1, ρ ( X , Y ) = 1 ⇔ P ( Y = a X + b ) = 1 \rho\left( X,Y \right) = 1 \Leftrightarrow P\left( Y = aX + b \right) = 1 ρ(X,Y)=1P(Y=aX+b)=1,其中 a > 0 a > 0 a>0

ρ ( X , Y ) = − 1 ⇔ P ( Y = a X + b ) = 1 \rho\left( X,Y \right) = - 1 \Leftrightarrow P\left( Y = aX + b \right) = 1 ρ(X,Y)=1P(Y=aX+b)=1,其中 a < 0 a < 0 a<0

(4) 下面 5 个条件互为充要条件:

ρ ( X , Y ) = 0 \rho(X,Y) = 0 ρ(X,Y)=0 ⇔ C o v ( X , Y ) = 0 \Leftrightarrow Cov(X,Y) = 0 Cov(X,Y)=0 ⇔ E ( X , Y ) = E ( X ) E ( Y ) \Leftrightarrow E(X,Y) = E(X)E(Y) E(X,Y)=E(X)E(Y) ⇔ D ( X + Y ) = D ( X ) + D ( Y ) \Leftrightarrow D(X + Y) = D(X) + D(Y) D(X+Y)=D(X)+D(Y) ⇔ D ( X − Y ) = D ( X ) + D ( Y ) \Leftrightarrow D(X - Y) = D(X) + D(Y) D(XY)=D(X)+D(Y)

注: X X X Y Y Y独立为上述 5 个条件中任何一个成立的充分条件,但非必要条件。

你可能感兴趣的:(AI数学基础)