# PDF of product of two random variable with PDFs involving Dirac-delta function

I am trying to find the PDF of product of two random variables with the following distributions,

       f1 = (t/(T Pi r Sqrt[1-((x1^2)/(r^2))])) + (1-t/T) DiracDelta[x1];
domain[f1] = {x1, -r, r} && {T> t > 0, r > 0};


f1 is mixed distribution where, x1 follows a continuous distribution with probability t/T and rest of the time(1-t/T) the variable, x1=0.

       f2  = (2 F^(2/n)/((a^2) n)) x2^(-(2 + n)/n);
domain[f2] = {x2, F*(a^-n), Infinity} &&  {a > 0, F > 0, n > 0};


I used the TransformProduct function in MathStatica to generate the PDF of the product x1*x2

f3 = TransformProduct[{f1, f2}, y]


I get the following result

However, when I integrate f3, I get a numerical result equal to t/T, not 1 whereas both f1 and f2 integrates to 1. I feel like there is missing Dirac-delta in the f3 with area (1-t/T) like the one I have in f1. Am I doing anything wrong? Thanks.

• I don't have a TransformProduct function in Mathematica 10.4. Are you using (the excellent product) mathStatica ? If so, you should mention that.
– JimB
Apr 6, 2016 at 20:36
• Thanks @JimBaldwin I have mentioned now. Apr 6, 2016 at 21:49
• Upgrade you math: you use the DiracDelta distribution as an atomic measure. See en.wikipedia.org/wiki/Dirac_delta_function . Unfortunately, that topic in the article en.wikipedia.org/wiki/Probability_density_function is not correctly written . Mar 27, 2019 at 19:15

This is an unusual and interesting question. This is a bit obscured by the many parameters that make it difficult to see the wood for the trees.

Your first pdf, which has the DiracDelta function, is a mixed discrete / continuous random variable. To make this clear, if say $$r = 1$$, $$t = 1$$ and $$T = 2$$, then your mixed pmf/pdf f1 is:

    f1 = 1/(2Pi Sqrt[1-x1^2]) + DiracDelta[x1]/2


This is just a weighted average mix of an ArcSine random variable and 0. It could alternatively (and perhaps more naturally) be written as:

    f1 = If[ x1 == 0, 1/2, 1/(2Pi Sqrt[1-x1^2])]


which would be plotted as:

(source: tri.org.au)

By contrast, the TransformProduct function states in the Help system:

   Density f and density g can be continuous or piecewise continuous.


This defn does not include mixed cont/discrete random variables.

Using a DiracDelta function is an interesting way of trying to express a discrete model in a continuous space, but I am not sure that it is appropriate. One cannot even seem to plot it appropriately, though Integrate works.

Even though your mixed cont/discrete model is 'incompatible' with the restriction to continuous variables, all is not lost! One can easily provide a workaround, simply by formulating the problem slightly differently ...

Let us deconstruct your $$X_1$$ random variable back to its separate continuous and discrete parts. Then:

$$X_1 = \begin{cases}0 & \text{with probability } p \\ Z & \text{with probability } 1-p \end{cases}$$

where $$p = \frac{t}{T}$$, and random variable $$Z$$ has pdf $$f(z)$$:

(source: tri.org.au)

Next, $$X_2$$ has pdf, say $$f_2(x_2)$$:

(source: tri.org.au)

The desired product of random variables is:

$$Y = X_1 X_2 = \begin{cases}0 & \text{with probability } p \\ Z*X_2 & \text{with probability } 1-p \end{cases}$$

Then, the mixed pdf of $$Y$$ is:

$$\text{pdf}(Y) = \begin{cases}p & \text{if } y = 0 \\ (1-p) h(z * x_2) & \text{if } y \neq 0 \end{cases}$$

where $$h(z * x_2)$$ denotes the pdf of the product $$Z X_2$$. The latter ($$Z$$ and $$X_2$$) are both continuous random variables, so you can use the TransformProduct function from the mathStatica package to find that $$h(z * x_2)$$ is:

(source: tri.org.au)

... and we are all done.

Here is a plot of $$h(.)$$ (the continuous part) when $$F=1$$, $$n = 1$$, $$a = 2$$, $$r=1$$:

(source: tri.org.au)

All that happens when you embed $$h(.)$$ into the mixed model $$\text{pdf}(Y)$$ above is that the continuous density gets scaled down by $$(1-p)$$, and there will be a discrete mass $$p$$ at 0.

• Thank you very much @wolfies. I appreciate the help! Apr 7, 2016 at 15:45
• See my comment to the question. Mar 27, 2019 at 19:16