# Product distribution

A product distribution is a probability distribution constructed as the distribution of the product of random variables having two other known distributions. Given two statistically independent random variables X and Y, the distribution of the random variable Z that is formed as the product

${\displaystyle Z=XY}$

is a product distribution.

## Algebra of random variables

The product is one type of algebra for random variables: Related to the product distribution are the ratio distribution, sum distribution (see List of convolutions of probability distributions) and difference distribution. More generally, one may talk of combinations of sums, differences, products and ratios.

Many of these distributions are described in Melvin D. Springer's book from 1979 The Algebra of Random Variables.[1]

## Derivation for independent random variables

If ${\displaystyle X}$ and ${\displaystyle Y}$ are two independent, continuous random variables, described by probability density functions ${\displaystyle f_{X}}$ and ${\displaystyle f_{Y}}$ then the probability density function of ${\displaystyle Z=XY}$ is[2]

${\displaystyle f_{Z}(z)=\int _{-\infty }^{\infty }f_{X}\left(x\right)f_{Y}\left(z/x\right){\frac {1}{|x|}}\,dx.}$

### Proof [3]

First note that

${\displaystyle \mathbb {P} (Z

Then define the variable transformation ${\displaystyle T(x,y)=(xy,x)=(z,x)}$ which has the inverse ${\displaystyle T^{-1}(z,x)=(x,z/x)=(x,y)}$. The Jacobian and its determinant is given by

${\displaystyle \mathbf {J} (z,x)={\begin{bmatrix}{\dfrac {\partial x}{\partial z}}&{\dfrac {\partial y}{\partial z}}\\{\dfrac {\partial x}{\partial x}}&{\dfrac {\partial y}{\partial x}}\end{bmatrix}}}$
${\displaystyle \det(\mathbf {J} (z,x))=|x^{-1}|.}$

Equipped with this we obtain finally for the above probability, the following double integral

${\displaystyle \mathbb {P} (Y

and thus after changing the order of integration finally

${\displaystyle \mathbb {P} (Z

and the inner integral is just the desired probability density function.

## Expectation of product of random variables

When two random variables are statistically independent, the expectation of their product is the product of their expectations. This can be proved from the Law of total expectation:

${\displaystyle \operatorname {E} (XY)=\operatorname {E} _{Y}(\operatorname {E} _{XY\mid Y}(XY\mid Y))}$

In the inner expression, Y is a constant. Hence:

${\displaystyle \operatorname {E} _{XY\mid Y}(XY\mid Y)=Y\cdot \operatorname {E} _{X\mid Y}[X]}$
${\displaystyle \operatorname {E} (XY)=\operatorname {E} _{Y}(Y\cdot \operatorname {E} _{X\mid Y}[X])}$

This is true even if X and Y are statistically dependent. However, in general ${\displaystyle \operatorname {E} _{X\mid Y}[X]}$ is a function of Y. In the special case in which X and Y are statistically independent, it is a constant independent of Y. Hence:

${\displaystyle \operatorname {E} (XY)=\operatorname {E} _{Y}(Y\cdot \operatorname {E} _{X}[X])}$
${\displaystyle \operatorname {E} (XY)=\operatorname {E} _{X}(X)\cdot \operatorname {E} _{Y}(Y)}$

## Special cases

The distribution of the product of two random variables which have lognormal distributions is again lognormal. This is itself a special case of a more general set of results where the logarithm of the product can be written as the sum of the logarithms. Thus, in cases where a simple result can be found in the list of convolutions of probability distributions, where the distributions to be convolved are those of the logarithms of the components of the product, the result might be transformed to provide the distribution of the product. However this approach is only useful where the logarithms of the components of the product are in some standard families of distributions.

The distribution of the product of a random variable having a uniform distribution on (0,1) with a random variable having a gamma distribution with shape parameter equal to 2, is an exponential distribution.[4] A more general case of this concerns the distribution of the product of a random variable having a beta distribution with a random variable having a gamma distribution: for some cases where the parameters of the two component distributions are related in a certain way, the result is again a gamma distribution but with a changed shape parameter.[4]

The K-distribution is an example of a non-standard distribution that can be defined as a product distribution (where both components have a gamma distribution).

## In theoretical computer science

In computational learning theory, a product distribution ${\displaystyle {\mathcal {D}}}$ over ${\displaystyle \{0,1\}^{n}}$ is specified by the parameters ${\displaystyle \mu _{1},\mu _{2},\dots ,\mu _{n}}$. Each parameter ${\displaystyle \mu _{i}}$ gives the marginal probability that the ith bit of ${\displaystyle x\in \{0,1\}^{n}}$ sampled as ${\displaystyle x\sim {\mathcal {D}}}$ is 1; i.e. ${\displaystyle \mu _{i}=\operatorname {Pr} _{\mathcal {D}}[x_{i}=1]}$. In this setting, the uniform distribution is simply a product distribution with every ${\displaystyle \mu _{i}=1/2}$.

Product distributions are a key tool used for proving learnability results when the examples cannot be assumed to be uniformly sampled.[5] They give rise to an inner product ${\displaystyle \langle \cdot ,\cdot \rangle }$ on the space of real-valued functions on ${\displaystyle \{0,1\}^{n}}$ as follows:

${\displaystyle \langle f,g\rangle _{\mathcal {D}}=\sum _{x\in \{0,1\}^{n}}{\mathcal {D}}(x)f(x)g(x)=\mathbb {E} _{\mathcal {D}}[fg]}$

This inner product gives rise to a corresponding norm as follows:

${\displaystyle \|f\|_{\mathcal {D}}={\sqrt {\langle f,f\rangle _{\mathcal {D}}}}}$