数学期望
主题:数学期望
数学期望就是总体的均值,或者各项的加权平均。何解?
1. 先看看均值为何?
data = {1, 2, 3, 4, 5, 6}
把每个数据加起来,然后除以数据总数量。
抽象:data = \(x_1, x_2, \cdots, x_n\)
或者如下:
数据 | \(x_1\) | \(x_2\) | \(\cdots\) | \(x_n\) |
---|---|---|---|---|
概率 | \(\frac{1}{n}\) | \(\frac{1}{n}\) | \(\dots\) | \(\frac{1}{n}\) |
上面是值,下面是这个取值相应取到的概率,而且这个列表把所有可能出现的情况全部都列出来了!
基于上表:数据\(\times\)概率,再求和
2. 离散情况
Let \({\displaystyle X}\) be a random variable with a finite number of finite outcomes \({\displaystyle x_{1}, x_{2}, \ldots , x_{k}}\) occurring with probabilities \({\displaystyle p_{1},p_{2},\ldots ,p_{k},}\) respectively. The expectation of \({\displaystyle X}\) is defined as
Since all probabilities \(p_{i}\) add up to 1 ( \(\displaystyle p_{1}+p_{2}+\cdots +p_{k}=1\)), the expected value is the weighted average, with \(p_{i}\)’s being the weights.
数据 | \(x_1\) | \(x_2\) | \(\cdots\) | \(x_k\) | \(\cdots\) |
---|---|---|---|---|---|
概率 | \(p_1\) | \(p_2\) | \(\dots\) | \(p_k\) | \(\cdots\) |
注意:\(p_{1}+p_{2}+\cdots +p_{k}+\cdots=1\) |
\(\displaystyle \operatorname {E} [X]=\sum _{k=1}^{\infty }x_{k}\,p_{k}\)
3. 连续情况
If \({\displaystyle X}\) is a random variable whose cumulative distribution function admits a density \({\displaystyle f(x)}\), then the expected value is defined as the following Lebesgue integral:
where \(\int_{\mathbb{R}} f(x) dx = 1\)
If \({\displaystyle F_{X}(x)=\operatorname {P} (X\leq x)}\) is the cumulative distribution function of \({\displaystyle X}\) , then
where the integral is interpreted in the sense of Lebesgue–Stieltjes.
4. 期望性质
期望值\({\displaystyle E}\)是线性函数。
\({\displaystyle \operatorname {E} (aX+bY)=a\operatorname {E} (X)+b\operatorname {E} (Y)}\)
\({\displaystyle X}\)和\(Y\)为在同一概率空间的两个随机变量(可以独立或者非独立), \({\displaystyle a}\)和 \({\displaystyle b}\)为任意实数。
一般的说,一个随机变量的函数的期望值并不等于这个随机变量的期望值的函数。
\({\displaystyle \operatorname {E} (g(X))=\int _{\Omega }g(x)f(x)\,\mathrm {d} x\neq g(\operatorname {E} (X))}\)
在一般情况下,两个随机变量的积的期望值不等于这两个随机变量的期望值的积。
当 \({\displaystyle \operatorname {E} (XY)=\operatorname {E} (X)\operatorname {E} (Y)}\)成立时,随机变量 \({\displaystyle X}\)和 \({\displaystyle Y}\)的协方差为0,又称它们不相关。特别的,当两个随机变量独立时,它们协方差(若存在)为0。