# Product of a normal distribution and an exponential distribution?

I am trying to find the product of normal distribution and Exponential distribution (Both are independent). Could we do analytically?

This question is linked with Link 1, and Link 2. But still not yet answered.

• Welcome to MMA StackExchange. This question doesn't seem to be related to the software Mathematica? Have you tried anything yet ? Commented Jul 29, 2019 at 9:12
• Wolfram is unable to find this one$f(z)=\int_0^{\infty}\frac{\lambda}{x\sqrt{2\pi\sigma^2}}e^{-\frac{(x-\mu)^2}{2\sigma^2}-\frac{\lambda z}{x}}$. Commented Jul 29, 2019 at 9:14
• Mathematica finds PDF[TransformedDistribution[ x*y, {x [Distributed] NormalDistribution[0, [Sigma]], y [Distributed] ExponentialDistribution[[Lambda]]}], t] in terrms of MeijerG function $$\frac{\lambda G_{0,3}^{3,0}\left(\frac{t^2 \lambda ^2}{8 \sigma ^2}| \begin{array}{c} 0,0,\frac{1}{2} \\ \end{array} \right)}{2 \sqrt{2} \pi \sigma } .$$ There are wishes and there is reality. Commented Jul 29, 2019 at 9:50
• @user64494 I am sorry, I don't know, how to change above integration function in to Meijer G function. Do we analytically change into Meijer G function? Commented Jul 29, 2019 at 9:55
• Possible duplicate of the linked question. Commented Jul 29, 2019 at 13:25

Clear["Global*"]

distx = NormalDistribution[0, σ];

disty = ExponentialDistribution[λ];

assume = DistributionParameterAssumptions[distx] &&
DistributionParameterAssumptions[disty]

(* σ > 0 && λ > 0 *)

(cdf[z_] =
Probability[
x*y <= z, {x \[Distributed] distx,
y \[Distributed] disty}]) //


(pdf[z_] = Assuming[assume, D[cdf[z], z]]) //


The expressions for z < 0 and z > 0 are identical

Assuming[assume,
Equal @@ (Simplify[pdf[z], #] & /@ {z < 0, z > 0}) //
Simplify]

(* True *)


Consequently, simplify the expression to

(pdf[z_] = Simplify[pdf[z], z > 0]) //


Alternatively,

distz = TransformedDistribution[x*y,
{x \[Distributed] NormalDistribution[0, σ],
y \[Distributed] ExponentialDistribution[λ]}];

(pdf2[z_] = PDF[distz, z]) // TraditionalForm


Although it is difficult to show that the expressions for the PDF are equivalent, the numeric difference between the two expressions is zero:

Plot[pdf[z] - pdf2[z] /. {σ -> λ}, {z, -4, 4},
PlotRange -> {-10^-6, 10^-6},
WorkingPrecision -> \$MachinePrecision]
`

• Nice to see that MMA pulls this off. Springer showed that such a product is a MeijerG function back in the 70s...
– ciao
Commented Jul 29, 2019 at 21:37