python 数学期望_数学期望

主题:数学期望

数学期望就是总体的均值,或者各项的加权平均。何解?

1. 先看看均值为何?

data = {1, 2, 3, 4, 5, 6}

\[\text{average} = \frac{1+2+3+4+5+6}{n}

\]

把每个数据加起来,然后除以数据总数量。

抽象:data = \(x_1, x_2, \cdots, x_n\)

\[\text{average}=\frac{x_1+x_2+\cdots + x_n}{n}=\frac{\sum\limits_{i=1}^n x_i}{n}

\]

或者如下:

\[{\displaystyle {\text{AM}}={\frac {1}{n}}\sum _{i=1}^{n}a_{i}={\frac {a_{1}+a_{2}+\cdots +a_{n}}{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

\[\bm{E}[X]=\sum _{i=1}^{k} x_{i} p_{i} = x_{1}p_{1}+x_{2}p_{2}+\cdots +x_{k}p_{k}

\]

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:

\[\displaystyle \operatorname {E} [X]=\int _{\mathbb {R} }xf(x)\,dx

\]

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

\[{\displaystyle \operatorname {E} [X]=\int _{-\infty }^{+\infty }x\,dF_{X}(x),}

\]

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。

参考资料

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值