# Conditional distribution $f_{X\mid A}(x)$

Given the probability density function of the random variable $X$ is $f_X(x)$ and the probability of set $A=\{x:a<X<b\}.$ How can we find the conditional probability density function $f_{X\mid A}(x)$?

My attempt:

When $x\notin A$, $f_{X\mid A}(x)=0.$

Correction according to comment When $x\in A$, $f_{X\mid A}(x)=\cfrac{f_X(y)}{P(A)}$ where $P(A)$ is the probability of even $A$.

This seems to give a valid probability distribution that sums to 1. But I am not sure if it is correct. Also is it a definition that I just wrote? Or can we derive it from some fundamentals?

-
No need to integrate in the numerator, only in the denominator: $$f_{X\mid A}(x\mid A) = f_{X\mid \{a<X<b\}}(x\mid a < X < b) = \begin{cases}\frac{f_X(x)}{\int_a^b f_X(x)\,\mathrm dx},&a < x < b,\\0,&\text{otherwise.}\end{cases}$$ – Dilip Sarwate Oct 10 '13 at 19:06
@DilipSarwate Thank you, I corrected accordingly and understand the mistake. – triomphe Oct 10 '13 at 19:40

Or can we derive it from some fundamentals?

Of course we can. Recall that the density $f_X$ is uniquely defined (well, uniquely up to sets of zero Lebesgue measure) by the condition that, for every measurable bounded function $u$, $$E[u(X)]=\int u(x)f_X(x)\mathrm dx.$$ Likewise, the conditional density $f_{X\mid A}$ of $X$ conditional on $A=[a\lt X\lt b]$, assuming that $P[A]\gt0$, is uniquely defined by the condition that, for every measurable bounded function $u$, $$E[u(X)\mid A]=\int u(x)f_{X\mid A}(x)\mathrm dx.$$ The LHS is the ratio of $E[u(X);a\lt X\lt b]$ by $P[A]$. Now, $E[u(X);a\lt X\lt b]=E[v(X)]$ for $v:x\mapsto u(x)\mathbf 1_{a\lt x\lt b}$ hence $$E[u(X);a\lt X\lt b]=\int v(x)f_X(x)\mathrm dx=\int u(x)f_X(x)\mathbf 1_{a\lt x\lt b}\mathrm dx.$$ Dividing by $P[A]$, this proves that $$f_{X\mid A}(x)=\frac{\mathbf 1_{a\lt x\lt b}}{P[A]}f_X(x).$$ Note finally that $f_{X\mid A}\geqslant0$, as it should be for a density, and that, equally as it should be for a density, $$\int f_{X\mid A}=\int\frac{\mathbf 1_{a\lt x\lt b}}{P[A]}f_X(x)\mathrm dx=\frac1{P[A]}\int_a^bf_X(x)\mathrm dx=1.$$

-
thank you. Could you please explain the first claim, "density $f(x)$ is uniquely defined by....." Do you mean if we give expected value of just any bounded measurable function, we have the density? – triomphe Oct 11 '13 at 12:26
Yes, if the identity $E[u(X)]=\int u(x)f(x)\mathrm dx$ holds for every bounded measurable $u$, it implies that $f$ is the density of $X$. For example, $u=\mathbf 1_B$ shows that $P[X\in B]=\int_Bf$. – Did Oct 11 '13 at 21:08

You are almost correct: The conditional probability of X|A will be $f_{x|A}(x) = \frac{f_{X}(x)\textbf{1}_{A}}{\int_{a}^{b} f_{X}}$ so that you have a rescaled density.

This is derived from the definition of a conditional density, which can be derived from the definition of conditional probability: $\lim\limits_{\epsilon \longrightarrow 0} \frac{F_{X}(x+\epsilon)-F_{X}(x)}{\epsilon \int_{a}^{b} f_{X}}$

-