# Probablity: What's the p.d.f. of the random variable Z = X|X|

1. Feb 17, 2014

### sanctifier

1. The problem statement, all variables and given/known data

If the probability density function(p.d.f.) of a random variable X is f(x) = 1/6 * e-|x|/3 where x is lying in (-∞,∞) and |-x| = x if x≥0, then what is the p.d.f. of the random variable Z = XY = X*|X| where Y = |X| ?

2. Relevant equations

Nothing special.

3. The attempt at a solution

Answer: h(z) = f(x) * g(y) where g(y) = 2 * 1/6 * e-y/3 = 1/3 * e-y/3
Comment: Because for y=|x|, its range shrinks to half of x, i.e., (0,∞) instead of the oringinal (-∞,∞), consequently, its p.d.f. should be 2*f(x). It seems like if h(z) = f(x) * g(y) then X and Y are independent? I think this answer is wrong, anyone can help?

Last edited: Feb 17, 2014
2. Feb 17, 2014

### Ray Vickson

X and Y = |X| are not independent; they are about as dependent as you can get.

In problems of this type, do not try to "guess"; proceed carefully, step-by-step from first principles. In this case it is easiest to first figure out what is $F(z) = \text{P}(Z \leq z )$, where $Z = X |X|$. Look separately at the two cases z < 0 and z > 0. I will help you get started on the case when z < 0.

So, if z < 0 we can write it as z = -|z|. In order to have Z = X|X| ≤ z = -|z| we need X < 0; do you see why? So, in this case we have $Z = -X^2$, hence we need $- X^2 \leq - |z|$, or $\{ |X| \geq \sqrt{|z|}\; \& \; X < 0\}$. This event has the same probability as $\{X \geq \sqrt{|z|} \}$, because the distribution of X is symmetric about x = 0.

So, for $z < 0$ we have
$$F(z) \equiv \text{P}(X|X| \leq z) = \text{P} (X \geq \sqrt{|z|}).$$
You can complete the calculation, and also do it in the other case of z > 0. Then you get the density function $f(z)$ of $Z$ by differentiation of $F(z)$.

I would not classify this as a precalculus problem.

Last edited: Feb 17, 2014
3. Feb 17, 2014

### sanctifier

If z > 0, then

$F(z) = p(Z \leq z) = p(x \mid x \mid \leq z) = p(x^{2} \leq z \; and \; x > 0) = p(0 < x \leq \sqrt{z}) = \int_ 0 ^ \sqrt{z} \frac{1}{6} e^{- \frac{x}{3} } dx$

$f(z) = \frac{dF(z)}{dz} = \frac{d\int_ 0 ^ \sqrt{z} \frac{1}{6} e^{- \frac{x}{3} } dx}{dz} = \frac{1}{12 \sqrt{z}} e^{- \frac{\sqrt{z}}{3}}$

If z < 0, then

$F(z) = p(Z \leq z) = p(x \mid x \mid \leq z) = p(-x^{2} \leq z \; and \; x < 0) = p(x \leq - \sqrt{-z}) = \int_ {-\infty} ^ {-\sqrt{-z}} \frac{1}{6} e^{ \frac{x}{3} } dx$

$f(z) = \frac{dF(z)}{dz} = \frac{d \int_ {-\infty} ^ {-\sqrt{-z}} \frac{1}{6} e^{ \frac{x}{3} } dx}{dz} = \frac{1}{12 \sqrt{-z}} e^{- \frac{\sqrt{-z}}{3}}$

If it is, then
$h(x) = \frac{1}{6} e^{-\frac{|x|}{3}}$
$g(|x|) = \frac{1}{3} e^{-\frac{|x|}{3}}$
$f(x|x|) \neq h(x) * g(|x|)$

Hence, x and |x| are not independent.

Is this correct?

Thank you very much, Ray Vickson.

4. Feb 17, 2014

### Ray Vickson

You are correct that
$$f(z) = \frac{1}{12} \frac{e^{-\frac{\sqrt{|z|}}{3}}}{\sqrt{|z|}},$$
which form holds for both z > 0 and z < 0.

I don't know what you are doing after that, or why you bother. Of course, X and |X| are not independent; no calculations are needed to see this, because for any function k(x) the random variables X and k(X) are dependent. After all, if I tell you a value of X you know exactly what is the value of k(X) with no uncertainty whatsoever.

5. Feb 18, 2014

### sanctifier

Because I was required to compute the covariance of x and |x|, hence I have to figure out z=x|x| for computing E[x|x|], now I have the formula of z, hence

$E[x|x|] = E[Z] = \int_0^\infty \frac{\sqrt{z}}{12} e^{ -\frac{ \sqrt{z}}{3} } dz + \int_{-\infty}^0 \frac{-\sqrt{z}}{12} e^{ -\frac{ \sqrt{z}}{3} } dz = \int_0^\infty \frac{ u^{2} }{6} e^{ -\frac{u}{3} } du - \int_0^\infty \frac{ v^{2} }{6} e^{ -\frac{v}{3} } dv = 0$

Then E[x] = 0 since f(x) is symmetric, finally

$Cov(x, |x|) = E[x|x|] - E[x]E[|x|] = 0$

6. Feb 18, 2014

### Ray Vickson

Strictly speaking, to compute expectations of functions Z = G(X) you do not need the distribution of Z (although having it does not hurt). Instead, you can use the so-called "Theorem of the Unconcious Statistician", which asserts that
$$E Z = \int f_X(x) G(x) \, dx$$
Here, $f_X(x)$ is the original density function of the original random variable $X$. What the theorem is really saying is that
$$\int f_Z(z) z \, dz = \int f_X(x) G(x) \, dx,$$
where $f_Z$ is the density function of the random variable $Z = G(X)$. See, eg, http://en.wikipedia.org/wiki/Law_of_the_unconscious_statistician .

So, in your case, $EZ \equiv E(X |X|) = \int f_X(x) x |x| \, dx.$

7. Feb 18, 2014

### sanctifier

Yes, the theorem is correct.

$E(x|x|)= \int_{- \infty }^{ \infty } \frac{1}{6} e^{ -\frac{|x|}{3} }x|x| dx = \int_{- \infty }^0 \frac{1}{6} e^{ \frac{x}{3} }(- x^{2} )dx + \int_0^{ \infty } \frac{1}{6} e^{ -\frac{x}{3} }x^{2} dx = - \int_0^{ \infty }\frac{1}{6} e^{ -\frac{u}{3} }u^{2} du + \int_0^{ \infty } \frac{1}{6} e^{ -\frac{x}{3} }x^{2} dx = 0$

Thank you again! Ray Vickson