StatlectThe Digital Textbook
Index > Additional topics in probability theory

Functions of random variables and their distribution

Let X be a random variable with known distribution. Let another random variable Y be a function of X:[eq1]where [eq2]. How do we derive the distribution of Y from the distribution of X?

There is no general answer to this question. However, there are several special cases in which it is easy to derive the distribution of Y. We discuss these cases below.

Strictly increasing functions

When the function $g$ is strictly increasing on the support of X (i.e. [eq3]), then $g$ admits an inverse defined on the support of Y, i.e. a function [eq4] such that:[eq5]Furthermore [eq6] is itself strictly increasing.

The distribution function of a strictly increasing function of a random variable can be computed as follows:

Proposition (distribution of an increasing function) Let X be a random variable with support R_X and distribution function [eq7]. Let [eq2] be strictly increasing on the support of X. Then, the support of [eq9] is:[eq10]and the distribution function of Y is:[eq11]

Proof

Of course, the support $R_{Y}$ is determined by g(x) and by all the values X can take. The distribution function of Y can be derived as follows:

  1. if $y$ is lower than than the lowest value Y can take on, then [eq12], so:[eq13]

  2. if $y$ belongs to the support of Y, then [eq14] can be derived as follows: [eq15]

  3. if $y$ is higher than than the highest value Y can take on, then [eq16], so:[eq17]

Therefore, in the case of an increasing function, knowledge of $g^{-1}$ and of the upper and lower bounds of the support of Y is all we need to derive the distribution function of Y from the distribution function of X.

Example Let X be a random variable with support [eq18] and distribution function:[eq19]Let[eq20]The function [eq21] is strictly increasing and it admits an inverse on the support of X:[eq22]The support of Y is [eq23]. The distribution function of Y is:[eq24]

In the cases in which X is either discrete or absolutely continuous there are specialized formulae for the probability mass and probability density functions, which are reported below.

Strictly increasing functions of a discrete random variable

When X is a discrete random variable, the probability mass function of [eq25] can be computed as follows:

Proposition (probability mass of an increasing function) Let X be a discrete random variable with support R_X and probability mass function [eq26]. Let [eq2] be strictly increasing on the support of X. Then, the support of [eq9] is:[eq10]and its probability mass function is:[eq30]

Proof

This proposition is a trivial consequence of the fact that a strictly increasing function is invertible:[eq31]

Example Let X be a discrete random variable with support [eq32] and probability mass function [eq33]Let [eq34]The support of Y is:[eq35]The function $g$ is strictly increasing and its inverse is:[eq36]The probability mass function of Y is:[eq37]

Strictly increasing functions of an absolutely continuous random variable

When X is an absolutely continuous random variable and $g$ is differentiable, then also Y is absolutely continuous and its probability density function can be easily computed as follows:

Proposition (density of an increasing function) Let X be an absolutely continuous random variable with support R_X and probability density function [eq38]. Let [eq2] be strictly increasing and differentiable on the support of X. Then, the support of [eq40] is:[eq10]and its probability density function is:[eq42]

Proof

This proposition is a trivial consequence of the fact that the density function is the first derivative of the distribution function: it can be obtained by differentiating the expression for the distribution function [eq43] found above.

Example Let X be an absolutely continuous random variable with support[eq44]and probability density function:[eq45]Let [eq46]The support of Y is:[eq47]The function $g$ is strictly increasing and its inverse is[eq48]with derivative[eq49]The probability density function of Y is:[eq50]

Strictly decreasing functions

When the function $g$ is strictly decreasing on the support of X (i.e. [eq51]), then $g$ admits an inverse defined on the support of Y, i.e. a function [eq4] such that:[eq5]Furthermore [eq6] is itself strictly decreasing.

The distribution function of a strictly decreasing function of a random variable can be computed as follows:

Proposition (distribution of a decreasing function) Let X be a random variable with support R_X and distribution function [eq55]. Let [eq2] be strictly decreasing on the support of X. Then, the support of [eq9] is:[eq10]and the distribution function of Y is:[eq59]

Proof

Of course, the support $R_{Y}$ is determined by g(x) and by all the values X can take. The distribution function of $y$ can be derived as follows:

  1. if $y$ is lower than than the lowest value Y can take on, then [eq60], so:[eq13]

  2. if $y$ belongs to the support of Y, then [eq14] can be derived as follows: [eq63]

  3. if $y$ is higher than than the highest value Y can take on, then [eq16], so:[eq65]

Therefore, also in the case of a decreasing function, knowledge of $g^{-1}$ and of the upper and lower bounds of the support of Y is all we need to derive the distribution function of Y from the distribution function of X.

Example Let X be a random variable with support [eq18] and distribution function:[eq19]Let[eq68]The function [eq69] is strictly decreasing and it admits an inverse on the support of X:[eq70]The support of Y is [eq71]. The distribution function of Y is:[eq72]where [eq73] equals 1 when $y=-1$ and 0 otherwise (because [eq74] is always zero except when $y=-1$ and [eq75]).

We report below the formulae for the special cases in which X is either discrete or absolutely continuous.

Strictly decreasing functions of a discrete random variable

When X is a discrete random variable, the probability mass function of [eq76] can be computed as follows:

Proposition (probability mass of a decreasing function) Let X be a discrete random variable with support R_X and probability mass function [eq77]. Let [eq2] be strictly decreasing on the support of X. Then, the support of [eq9] is:[eq10]and its probability mass function is:[eq30]

Proof

The proof of this proposition is identical to the proof of the proposition for strictly increasing functions. In fact, the only property that matters is that a strictly decreasing function is invertible:[eq31]

Example Let X be a discrete random variable with support [eq32]and probability mass function [eq84]Let [eq85]The support of Y is:[eq86]The function $g$ is strictly decreasing and its inverse is:[eq87]The probability mass function of Y is:[eq88]

Strictly decreasing functions of an absolutely continuous random variable

When X is an absolutely continuous random variable and $g$ is differentiable, then also Y is absolutely continuous and its probability density function is derived as follows:

Proposition (density of a decreasing function) Let X be an absolutely continuous random variable with support R_X and probability density function [eq89]. Let [eq2] be strictly decreasing and differentiable on the support of X. Then, the support of [eq40] is:[eq10]and its probability density function is:[eq93]

Proof

This proposition is easily derived: 1) remembering that the probability that an absolutely continuous random variable takes on any specific value is 0 and, as a consequence, [eq94] for any $y$; 2) using the fact that the density function is the first derivative of the distribution function; 3) differentiating the expression for the distribution function [eq43] found above.

Example Let X be a uniform random variable on the interval $left[ 0,1
ight] $, i.e. an absolutely continuous random variable with support[eq96]and probability density function:[eq97]Let [eq98]where [eq99] is a constant. The support of Y is:[eq100]where we can safely ignore the fact that [eq101], because [eq102] is a zero-probability event (see Absolutely continuous random variables and zero-probability events). The function $g$ is strictly decreasing and its inverse is[eq103]with derivative[eq104]The probability density function of Y is:[eq105]Therefore, Y has an exponential distribution with parameter $lambda $ (see the lecture entitled Exponential distribution).

Invertible functions

In the case in which the function g(x) is neither strictly increasing nor strictly decreasing, the formulae given in the previous sections for discrete and absolutely continuous random variables are still applicable, provided g(x) is one-to-one and hence invertible. We report these formulae below.

One-to-one functions of a discrete random variable

When X is a discrete random variable the probability mass function of [eq106] is given by the following:

Proposition (probability mass of a one-to-one function) Let X be a discrete random variable with support R_X and probability mass function [eq107]. Let [eq2] be one-to-one on the support of X. Then, the support of [eq109] is:[eq10]and its probability mass function is:[eq30]

Proof

The proof of this proposition is identical to the proof of the propositions for strictly increasing and strictly decreasing functions found above:[eq112]

One-to-one functions of an absolutely continuous random variable

When X is an absolutely continuous random variable and $g$ is differentiable, then also Y is absolutely continuous and its probability density function is given by the following:

Proposition (density of a one-to-one function) Let X be an absolutely continuous random variable with support R_X and probability density function [eq113]. Let [eq2] be one-to-one and differentiable on the support of X. Then, the support of [eq40] is:[eq10]If[eq117]then the probability density function of Y is:[eq118]

Proof

For a proof of this proposition see: Poirier, D. J. (1995) Intermediate statistics and econometrics: a comparative approach, MIT Press.

Solved exercises

Below you can find some exercises with explained solutions:

  1. Exercise set 1 (derive the distribution of a function of a random variable).

The book

Most learning materials found on this website are now available in a traditional textbook format.