marginal density of $|X|$

39 Views Asked by At

I have a continuous random variable $X$ whose distribution is conditioned on another discrete random variable $S$. The conditional density function of $X$ is

  • $f_{X|S}(x|1) = \alpha e^{-\alpha x}, x \geq 0$
  • $f_{X|S}(x|-1) = \beta e^{\beta x}, x \leq 0$

I can see that when $S=1$, $X \sim Exp(\alpha)$ with $\alpha >0$ and when $S=-1$, $-X \sim Exp(\beta)$ with $\beta >0$. That is, $S$ is the sign of $X$.

I then define $Z = |X|$ and I have to calculate $\mathbb{P}(S=1|Z=z)$. I know that this is the posterior probability of $S$ and I can use the Bayes rule for the case of a discrete unknown and continuous observation. The chosen formula is: $$p_{S|Z}(1|z)= \frac{p_S(1)f_{Z|S}(z|1)}{f_Z(z)}$$ and I know from the prior of $S$ that $p_S(1) = p$.

My approach to calculate $f_{Z|S}(z|1)$ would be to consider that, if I know that $S=1$ therefore $Z = X$ and $f_{Z|S}(z|1) = f_{X|S}(x|1)$. What I don't understand is how to come out with the marginal of $Z$. The marginal of $X$ is:

  • $p \cdot \alpha e^{-\alpha x}$ when $x \geq 0$
  • $(1-p) \cdot \beta e^{\beta x}$ when $x \leq 0$

and my idea here is that the marginal of $Z$ is $p \cdot \alpha e^{-\alpha z} + (1-p) \cdot \beta e^{\beta z}$ since the $|X|$ mirrors $-X$ for the negative part, but I get a bit lost at this point.

EDIT: I also thought that, since $f_{X|S}(x|-1) = \beta e^{\beta x}$ then $f_{Z|S}(z|-1) = \beta e^{-\beta x}$, therefore $$f_Z(z) = p \cdot \alpha e^{-\alpha z} + (1-p) \cdot \beta e^{-\beta z}$$ but I don't know whether this is correct.

2

There are 2 best solutions below

0
On BEST ANSWER

For $z \ge 0,$ $$\begin{align*} \Pr[Z \le z] &= \Pr[-z \le X \le z] \\ &= \Pr[-z \le X < 0 \mid S = -1]\Pr[S = -1] + \Pr[0 \le X \le z \mid S = 1]\Pr[S = 1] \\ &= (1 - e^{\beta (-z)})(1-p) + (1 - e^{-\alpha z})p. \end{align*}$$

Therefore, $$f_Z(z) = p \alpha e^{-\alpha z} + (1-p) \beta e^{-\beta z}.$$

0
On

Yes your thoughts are correct.

Assuming $P(S=1)=p=1-P(S=-1)$,

we have for all $z\ge 0$,

\begin{align} P(Z\le z)=P(|X|\le z)&=P(|X|\le z\mid S=1)P(S=1)+P(|X|\le z\mid S=-1)P(S=-1) \\&=P(X\le z\mid S=1)p+P(-X\le z\mid S=-1)(1-p) \\&=pF_{X\mid S=1}(z)+(1-p)F_{-X\mid S=-1}(z) \end{align}

, where $F$ is the distribution function.

So the density of $Z$ is

\begin{align} f_Z(z)&=pf_{X\mid S=1}(z)+(1-p)f_{-X\mid S=-1}(z) \\&=p\alpha e^{-\alpha z}\mathbf1_{z\ge0}+(1-p)\beta e^{-\beta z}\mathbf1_{z\ge0} \\&=\left[p\alpha e^{-\alpha z}+(1-p)\beta e^{-\beta z}\right]\mathbf1_{z\ge0} \end{align}