1. 概率论
1.1 条件概率
- 对概率的定义一直以来都有多种解释,频率学派认为概率是代表了事件发生的频率,而贝叶斯学派认为概率是一个随机函数,用来衡量不确定性,一般用#card=math&code=P%28x%29)代表事件x发生的概率,对于概率有如下几个定理:
- 其中#card=math&code=P%28A%7CB%29)是条件概率,代表了B事件发生的情况下A事件发生的概率,因此有:%3D%5Cfrac%7BP(A%2CB)%7D%7BP(B)%7D%0A#card=math&code=P%28A%7CB%29%3D%5Cfrac%7BP%28A%2CB%29%7D%7BP%28B%29%7D%0A)
- 条件概率服从链式法则,即:
%3DP(X_1)P(X_1%7CX_2%2C%5Cdots%2CX_n)%3DP(X_1)P(X_2)P(X_2%7CX_3%2C%5Cdots%2CX_n)%3D%5Cdots%0A#card=math&code=P%28X_1%2CX_2%2C%5Cdots%2CX_n%29%3DP%28X_1%29P%28X_1%7CX_2%2C%5Cdots%2CX_n%29%3DP%28X_1%29P%28X_2%29P%28X_2%7CX_3%2C%5Cdots%2CX_n%29%3D%5Cdots%0A)
1.2 概率密度函数
- 离散型的变量的概率分布可以用概率质量函数来描述,而多个变量的概率分布叫做联合概率分布,可以写成#card=math&code=P%28X%3Dx%2CY%3Dy%29)
- 连续型变量的概率分布可以使用概率密度函数(PDF)来描述,一个变量的概率密度函数在这个变量的定义域上的积分为1
- 边缘概率分布:
%3D%5Csum%20%7By%7DP(X%3Dx%2CY%3Dy)%0A#card=math&code=P%28X%3Dx%29%3D%5Csum%20%7By%7DP%28X%3Dx%2CY%3Dy%29%0A)
2. 数理统计
2.1 期望、方差和协方差
2.1.1 期望
- 期望表示概率作用下的随机变量的平均值
%5D%20%3D%20%5Csum_xP(x)f(x)%0A#card=math&code=%5Cmathbb%20E%5Bf%28x%29%5D%20%3D%20%5Csum_xP%28x%29f%28x%29%0A)
- 期望的变化是线性的,对于随机变量X和Y,如果,那么:
%3D%5Cmathbb%20E%20(%5Calpha%5ET%20X%2B%5Cbeta)%3D%5Calpha%5ET%20%5Cmathbb%20E%20(X)%0A#card=math&code=%5Cmathbb%20E%28Y%29%3D%5Cmathbb%20E%20%28%5Calpha%5ET%20X%2B%5Cbeta%29%3D%5Calpha%5ET%20%5Cmathbb%20E%20%28X%29%0A)
2.1.2 方差
- 方差是用来衡量对X依据概率分布进行采样的时候,随机变量X的函数值会出现多大的差异,
%3D%5Cmathbb%20E%5B(X-%5Cmathbb%20E(X))%5E2%5D%3D%5Cmathbb%20E(X%5E2)-%5Cmathbb%20E(X)%5E2%0A#card=math&code=%5Cmathrm%20%7Bvar%7D%28X%29%3D%5Cmathbb%20E%5B%28X-%5Cmathbb%20E%28X%29%29%5E2%5D%3D%5Cmathbb%20E%28X%5E2%29-%5Cmathbb%20E%28X%29%5E2%0A)
- 对于随机变量X,Y如果 那么
%26%3D%5Cmathbb%20E%5B(Y-%5Cmathbb%20E(Y))%5E2%5D%3D%5Cmathbb%20E(Y%5E2)-%5Cmathbb%20E(Y)%5E2%5C%5C%0A%26%3D%5Cmathbb%20E((%5Calpha%5ET%20X%2B%5Cbeta)%5E2)-%5Cmathbb%20E(%5Calpha%5ET%20X%2B%5Cbeta)%5E2%5C%5C%26%3D%5Calpha%5ET(%5Cmathbb%20E(X%5E2)-%5Cmathbb%20E(X)%5E2)%5Calpha%5C%5C%26%20%3D%5Calpha%5ET%5Cmathrm%20%7Bvar%7D(X)%5Calpha%0A%5Cend%7Baligned%7D%0A#card=math&code=%5Cbegin%7Baligned%7D%0A%5Cmathrm%20%7Bvar%7D%28Y%29%26%3D%5Cmathbb%20E%5B%28Y-%5Cmathbb%20E%28Y%29%29%5E2%5D%3D%5Cmathbb%20E%28Y%5E2%29-%5Cmathbb%20E%28Y%29%5E2%5C%5C%0A%26%3D%5Cmathbb%20E%28%28%5Calpha%5ET%20X%2B%5Cbeta%29%5E2%29-%5Cmathbb%20E%28%5Calpha%5ET%20X%2B%5Cbeta%29%5E2%5C%5C%26%3D%5Calpha%5ET%28%5Cmathbb%20E%28X%5E2%29-%5Cmathbb%20E%28X%29%5E2%29%5Calpha%5C%5C%26%20%3D%5Calpha%5ET%5Cmathrm%20%7Bvar%7D%28X%29%5Calpha%0A%5Cend%7Baligned%7D%0A)
- 方差的平方根称为标准差
2.1.3 协方差
- 协方差表明两个变量的线性相关性的强弱以及这些变量的尺度
%3DE(X-E%5BX%5D)E(Y-E%5BY%5D)%0A#card=math&code=%5Cmathrm%7BCov%7D%28X%2CY%29%3DE%28X-E%5BX%5D%29E%28Y-E%5BY%5D%29%0A)
- 如果两个变量相互独立,那么它们的协方差为0,如果两个变量的协方差不为0,那么一定是线性相关的。而X关于自身的协方差就是X的方差:
%3DE(X-E%5BX%5D)%5E2%3D%5Cmathrm%20%7Bvar%7D(X)%0A#card=math&code=%5Cmathrm%7BCov%7D%28X%2CX%29%3DE%28X-E%5BX%5D%29%5E2%3D%5Cmathrm%20%7Bvar%7D%28X%29%0A)
- 一个n维的随机向量X的协方差矩阵是一个的矩阵,矩阵的元素定义为:
%7Bi.j%7D%3D%5Cmathrm%7BCov%7D(X_i%2CX_j)%0A#card=math&code=%5Cmathrm%7BCov%7D%28X%29%7Bi.j%7D%3D%5Cmathrm%7BCov%7D%28X_i%2CX_j%29%0A)
- 很显然协方差矩阵的对角线山是对应维度的变量的方差
2.1.4 相关系数
- 相关系数的定义是
%7D%3D%5Cfrac%7B%5Cmathrm%7BCov(X%2CY)%7D%7D%7B%5Csqrt%7B%5Cmathrm%20%7Bvar%7D(X)%5Cmathrm%20%7Bvar%7D(Y)%7D%7D%0A#card=math&code=%5Cmathrm%20%7Bcorr%28X%2CY%29%7D%3D%5Cfrac%7B%5Cmathrm%7BCov%28X%2CY%29%7D%7D%7B%5Csqrt%7B%5Cmathrm%20%7Bvar%7D%28X%29%5Cmathrm%20%7Bvar%7D%28Y%29%7D%7D%0A)
2.2 正态分布
- 一元正态分布
%3D%5Cmathcal%7BN%7D(x%7C%5Cmu%2C%5Csigma%5E2)%3D%5Cfrac%7B1%7D%7B%5Csqrt%7B2%5Cpi%5Csigma%5E2%7D%7D%5Cexp%5Clbrace%20-%5Cfrac%7B(x-%5Cmu)%5E2%7D%7B2%5Csigma%5E2%7D%5Crbrace%0A%0A#card=math&code=P%28x%7C%5Cmu%2C%5Csigma%5E2%29%3D%5Cmathcal%7BN%7D%28x%7C%5Cmu%2C%5Csigma%5E2%29%3D%5Cfrac%7B1%7D%7B%5Csqrt%7B2%5Cpi%5Csigma%5E2%7D%7D%5Cexp%5Clbrace%20-%5Cfrac%7B%28x-%5Cmu%29%5E2%7D%7B2%5Csigma%5E2%7D%5Crbrace%0A%0A)
- 多元正态分布,其中x是一个d维的向量
%3D%5Cmathcal%7BN%7D(x%7C%5Cmu%2C%5CSigma%5E2)%3D%5Cfrac%7B1%7D%7B(%7B2%5Cpi%7D)%5E%7B%5Cfrac%7Bd%7D%7B2%7D%7D%7C%5CSigma%7C%5E%7B%5Cfrac%7B1%7D%7B2%7D%7D%7D%5Cexp%5B-%5Cfrac%7B1%7D%7B2%7D(%5Cboldsymbol%20x-%5Cmu)%5E%7BT%7D%5CSigma%5E%7B-1%7D(%5Cboldsymbol%20x-%5Cmu)%5D%0A%0A#card=math&code=P%28%5Cboldsymbol%20x%7C%5Cmu%2C%5CSigma%29%3D%5Cmathcal%7BN%7D%28x%7C%5Cmu%2C%5CSigma%5E2%29%3D%5Cfrac%7B1%7D%7B%28%7B2%5Cpi%7D%29%5E%7B%5Cfrac%7Bd%7D%7B2%7D%7D%7C%5CSigma%7C%5E%7B%5Cfrac%7B1%7D%7B2%7D%7D%7D%5Cexp%5B-%5Cfrac%7B1%7D%7B2%7D%28%5Cboldsymbol%20x-%5Cmu%29%5E%7BT%7D%5CSigma%5E%7B-1%7D%28%5Cboldsymbol%20x-%5Cmu%29%5D%0A%0A)