Distribution of a function or a sum

Section of Functions of random variables and limit theorems, part of Probability

Distribution of a function or a sum

Type Section
Taught in Functions of random variables and limit theorems
Part Probability

Let X be continuous with density f_X, and let Y=g(X) with g strictly monotone and differentiable. Then

f_Y(y)=f_X\bigl(g^{-1}(y)\bigr)\,\bigl|\tfrac{d}{dy}g^{-1}(y)\bigr|.

An affine map Y=aX+b with a\ne 0 is the case everyone uses: f_Y(y)=f_X((y-b)/a)/|a|. If X is standard normal and Y=1+2X, then Y\sim\operatorname{N}(1,4). If X\sim\operatorname{Exp}(\lambda) and Y=1+2X, the same formula shifts and stretches the exponential density.

The square of a standard normal variable is chi-squared with one degree of freedom, which is the gamma law with shape 1/2 and rate 1/2. The distribution function of Y=X^2 is \mathbb{P}(-\sqrt{y}\le X\le\sqrt{y}) for y>0, and differentiating produces the density.

Example 1 (The square of a standard normal) Let X\sim\operatorname{N}(0,1) and Y=X^2.

Question. Find the density of Y.

Solution. The map x\mapsto x^2 is not monotone, so work with the distribution function. For y>0,

F_Y(y)=\mathbb{P}(-\sqrt y\le X\le\sqrt y)=\Phi(\sqrt y)-\Phi(-\sqrt y)=2\Phi(\sqrt y)-1.

Differentiating, with \Phi'=\varphi the standard normal density,

f_Y(y)=2\varphi(\sqrt y)\cdot\frac1{2\sqrt y}=\frac{1}{\sqrt{2\pi}}\,y^{-1/2}e^{-y/2},\qquad y>0.

That is the \operatorname{Gamma}(1/2,1/2) density, the chi-squared law with one degree of freedom, since \Gamma(1/2)=\sqrt\pi.

For a maximum or a minimum the distribution function is easier than the density. If X_1,\ldots,X_n are independent with distribution function F and survival function 1-F, then

\mathbb{P}(\max_i X_i\le x)=F(x)^n, \qquad \mathbb{P}(\min_i X_i>x)=(1-F(x))^n.

The density follows by differentiation. This is why the minimum of n independent exponential variables with rate \lambda is exponential with rate n\lambda.

Example 2 (A series of exponential components) A system has five components in series, so it fails as soon as one component fails. The components’ lifetimes are independent and exponential with mean 1000 hours.

Question. Find the distribution and the mean of the system lifetime.

Solution. The system lifetime is T=\min_iX_i. Each X_i has survival function e^{-x/1000}, so

\mathbb{P}(T>t)=\bigl(e^{-t/1000}\bigr)^5=e^{-t/200}.

T is exponential with rate 5/1000, and its mean is 200 hours. Five components in series fail five times as fast as one. The maximum, which is the lifetime of the same five components in parallel, has distribution function (1-e^{-t/1000})^5 and is not exponential.

The sum of two independent continuous variables has density equal to the convolution

f_{X+Y}(z)=\int_{-\infty}^{\infty} f_X(x)\,f_Y(z-x)\,\,\mathrm{d} x.

Two independent uniform variables on [0,1] have a triangular sum: the density of the sum is z on (0,1) and 2-z on (1,2). The moment generating function is usually faster when the sum stays in a named family. Independent gamma variables with the same rate were added that way in Joint distributions.

Example 3 (The sum of two uniforms) Let X and Y be independent and uniform on [0,1], and Z=X+Y.

Question. Find the density of Z.

Solution. By the convolution formula, f_Z(z)=\int f_X(x)f_Y(z-x)\,\mathrm{d} x. The integrand is 1 when both 0\le x\le1 and 0\le z-x\le1, that is when \max(0,z-1)\le x\le\min(1,z), and 0 otherwise. The length of that interval is z for 0\le z\le1 and 2-z for 1\le z\le2, so

f_Z(z)=\begin{cases}z,&0\le z\le1,\\ 2-z,&1\le z\le2.\end{cases}

The sum of two flat densities is a triangle. Adding more uniforms rounds the shape off further, towards the normal curve of the central limit theorem below.

Used in

See also

Convolution · Transformation rule · Multivariate normal distribution · Affine images of normal vectors · Normal linear model · Law of large numbers · Central limit theorem · Jointly normal variables

Glossary and index