Section05_相关系数

基本概念

定义

ρXY=Cov(X−EXEX,Y−EYEY)=Cov(X,Y)EX⋅EY⇒Cov(X,Y)=ρXY⋅DXDY \begin{split} & \rho_{XY} = \mathrm{Cov}\bigg(\frac{X-EX}{\sqrt{EX}}, \frac{Y-EY}{\sqrt{EY}}\bigg) \\ = & \frac{\mathrm{Cov}(X,Y)}{\sqrt{EX}\cdot \sqrt{EY}} \\ \Rightarrow & \mathrm{Cov}(X,Y) = \rho_{XY}\cdot \sqrt{DX} \sqrt{DY} \end{split}

  • 反映 X,YX,Y 线性关系的紧密程度

性质

  1. ∣ρXY∣≤1\vert \rho_{XY} \vert\le 1
  2. ρXY=0\rho_{XY} = 0 称 XX 与 YY 不相关(无线性关系)
    • ⇔Cov(X,Y)=0\Leftrightarrow \mathrm{Cov}(X,Y) = 0
    • ⇔D(X±Y)=DX+DY\Leftrightarrow D(X\pm Y) = DX + DY
    • ⇔EXY=EX⋅EY\Leftrightarrow EXY = EX \cdot EY
  3. ∣ρXY∣=1⇔P{Y=aX+b}=1,a≠0\vert \rho_{XY} \vert = 1 \Leftrightarrow \mathbb{P}\{Y = aX + b\} = 1, a\ne 0
    • a<0⇒ρXY=−1a < 0 \Rightarrow \rho_{XY} = -1
    • a>0⇒ρXY=1a > 0 \Rightarrow \rho_{XY} = 1
  4. X,YX,Y 独立(无任何关系) →↚\substack{\rightarrow\\\nleftarrow} X,YX,Y 不相关(无线性关系)
  5. (X,Y)∼N(μ1,μ2;σ12,σ22;ρ)(X,Y) \sim \mathcal{N}(\mu_{1},\mu_{2};\sigma^{2}_{1},\sigma^{2}_{2};\rho)
    • ρ=0⇔X,Y不相关⇔X,Y独立\rho = 0 \Leftrightarrow X,Y\text{不相关}\Leftrightarrow X,Y \text{独立} (仅对二维正态分布成立)

例题

  1. 设二维离散型随机变量的概率分布为 (X,Y)(0,0)(1,1)(0,2)(2,0)(2,2)P141314112112 \begin{array}{c|ccccc} (X,Y) & (0,0) & (1,1) & (0,2) & (2,0) & (2,2) \\ \hline P & \frac{1}{4} & \frac{1}{3} & \frac{1}{4} & \frac{1}{12} & \frac{1}{12} \end{array}
    1. 判断 XX 和 YY 是否不相关
    2. 判断 XX 和 YY 是否独立
    3. 求 Cov(X−Y,Y)\mathrm{Cov}(X-Y,Y) ∵Cov(X,Y)=EXY−EX⋅EY∴Cov(X,Y)=13+4×112−(13+2×112+2×112)(13+2×14+2×112)=23−23=0∴X,Y不相关∵Y=0Y=1Y=2X=01/401/41/2X=101/301/3X=21/1201/121/61/31/31/3∴pij≠pi⋅p⋅j∴X,Y不独立Cov(X−Y,Y)=Cov(X,Y)−Cov(Y,Y)=0−DY=[EY]2−EY2=1−53=−23 \begin{array}{ll} \because & \mathrm{Cov}(X,Y) = EXY - EX\cdot EY\\ \therefore & \mathrm{Cov}(X,Y) = \frac{1}{3}+4\times \frac{1}{12} - (\frac{1}{3} + 2\times \frac{1}{12} + 2\times \frac{1}{12})(\frac{1}{3} + 2\times \frac{1}{4}+ 2\times \frac{1}{12}) \\ & = \frac{2}{3} - \frac{2}{3} = 0 \\ \therefore & X,Y \text{不相关} \\\\ \because & \begin{array}{c |ccc|c} & Y=0 & Y=1 & Y=2 \\ \hline X = 0 & 1/4 & 0 & 1/4 & 1/2 \\ X = 1 & 0 & 1/3 & 0 & 1/3 \\ X = 2 & 1/12 & 0 & 1/12 & 1/6 \\ \hline & 1/3 & 1/3 & 1/3 \end{array} \\ \therefore & p_{ij} \ne p_{i\cdot}p_{\cdot j} \\ \therefore & X,Y \text{不独立} \\ \\ & \mathrm{Cov}(X-Y,Y) = \mathrm{Cov}(X,Y) - \mathrm{Cov}(Y,Y) \\ & = 0 -DY = [EY]^{2} - EY^{2} = 1 - \frac{5}{3} = - \frac{2}{3} \end{array}
  2. 将一枚硬币独立重复抛 nn 次,以 XX 和 YY 分别表示正面向上和反面向上的次数,则 XX 与 YY 的相关系数是 (A) A. −1-1 B. 00 C. 12\frac{1}{2} D. 11
  3. 设 X∼U(0,3)X\sim U(0,3),YY 服从参数为 22 的泊松分布,且 XX 与 YY 的协方差为 −1-1,则 D(2X−Y+1)=D(2X-Y+1)=         D(2X−Y+1)=4DX+DY−2Cov(2X,Y)=4×3212+2−4×(−1)=9 \begin{array}{ll} & D(2X-Y +1) = 4 DX + DY - 2\mathrm{Cov}(2X,Y) \\ & = 4\times \frac{3^{2}}{12} + 2 - 4\times (-1) \\ & = 9 \end{array}
  4. 设 X∼N(0,4),Y∼B(3,13)X\sim \mathcal{N}(0,4), Y\sim B(3, \frac{1}{3}),且 XX 与 YY 不相关,则 D(X−3Y+1)=D(X-3Y+1) =         ∵X,Y不相关∴Cov(X,Y)=0D(X−3Y+1)=DX+9DY−2Cov(X,−3Y)=DX+9DY+6Cov(X,Y)=4+9×3×13×23=10 \begin{array}{ll} \because & X,Y \text{不相关} \\ \therefore & \mathrm{Cov}(X,Y) = 0 \\ & D(X-3Y+1) = DX + 9DY - 2\mathrm{Cov}(X,-3Y) \\ & = DX + 9DY +6\mathrm{Cov}(X,Y) \\ & = 4 + 9\times 3\times \frac{1}{3}\times \frac{2}{3} = 10 \end{array}
  5. 设 X∼N(0,1)X\sim \mathcal{N}(0,1) 在 X=xX = x 的条件下 Y∼N(x,1)Y\sim \mathcal{N}(x,1),则 XX 与 YY 的相关系数为         ∵在X=x条件下Y∼N(x,1)∴fY∣X(y∣x)=12πe−(y−x)22∴f(x,y)=fX(x)fY∣X(y∣x)=12π2πe−2x2−2xy+y22∵当(X,Y)∼N(μ1,μ2;σ12,σ22;ρ)时f(x,y)=12πσ12πσ21−ρ2×exp⁡{−11−ρ2[(x−μ1)22σ12−ρ(x−μ1)(y−μ2)σ1σ2+(y−μ2)22σ22]}∵X∼0,1∴μ1=0,σ1=1∵−(x−μ1)22σ12(1−ρ2)=−x2∴x22(1−ρ2)=x21−ρ2=12∴ρ=22 \begin{array}{ll} \because & \text{在}X = x \text{条件下} Y \sim \mathcal{N}(x,1) \\ \therefore & \displaystyle f_{Y\vert X}(y\vert x) = \frac{1}{\sqrt{2\pi}}e^{-\frac{(y-x)^{2}}{2}} \\ \therefore & \displaystyle f(x,y) = f_{X}(x)f_{Y\vert X}(y\vert x) = \frac{1}{\sqrt{2\pi}\sqrt{2\pi}} e^{-\frac{2x^{2} - 2xy + y^{2}}{2}} \\ \because & \text{当}(X,Y)\sim \mathcal{N}(\mu_{1},\mu_{2};\sigma^{2}_{1},\sigma^{2}_{2}; \rho) \text{时} \\ & \displaystyle f(x,y) = \frac{1}{\sqrt{2\pi}\sigma_{1}\sqrt{2\pi}\sigma_{2}\sqrt{1-\rho^{2}}} \times \\ & \displaystyle \exp\bigg\{-\frac{1}{1-\rho^{2}}\bigg[\frac{(x-\mu_{1})^{2}}{2\sigma_{1}^{2}} - \rho\frac{(x-\mu_{1})(y-\mu_{2})}{\sigma_{1}\sigma_{2}} + \frac{(y-\mu_{2})^{2}}{2\sigma_{2}^{2}}\bigg]\bigg\} \\ \because & X\sim \mathcal{0,1} \\ \therefore & \mu_{1} = 0,\sigma_{1} = 1 \\ \because & \displaystyle -\frac{(x-\mu_{1})^{2}}{2\sigma_{1}^{2}(1-\rho^{2})} = -x^{2}\\ \therefore & \displaystyle \frac{x^{2}}{2(1-\rho^{2})} = x^{2} \\ & \displaystyle 1-\rho^{2} = \frac{1}{2} \\ \therefore & \rho = \frac{\sqrt{2}}{2} \\ \end{array}

results matching ""

    No results matching ""