Derive density of $Z=XY$, $X\sim U(0,1)$ and $Y\sim\mathcal N(0,1)$.

129 Views Asked by At

I have been stumped for a few days on this. I have two random variables $X\sim U(0,1)$ and $Y\sim\mathcal N(0,1)$, which are independent. How can I get the density of $Z = XY$?

I put $Z = XY, W = Y$ i.e. $X=Z/W, Y=W$ and achieved the Jacobian as $J={1\over|W|}$, but I've got $f_{Z,W}(z,w)={1\over\sqrt{2\pi}|w|}{\exp(-w^2/2)}$ and I don't know how to integrate this w.r.t $w$ and get the (marginal) density of $Z$. Could you please help me with this problem? I tried partial integration too but it doesn't work.

3

There are 3 best solutions below

2
On

angryavian's comment seems to be the way to get a close to numerical answer.

Incase you were interested visually in the density here is a plot with $10^7$ samples. It seems to be strangely convex, my guess is that it would have looked very normal.

enter image description here

0
On

$\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,} \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack} \newcommand{\dd}{\mathrm{d}} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,} \newcommand{\ic}{\mathrm{i}} \newcommand{\mc}[1]{\mathcal{#1}} \newcommand{\mrm}[1]{\mathrm{#1}} \newcommand{\on}[1]{\operatorname{#1}} \newcommand{\pars}[1]{\left(\,{#1}\,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,} \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}} \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$ $\ds{\bbox[5px,#ffd]{}}$


\begin{align} {\cal P}\pars{z} & \equiv \totald{}{z}\int_{-\infty}^{z}{\cal P}\pars{z'}\dd z' \\[2mm] & = \totald{}{z}\int_{-\infty}^{\infty} {\expo{-y^{^2}\,/2} \over \root{2\pi}}\int_{0}^{1}\Theta\pars{z - xy}\dd x\,\dd y \\[2mm] & = \int_{-\infty}^{\infty} {\expo{-y^{^2}\,/2} \over \root{2\pi}}\int_{0}^{1}\delta\pars{z - xy} \dd x\,\dd y \\[2mm] & = \int_{-\infty}^{\infty} {\expo{-y^{^2}\,/2} \over \root{2\pi}}\int_{0}^{1}{\delta\pars{x - z/y} \over \verts{y}}\dd x\,\dd y \\[2mm] & = \int_{-\infty}^{\infty} {\expo{-y^{^2}\,/2} \over \root{2\pi}} \bracks{0 < {z \over y} < 1}{\dd y \over \verts{y}} \\[2mm] & = \bracks{z < 0}\int_{-\infty}^{z} {\expo{-y^{^2}\,/2} \over \root{2\pi}} {\dd y \over -y} + \bracks{z > 0}\int_{z}^{\infty} {\expo{-y^{^2}\,/2} \over \root{2\pi}} {\dd y \over y} \\ & = \bbx{\Gamma\pars{0,z^{2}/2} \over 2\root{2\pi}}. \\ & \Gamma\pars{0,\cdots}\ \mbox{is the}\ Incomplete\ Gamma\ Function. \end{align}

enter image description here

0
On

I put $Z = XY, W = Y$ i.e. $X=Z/W, Y=W$ and achieved the Jacobian as $J={1\over|W|}$, but I've got $f_{Z,W}(z,w)={1\over\sqrt{2\pi}|w|}{\exp(-w^2/2)}$ and I don't know how to integrate this w.r.t $w$ and get the (marginal) density of $Z$.

That is okay, but you forgot the support.   Always note the support!   Doing so will give you the same result as @FelixMarin obtained.

$\qquad\begin{align}f_{Y,Z}(y,z)&=f_{Y,XY}(y,z) \\&= \begin{vmatrix}\dfrac{\partial z/y}{\partial z}\end{vmatrix} f_{X,Y}(z/y,y)\\&=\begin{vmatrix}\dfrac{1}{y}\end{vmatrix}\dfrac{\exp(-y^2/2)}{\surd(2\pi)}\,\mathbf 1_{0\leq z/y\leq 1}\,\mathbf 1_{y\in\Bbb R}\\&=\begin{vmatrix}\dfrac{1}{y}\end{vmatrix}\dfrac{\exp(-y^2/2)}{\surd(2\pi)}\,(\mathbf 1_{0\leq z\leq y}+\mathbf 1_{y\leq z\leq 0})\\[3ex] f_Z(z) &= \mathbf 1_{0\leq z}\int_z^\infty \dfrac{\exp(-y^2/2)}{y\surd(2\pi)}\mathrm d y-\mathbf 1_{z<0}\int_{-\infty}^z\dfrac{\exp(-y^2/2)}{y\surd(2\pi)}\mathrm d y\\&=\mathbf 1_{z\in\Bbb R}\int_{\lvert z\rvert}^\infty\dfrac{\exp(-y^2/2)}{y\surd(2\pi)}\mathrm d y\\&~~\vdots\\&=\dfrac{\Gamma(0, z^2/2)}{2\surd(2\pi)}\,\mathbf 1_{z\in\Bbb R}\end{align}$

Where the incomplete gamma function is defined as $\Gamma(a,x):=\int_x^\infty t^{a-1}\exp(-t)\,\mathrm d t$ so

$$\Gamma(0, z^2/2) = \int_{z^2/2}^\infty t^{-1}\exp(-t)\,\mathrm d t$$