【LinearAlgebra】12.2 Covariance Matrices and Joint Probabilites

在这里插入图片描述

Chapter 12 - Linear Algebra in Probability & Statistics

12.2 Covariance Matrices and Joint Probabilites

当我们同时进行 M M M 个不同实验时,线性代数就出现了。我们可以测量年龄、身高和体重( M = 3 M=3 M=3 测量 N N N 个人)。每个实验都有自己的均值。因此我们有一个向量 m = ( m 1 , m 2 , m 3 ) m=(m_1, m_2, m_3) m=(m1,m2,m3) 包含 M M M 个均值。它们可以是年龄、身高和体重的样本均值。或者 m 1 , m 2 , m 3 m_1, m_2, m_3 m1,m2,m3 可以是年龄、身高、体重基于已知概率的期望值。

当我们考虑方差时就涉及到了矩阵。每个实验都将有一个样本方差 S i 2 S^2_i Si2 或者期望的 σ i 2 = E [ ( x i − m i ) 2 ] \sigma^2_i = \text{E} [(x_i - m_i)^2] σi2=E[(ximi)2],基于其与均值的平方距离。这 M M M 个数 σ 1 2 , ⋯   , σ M 2 \sigma_1^2, \cdots, \sigma_M^2 σ12,,σM2 会在矩阵的主对角线上。到目前为止,我们还没有把这 M M M 个平行实验联系起来。他们测量 M M M 个不同的随机变量,但实验不一定是独立的!

如果我们测量儿童的年龄、身高和体重( a , h , w a, h, w a,h,w),结果将是密切相关的。大一点的孩子通常更高更重。假设均值 m a , m h , m w m_a, m_h, m_w ma,mh,mw 是已知的。那么 σ a 2 , σ h 2 , σ w 2 \sigma_a^2, \sigma_h^2, \sigma_w^2 σa2,σh2,σw2 分别是年龄、身高、体重的方差。新的数字是像 σ a h \sigma_{ah} σah 的协方差,它是年龄乘以身高。

协方差 σ a h = E[(age - mean age)(height - mean height)] (1) \sigma_{ah} = \text{E[(age - mean age)(height - mean height)]} \tag{1} σah=E[(age - mean age)(height - mean height)](1)

这个定义需要仔细看一下。要计算 σ a h \sigma_{ah} σah,仅知道每个年龄的概率和每个身高的概率是不够的。我们必须知道每一对(年龄和身高)的联合概率。这是因为年龄是和身高有关的。

p a h = probability that a random child has age =  a  and height = h : both at once  p i j = probability that experiment 1 produces  x i  and experiment 2 produces  y j \begin{aligned} p_{ah} &= \text{probability that a random child has age = } a \text{ and height} = h: \text{both at once } \\ p_{ij} &= \text{probability that experiment 1 produces } x_i \text{ and experiment 2 produces } y_j \end{aligned} pahpij=probability that a random child has age = a and height=h:both at once =probability that experiment 1 produces xi and experiment 2 produces yj

假设实验 1 1 1(年龄)有均值 m 1 m_1 m1。假设实验 2 2 2(身高)有均值 m 2 m_2 m2。实验 1 1 1 2 2 2 之间的协方差公式(1)考虑了年龄 x i x_i xi,身高 y j y_j yj

协方差 σ 12 = ∑ all  ∑ i , j p i j ( x i − m 1 ) ( y j − m 2 ) (2) \sigma_{12} = \sum_{\text{all }} \sum_{i,j} p_{ij} (x_i - m_1) (y_j - m_2) \tag{2} σ12=all i,jpij(xim1)(yjm2)(2)


为了理解 “联合概率 p i j p_{ij} pij” 的概念,我们从两个小例子开始。

例子1 分别抛两个硬币。用 1 1 1 表示正面 0 0 0 表示反面,结果可能是 ( 1 , 1 ) 、 ( 1 , 0 ) 、 ( 0 , 1 ) 、 ( 0 , 0 ) (1,1)、(1,0)、(0,1)、(0,0) (1,1)(1,0)(0,1)(0,0)。这四个结果都有概率 p 11 = p 10 = p 01 = p 00 = 1 4 p_{11}=p_{10}=p_{01}=p_{00}=\frac{1}{4} p11=p10=p01=p00=41。独立实验的概率有 Prob of  ( i , j ) = (Prob of  i ) (Prob of  j ) \text{Prob of } (i,j) = \text{(Prob of } i \text{) (Prob of } j \text{)} Prob of (i,j)=(Prob of i) (Prob of j)

例子2 把硬币朝同一个方向粘在一起。唯一的可能性是 ( 1 , 1 ) 、 ( 0 , 0 ) (1,1)、(0,0) (1,1)(0,0)。它们有概率 1 2 、 1 2 \frac{1}{2}、\frac{1}{2} 2121。概率 p 10 、 p 01 p_{10}、p_{01} p10p01 0 0 0

例子 1 和 2 的概率矩阵为

P = [ p 11 p 12 p 21 p 22 ] = [ 1 4 1 4 1 4 1 4 ] P = [ 1 2 0 0 1 2 ] P = \left[\begin{matrix} p_{11} & p_{12} \\ p_{21} & p_{22} \\ \end{matrix}\right]= \left[\begin{matrix} \frac{1}{4} & \frac{1}{4} \\ \frac{1}{4} & \frac{1}{4} \\ \end{matrix}\right] \quad P = \left[\begin{matrix} \frac{1}{2} & 0 \\ 0 & \frac{1}{2} \\ \end{matrix}\right] P=[p11p21p12p22]=[41414141]P=[210021]


我们在 P P P 上多花点时间,用好的矩阵符号来表示它。矩阵显示了每一对( x i , y j x_i, y_j xi,yj)的概率 p i j p_{ij} pij —— 开始于( x 1 , y 1 x_1,y_1 x1,y1)=(正面,正面)和( x 1 , y 2 x_1, y_2 x1,y2)=(正面,反面)。注意行和 p i p_i pi 和列和 p j p_j pj 的总和为 1 1 1

概率矩阵

P = [ p 11 p 12 p 21 p 22 ] p 11 + p 12 = p 1 p 21 + p 22 = p 2 (first coin) (second coin)column sums  P 1 P 2 4  entries add to  1 P = \left[\begin{matrix} p_{11} & p_{12} \\ p_{21} & p_{22} \\ \end{matrix}\right] \quad \begin{matrix} p_{11} + p_{12} = p_1 \\ p_{21} + p_{22} = p_2 \\ \end{matrix} \text{(first coin)} \\ \text{(second coin)column sums } P_1 P_2 \quad 4 \text{ entries add to } 1 P=[p11p21p12p22]p11+p12=p1p21+p22=p2first coinsecond coincolumn sums P1P24 entries add to 1

这些数字 p 1 , p 2 p_1, p_2 p1,p2 P 1 , P 2 P_1, P_2 P1,P2 被称为矩阵 P P P边际(marginals)



Ref

  1. Introduction to Linear Algebra - GILBERT STRANG
  2. 为什么分母从n变成n-1之后,就从【有偏估计】变成了【无偏估计】?

猜你喜欢

转载自blog.csdn.net/weixin_36815313/article/details/132114744