Books Probability and Statistical Inference
Transformation of Two Random Variables
We have considered the transformation of a single random variable with PDF . In continuous case, if function is strictly increasing (or decreasing) and differentiable on the support , then the PDF of is given by
where is the inverse of and the support of is transformed from through .
We now consider the transformation of two random variables and of continuous type with joint PDF on support . Suppose that the system of functions
maps points in one-to-one and onto points in . Let random variables and be defined by and . Then the joint PDF of and is given by
where is the inverse of and
is the Jacobian determinant of with respect to .
Let and have the joint PDF
Let and . That is, and . The support is transformed to through .
Figure 5.3 shows as the upper triangle of the unit square (above the diagonal ) and as the full open unit square. Evidently, and are dependent. However, we will show that and are independent.
The inverse map is given by
Compute the Jacobian:
Thus, the joint PDF of and is given by
We then compute the marginal PDFs of and . For , we have
And for , we have
Note that
This means that and are independent.
With the techniques of transformation of two random variables, we will develop two important distributions in the following examples.
Let and have independent gamma distributions, and . Since and are independent, the joint PDF of and is the product of the two gamma PDFs:
Let
Under this transformation, the support , the first quadrant of the 2D plane, is transformed to
Geometrically, is an infinite vertical strip: the -coordinate is confined to an interval of length , while the -coordinate is unbounded above.
The inverse map is given by
Compute the Jacobian:
Applying the change-of-variable technique, the joint PDF of and is given by
We are interested in the marginal PDF of . Integrating over , we
Recall the formula for the gamma function:
Note that the integral almost matches the form a gamma function. We can make it match by applying a change of variable.
Plugging back into (5.6) yields
We say has a beta distributionbeta distribution with parameters and .
Formally, if a random variable has a PDF with the form
then we say has a beta distributionbeta distribution with parameters and .
We may also develop the beta distribution by considering the function of the form
where is a normalizing constant to ensure the integrates to so that may be a valid PDF. The beta functionbeta function is defined as
Thus, the beta PDF can also be written as
Figure 5.4 shows several beta PDFs for representative parameter pairs .
Read the picture loosely: the factor pulls probability toward the left endpoint when is small (the curve may spike there) and pushes it away from when is large, leaving room for a hump in the interior. The factor does the analogous job at .
When , the two sides balance, so the density is symmetric about , as with and ; raising both parameters together keeps that balance but concentrates more mass around the middle—a bell-like profile where middling proportions are typical.
When , the right endpoint wins the tug-of-war, so the hump slides toward (compare with ).
When both parameters are below , both endpoints win at once: the middle thins out and the mass sits near and near , giving a U-shaped curve that favors very small or very large values over middling ones.
When only one parameter is below , that side of the interval dominates on its own—for instance, hugs the right edge .
In the gamma-ratio story in Example 5.4, and came from the two underlying gamma shapes; qualitatively, whichever shape parameter is larger tilts toward the corresponding component.
Let and be two independent chi-squared random variables with and degrees of freedom, respectively. We are interested in the distribution of
To prevent the confusion of the random variable and the notation of CDF , we will use the letter to denote the random variable in the rest of this example. That is,
Recall the formula for the PDF of :
Because and are independent, their joint PDF is given by
We want to find the CDF of . We have
The event yields a region in the -plane, displayed in Figure 5.5, that we should integrate over to find the CDF.
Thus,
Differentiate with respect to :
Moving terms independent of out of the integral, we get
The rest of the work is to evaluate the integral . We note that the integrand of is similar to the form of a chi-squared PDF. Substituting into , we get
Plugging back into (5.8) yields
Suppose that . We say random variable has a -distribution-distribution with and degrees of freedom if its PDF is given by (5.9).
Graphs of the -distribution PDFs for representative parameter pairs are shown in Figure 5.6.
When , every PDF in Figure 5.6 decreases from , regardless of . We can prove this as an exercise.
Proof
When , the PDF is given by
Recall the property of the gamma function:
The formula for can be further simplified as
Clearly, is decreasing, and the maximum value of the PDF is .
Recall the construction of an random variable:
where and are independent chi-squared random variables with and degrees of freedom, respectively. Note that if we take the reciprocal of , we get
which also follows an -distribution but with and swapped, i.e. .
For a right-tail probability of , we write
Of course, for a left-tail probability of , we have
For the random variable , we have
On the other hand, Since ,
It then follows that
Next we introduce an important simulation tool, the Box-Muller transformationBox-Muller transformation, whose main role is to turn independent uniforms into independent standard normal random variables (Gaussian noise, in applications).
Let and be independent random variables, each uniformly distributed on . Define
Geometrically, , which ranges over , is the Euclidean radius of in the -plane, while and fix the direction. Note that the polar angle lies in . Intuitively, the open unit square—the support of —is mapped onto the whole -plane with the origin and the positive -axis removed. We have
and, whenever is neither nor ,
We now consider the inverse transformation. Clearly
To obtain a formula for , we must be careful with and quadrant ambiguities, so we treat the cases by quadrant. We have
The Jacobian is given by
Since the joint PDF of and is
the change-of-variables formula gives the joint PDF of and as
The same expression holds on with the half-line removed, where the polar-angle map is not differentiable; that set has Lebesgue measure zero, so it does not affect the distribution. Thus and are independent, and each is standard normal.
As noted earlier, inverse-transform sampling via Theorem 5.1 is awkward for standard normals because has no convenient closed form. The Box-Muller transformation avoids that obstacle. Let and be independent random variables and set
or
Then , as we showed above. Figure 5.7 gives a histogram of simulated draws of , which tracks the density closely.
A particularly useful application is finding the PDF of the sum of two independent random variables, a problem that arises constantly in practice. The answer turns out to be remarkably compact: it is simply the convolution of the two PDFs.
Let and be independent continuous random variables with PDFs and , respectively. Define . Then the PDF of is the convolution of and :
For the proof, we use the constructive approach: define alongside . This reframes the problem as a bivariate transformation , so the Jacobian method of this section applies directly.
Proof
Define . Consider the transformation from to :
Solving for in terms of , we get
The Jacobian is given by
Therefore, the joint PDF of is given by
Since and are independent, we have
Integrating out , we get
Solution
Since and are i.i.d., each has PDF
By Proposition 5.1, the PDF of is the convolution
Figure 5.8 illustrates the sliding-window picture for the two nontrivial overlap cases.
If , the supports of and do not overlap, so .
If , both factors equal precisely when , so
If , overlap occurs when , so
If , the supports again do not overlap, so .
Hence the PDF of is
Exercises
Let .
-
Show that the mean and variance of are given by
-
Show that when and , the mode of is given by
Proof
(a) We have
The trick is by comparing the integrand to the form of a beta PDF. We choose to compare to the PDF of :
We may compute similarly:
To obtain the variance, we compute:
(b) Taking the derivative of the beta PDF, we obtain
Since , we conlcude that is decreasing on .
Putting , we get
which yields
Note that since and . (The given conditions are really necessary here.) And because we have noticed that is decreasing on , we may conclude that is the one and only mode of .
Let and . Show that
where .
Proof
The general idea is to apply the integration by parts formula to the integral of the form
with goal of increasing and reducing .
We have
We note that the power of in the integrand is increased by , while the power of is decreased by . Applying the integration by parts formula again on gives:
Following this pattern, we obtain:
Multiplying both sides by
we get
Suppose that and where . Show that
Proof
Let and let
Show that .
The transformation above links an -distributed random variable to a beta distributed one in a particularly simple way.
The proof is a direct application of the change-of-variable technique for a single variable.
Proof
The transformation function is given by . We may find its inverse:
Taking the derivative, we get
Therefore, the PDF of is given by
In summary, we have
This is exactly the PDF of a .