You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

咨询:随机变量X偏差的期望是否指绝对偏差期望E[|X-μ|]?

Hey there! Great call speculating that the "deviation expectation" here almost certainly refers to the expected absolute deviation from the mean—that’s exactly $E[|X-\mu|]$ where $\mu = E[X]$. Let’s break down how to compute this, along with key context and examples.

Calculating $E[|X-\mu|]$: Step-by-Step

For Discrete Random Variables

If $X$ takes distinct values $x_1, x_2, ..., x_k$ with corresponding probabilities $p_1, p_2, ..., p_k$:

  1. First compute the population mean $\mu = \sum_{i=1}^k x_i p_i$
  2. Calculate the absolute deviation of each value from the mean: $|x_i - \mu|$
  3. Weight each absolute deviation by its probability and sum the results:
    $$E[|X-\mu|] = \sum_{i=1}^k |x_i - \mu| p_i$$

For Continuous Random Variables

If $X$ has a probability density function (pdf) $f(x)$ defined over its support:

  1. First compute the mean $\mu = \int_{-\infty}^{\infty} x f(x) dx$ (ensure this integral converges—otherwise the mean doesn’t exist!)
  2. To compute the expected absolute deviation, integrate the product of $|x - \mu|$ and the pdf across all possible values of $X$. You can split the integral at $\mu$ to remove the absolute value:
    $$E[|X-\mu|] = \int_{-\infty}^{\mu} (\mu - x) f(x) dx + \int_{\mu}^{\infty} (x - \mu) f(x) dx$$

Practical Examples

Discrete Case

Let’s use a simple discrete distribution: $X$ takes values 0, 2, 4 with equal probability ($p=1/3$ each).

  • $\mu = (0 + 2 + 4)/3 = 2$
  • $E[|X-\mu|] = |0-2|(1/3) + |2-2|(1/3) + |4-2|*(1/3) = (2 + 0 + 2)/3 = 4/3$

Continuous Case

Take $X \sim Uniform(a, b)$ (uniform distribution over $[a,b]$):

  • $\mu = (a + b)/2$
  • $E[|X-\mu|] = \int_a^{\mu} (\mu - x)\frac{1}{b-a} dx + \int_{\mu}^b (x - \mu)\frac{1}{b-a} dx$
  • Solving this gives the simplified formula: $\frac{b - a}{4}$ (for an example with $a=0, b=2$, this gives $0.5$, which matches manual calculation)
Key Context & Shortcuts
  • Unlike variance ($E[(X-\mu)^2]$), expected absolute deviation is robust to outliers because it doesn’t square large deviations—this makes it a better measure of spread for skewed or heavy-tailed distributions.
  • For common distributions, you can skip manual calculation using pre-derived formulas:
    • Normal distribution $N(\mu, \sigma^2)$: $E[|X-\mu|] = \sigma \sqrt{\frac{2}{\pi}} \approx 0.7979\sigma$
    • Poisson distribution $Poisson(\lambda)$: For large $\lambda$, $E[|X-\lambda|] \approx 2\sqrt{\frac{\lambda}{\pi}}$

内容的提问来源于stack exchange,提问作者Susan_Math123

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 03:44:40