1
$\begingroup$

What is the process of finding the expected value of $X$ in a normal distribution between a certain interval?

In particular I want to find: $E(X | a \le X \le b)$.

For example, if $X$ has $\mu=0$ and $\sigma=0.5$, I want to calculate $E(X | 0.2 \le X \le0.3)$.

I have read this question but it refers to the truncation of the upper tail only.

$\endgroup$
3
  • $\begingroup$ Related question: stats.stackexchange.com/questions/294309/… $\endgroup$
    – Moormanly
    Commented May 1, 2018 at 15:57
  • 2
    $\begingroup$ @Xi'an my question is not a duplicate of the question you are referring to. From what I understand the other question refers to one-sided truncation, and I am asking about two-sided truncation. $\endgroup$
    – notArefill
    Commented May 1, 2018 at 18:22
  • 1
    $\begingroup$ Yes, but an alternative solution in that thread generalizes it to exactly your situation and gives the answer. $\endgroup$
    – whuber
    Commented May 1, 2018 at 20:01

2 Answers 2

2
$\begingroup$

Like in the other answer, we know that $$f(x\vert a\leq X \leq b) = \frac{f(x)\mathbb{I}_{(a,b)}}{\int_a^b f(x')dx'}$$

Where I'm using $\mathbb{I}_{(a,b)}$ as the identity function (i.e. it bounds it between $a$ and $b$).

For the denominator, we have:

$$ \int_a^bf(x')dx' = \int_{-\infty}^bf(x')dx' - \int_a^{\infty}f(x')dx' = \Phi(b) - \Phi(a) $$

Where $\Phi$ is the CDF of a $X$. Putting this together, we see that

$$ \mathbb{E}(X\vert a\leq X \leq b) = \frac{1}{\int_a^bf(x)dx}\int x f(x)\mathbb{I}_{(a,b)}dx = \frac{1}{\Phi(b) - \Phi(a)}\int_a^b x f(x)dx$$

Now, this question does a really good job at calculating $\int_a^b x f(x)dx$. Notice that they what's above is what their missing to calculate $\mathbb{E}(X\vert a\leq X \leq b)$. I'll re-write the rest below:

$$\int_a^bxf(x)dx = \int_a^b(x-\mu)f(x)dx - \int_a^b\mu f(x)dx $$

It's clear that $$\int_a^b\mu f(x)dx = \mu[\Phi(b)-\Phi(a)]$$

And through some manipulation we see that $$\int_a^b(x-\mu)f(x)dx = \sigma(-\phi(\beta) + \phi(\alpha)]$$ where $\alpha = (a - \mu)/\sigma$ and $\beta = (b - \mu)/\sigma$. See the above link for a definition of $\phi$.

Putting this all together and rearranging gives us:

$$\mathbb{E}(X \vert a\leq X \leq b) = \mu + \sigma \frac{\phi(\alpha) - \phi(\beta)}{\Phi(\beta) - \Phi(\alpha)}$$

$\endgroup$
5
  • 1
    $\begingroup$ it is not true that $\mathbb{P}((X=x) \bigcap (a\leq X \leq b)) = f(x)\mathbb{I}_{(a,b)}$. The left hand side is $0$ $\endgroup$
    – Taylor
    Commented May 1, 2018 at 18:55
  • $\begingroup$ How come? It isn’t equal to $f(x)$, right? Via the link you provide: g(x)=f(x) for x between a and b. $\endgroup$ Commented May 1, 2018 at 18:57
  • $\begingroup$ Ah I see what you’re saying. Will edit. Still, the numerator shouldn’t be f(x) $\endgroup$ Commented May 1, 2018 at 18:59
  • 1
    $\begingroup$ what I am saying is that densities are not probabilities. $\endgroup$
    – Taylor
    Commented May 1, 2018 at 19:16
  • $\begingroup$ Fixed it, thanks. Does that make more sense? $\endgroup$ Commented May 2, 2018 at 13:59
1
$\begingroup$

Integrate with respect to the density $$ f(x \mid a \le X \le b) = \frac{f(x)}{\int_a^b f(x')dx'}. $$

I like to think of this as $f_{X\mid Y}(x \mid y)$ where $Y = \mathbb{1}_{[a,b]}(X)$. Clearly $$P(Y = 1) = P(a \le X \le b) = \int_a^b f(x) dx.$$ Writing it this way resembles the possibly more familiar thing you have where it's the density of one random variable given a different random variable.

More information on why this truncating move works can be found here, and the special case where $X$ is Gaussian is discussed here.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.