# Transformations

Transformations Dear students, Since we have covered the mgf technique extensively already, here we only review the cdf and the pdf techniques, first for univariate (one-to-one and more-to-one) and then for bivariate (one-to-one and more-to-one) transformations.

1. The cumulative distribution function (cdf) technique Suppose Y is a continuous random variable with cumulative distribution function (cdf) 𝐹𝑌 (𝑦) ≡ 𝑃(𝑌 ≤ 𝑦). Let 𝑈 = 𝑔(𝑌) be a function of Y, and our goal is to find the distribution of U. The cdf technique is especially convenient when the cdf 𝐹𝑌 (𝑦) has closed form analytical expression. This method can be used for both univariate and bivariate transformations.

Steps of the cdf technique: 1. Identify the domain of Y and U. 2. Write𝐹𝑈 (𝑢) = 𝑃(𝑈 ≤ 𝑢), the cdf of U, in terms of 𝐹𝑌 (𝑦), the cdf of Y . 3. Differentiate 𝐹𝑈 (𝑢) to obtain the pdf of U, 𝑓𝑈 (𝑢). Example 1. Suppose that 𝑌 ~ 𝑈(0,1). Find the distribution of 𝑈 = 𝑔(𝑌) = − ln 𝑌. Solution. The cdf of 𝑌 ~ 𝑈(0,1) is given by 0, 𝑦≤0 𝐹𝑌 (𝑦) = {𝑦, 0 < 𝑦 ≤ 1 1, 𝑦≥1 The domain (*domain is the region where the pdf is non-zero) for 𝑌 ~ 𝑈(0,1) is 𝑅𝑌 = {𝑦: 0 < 𝑦 < 1}; thus, because 𝑢 = − ln 𝑦 > 0, it follows that the domain for U is 𝑅𝑈 = {𝑢: 𝑢 > 0}. The cdf of U is: 𝐹𝑈 (𝑢) = 𝑃(𝑈 ≤ 𝑢) = 𝑃(− ln 𝑌 ≤ 𝑢) = 𝑃(ln 𝑌 > −𝑢) = 𝑃(𝑌 > 𝑒 −𝑢 ) = 1 − 𝑃(𝑌 ≤ 𝑒 −𝑢 ) = 1 − 𝐹𝑌 (𝑒 −𝑢 )

1

Because 𝐹𝑌 (𝑦) = 𝑦 for 0 < y < 1; i.e., for u > 0, we have 𝐹𝑈 (𝑢) = 1 − 𝐹𝑌 (𝑒 −𝑢 ) = 1 − 𝑒 −𝑢 Taking derivatives, we get, for u > 0, 𝑓𝑈 (𝑢) =

𝑑 𝑑 (1 − 𝑒 −𝑢 ) = 𝑒 −𝑢 𝐹𝑈 (𝑢) = 𝑑𝑢 𝑑𝑢

Summarizing, 𝑓𝑈 (𝑢) = {

𝑒 −𝑢 , 0,

𝑢>0 otherwise 1

This is an exponential pdf with mean λ = 1; that is, U ~ exponential(λ = 1). □ Example 2. Suppose that 𝑌 ~ 𝑈 (− 𝜋⁄2 , 𝜋⁄2) . Find the distribution of the random variable defined by U = g(Y ) = tan(Y ). Solution. The cdf of 𝑌 ~ 𝑈 (− 𝜋⁄2 , 𝜋⁄2) is given by 0, 𝑦 + 𝜋⁄2 𝐹𝑌 (𝑦) = , 𝜋 { 1,

𝑦 ≤ − 𝜋⁄2 − 𝜋⁄2 < 𝑦 ≤ 𝜋⁄2 𝑦 ≥ 𝜋⁄2

The domain for Y is 𝑅𝑌 = {𝑦: − 𝜋⁄2 < 𝑦 < 𝜋⁄2}. Sketching a graph of the tangent function from − 𝜋⁄2 to 𝜋⁄2, we see that −∞ < 𝑢 < ∞ . Thus, 𝑅𝑈 = { 𝑢: − ∞ < 𝑢 < ∞} ≡ 𝑅, the set of all reals. The cdf of U is: 𝐹𝑈 (𝑢) = 𝑃(𝑈 ≤ 𝑢) = 𝑃[tan(𝑌) ≤ 𝑢] = 𝑃[𝑌 ≤ tan−1(𝑢)] = 𝐹𝑌 [tan−1(𝑢)] Because 𝐹𝑌 (𝑦) = we have

𝑦+𝜋⁄2 𝜋

for − 𝜋⁄2 < 𝑦 < 𝜋⁄2 ; i. e. , for 𝑢 ∈ ℛ ,

𝐹𝑈 (𝑢) = 𝐹𝑌 [tan−1 (𝑢)] =

tan−1(𝑢) + 𝜋⁄2 𝜋

The pdf of U, for 𝑢 ∈ ℛ, is given by 𝑑 𝑑 tan−1 (𝑢) + 𝜋⁄2 1 𝑓𝑈 (𝑢) = 𝐹𝑈 (𝑢) = [ ]= . 𝑑𝑢 𝑑𝑢 𝜋 𝜋(1 + 𝑢2 ) Summarizing,

2

1 , −∞0 𝑓𝑌 (𝑦) = { 𝛽 0, otherwise. Let 𝑈 = 𝑔(𝑌) = √𝑌, . Use the method of transformations to find the pdf of U. Solution. First, we note that the transformation 𝑔(𝑌) = √𝑌 is a continuous strictly increasing function of y over 𝑅𝑌 = {𝑦: 𝑦 > 0}, and, thus, 𝑔(𝑌) is one-to-one. Next, we need to find the domain of U. This is easy since y > 0 implies 𝑢 = √𝑦 > 0 as well. Thus, 𝑅𝑈 = {𝑢: 𝑢 > 0}. Now, we find the inverse transformation: 𝑔(𝑦) = 𝑢 = √𝑦 ⇔ 𝑦 = 𝑔−1 (𝑢) = 𝑢2 (by inverse transformation) and its derivative:

4

𝑑 −1 𝑑 (𝑢2 ) = 2𝑢. 𝑔 (𝑢) = 𝑑𝑢 𝑑𝑢 Thus, for u > 0, 𝑓𝑈 (𝑢) = 𝑓𝑌 [𝑔−1 (𝑢)] |

𝑑 −1 𝑔 (𝑢) | 𝑑𝑢 2

2

1 −𝑢 2𝑢 −𝑢𝛽 = 𝑒 𝛽 × |2𝑢| = 𝑒 . 𝛽 𝛽 Summarizing, 2

2𝑢 −𝑢𝛽 𝑢>0 𝑓𝑈 (𝑢) = { 𝛽 𝑒 , 0, otherwise. This is a Weibull distribution. The Weibull family of distributions is common in life science (survival analysis), engineering and actuarial science applications. □ Example 4. Suppose that Y ~ beta(α = 6; β = 2); i.e., the pdf of Y is given by 42𝑦 5 (1 − 𝑦), 𝑓𝑌 (𝑦) = { 0,

0 0 for all i ≠ 0, and 𝑓𝑌1 ,𝑌2 (𝑦1 , 𝑦2 ) is continuous on each Ai , i ≠ 0. Furthermore, suppose that the transformation is 1-to-1 from Ai (i = 1, 2, …, k,) to B, where B is the domain of 𝑼 = (𝑈1 = −1 −1 (∙), 𝑔2𝑖 (∙)) is a 1-to-1 𝑔1 (𝑌1 , 𝑌2 ), 𝑈2 = 𝑔1 (𝑌1 , 𝑌2 )) such that (𝑔1𝑖 inverse mapping of Y to U from B to Ai. Let Ji denotes the Jacobina computed from the ith inverse, i = 1, 2, …, k. Then, the pdf of U is given by 𝑓𝑈1 ,𝑈2 (𝑢1 , 𝑢2 ) 𝑘

={

∑ 𝑓𝑌1 ,𝑌2 [𝑔1𝑖 −1 (𝑢, 𝑣), 𝑔2𝑖 −1 (𝑢, 𝑣)]|𝐽𝑖 | ,

𝑢 ∈ 𝐵 = 𝑅𝑈

𝑖=1

0,

otherwise.

Example 7. Suppose that 𝑌1 ~ N(0, 1), 𝑌2 ~ N(0, 1), and that 𝑌1 and 𝑌2 are independent. Define the transformation 𝑌1 𝑈1 = 𝑔1 (𝑌1 , 𝑌2 ) = 𝑌2 𝑈2 = 𝑔2 (𝑌1 , 𝑌2 ) = |𝑌2 |. Find each of the following distributions: 12

(a) 𝑓𝑈1 ,𝑈2 (𝑢1 , 𝑢2 ), the joint distribution of 𝑈1 and 𝑈2 , (b) 𝑓𝑈1 (𝑢1 ), the marginal distribution of 𝑈1 . Solutions. (a) Since 𝑌1 and 𝑌2 are independent, the joint distribution of 𝑌1 and 𝑌2 is 𝑓𝑌1 ,𝑌2 (𝑦1 , 𝑦2 ) = 𝑓𝑌1 (𝑦1 )𝑓𝑌2 (𝑦2 ) 1 −𝑦 2/2 −𝑦2 /2 = 𝑒 1 𝑒 2 2π Here, 𝑅𝑌1 ,𝑌2 = {(𝑦1 , 𝑦2 ): −∞ < 𝑦1 < ∞, −∞ < 𝑦2 < ∞}. The transformation of Y to U is not one-to-one because the points (𝑦1 , 𝑦2 ) and (−𝑦1 , −𝑦2 ) are both mapped to the same (𝑢1 , 𝑢2 ) point. But if we restrict considerations to either positive or negative values of 𝑦2 , then the transformation is one-to-one. We note that the three sets below form a partition of 𝐴 = 𝑅𝑌1 ,𝑌2 as defined above with 𝐴1 = {(𝑦1 , 𝑦2 ): 𝑦2 > 0}, 𝐴2 = {(𝑦1 , 𝑦2 ): 𝑦2 < 0} , and 𝐴0 = {(𝑦1 , 𝑦2 ): 𝑦2 = 0}. The domain of U, 𝐵 = {(𝑢1 , 𝑢2 ): −∞ < 𝑢1 < ∞, 𝑢2 > 0} is the image of both 𝐴1 and 𝐴2 under the transformation. The inverse transformation from 𝐵 𝑡𝑜 𝐴1 and 𝐵 𝑡𝑜 𝐴2 are given by: 𝑦1 = 𝑔11 −1 (𝑢1 , 𝑢2 ) = 𝑢1 𝑢2 𝑦2 = 𝑔21 −1 (𝑢1 , 𝑢2 ) = 𝑢2 and 𝑦1 = 𝑔12 −1 (𝑢1 , 𝑢2 ) = −𝑢1 𝑢2 𝑦2 = 𝑔22 −1 (𝑢1 , 𝑢2 ) = −𝑢2 The Jacobians from the two inverses are 𝐽1 = 𝐽1 = 𝑢2 The pdf of U on its domain B is thus: 2

𝑓𝑈1 ,𝑈2 (𝑢1 , 𝑢2 ) = ∑ 𝑓𝑌1 ,𝑌2 [𝑔1𝑖 −1 (𝑢, 𝑣), 𝑔2𝑖 −1 (𝑢, 𝑣)]|𝐽𝑖 | Plugging in, we have:

𝑖=1

1 −(𝑢 𝑢 )2 /2 −𝑢2 /2 𝑒 1 2 𝑒 2 |𝑢2 | 2π 1 −(−𝑢 𝑢 )2 /2 −(−𝑢 )2 /2 1 2 2 |𝑢2 | + 𝑒 𝑒 2π

𝑓𝑈1 ,𝑈2 (𝑢1 , 𝑢2 ) =

Simplifying, we have: 𝑢2 2 2 𝑓𝑈1 ,𝑈2 (𝑢1 , 𝑢2 ) = 𝑒 −(𝑢1 +1)𝑢2 /2 , −∞ < 𝑢1 < ∞, 𝑢2 > 0 π (b) To obtain the marginal distribution of 𝑈1 , we integrate the joint pdf𝑓𝑈1 ,𝑈2 (𝑢1 , 𝑢2 ) over 𝑢2 . That is, ∞

𝑓𝑈1 (𝑢1 ) = ∫ 𝑓𝑈1 ,𝑈2 (𝑢1 , 𝑢2 ) 𝑑𝑢2 0

13

1 , −∞ < 𝑢1 < ∞ + 1) Thus, marginally, U1 follows the standard Cauchy distribution. □ =

𝜋(𝑢12

REMARK: The transformation method can also be extended to handle n-variate transformations. Suppose that 𝑌1 , 𝑌2 , … , 𝑌𝑛 are continuous random variables with joint pdf 𝑓𝒀 (𝑦) and define 𝑈1 = 𝑔1 (𝑌1 , 𝑌2 , … , 𝑌𝑛 ) 𝑈2 = 𝑔2 (𝑌1 , 𝑌2 , … , 𝑌𝑛 ) ⋮ (𝑌 𝑈𝑛 = 𝑔𝑛 1 , 𝑌2 , … , 𝑌𝑛 ). Example 8. Given independent random variables 𝑋 and𝑌, each with uniform distributions on (0, 1), find the joint pdf of U and V defined by U=X+Y, V=X-Y, and the marginal pdf of U. The joint pdf of 𝑋 and 𝑌 is𝑓𝑋,𝑌 (𝑥, 𝑦) = 1, 0 ≤ 𝑥 ≤ 1, 0 ≤ 𝑦 ≤ 1. The inverse transformation, written in terms of observed values is 𝑢+𝑣 𝑢−𝑣 𝑥= , 𝑎𝑛𝑑 𝑦 = . 2 2 It is clearly one-to-one. The Jacobian is 1/2 1/2 𝜕(𝑥,𝑦) 1 1 𝐽 = 𝜕(𝑢,𝑣) = | | = − 2, so |𝐽| = 2. 1/2 −1/2 We will use 𝒜 to denote the range space of (𝑋, 𝑌), and ℬ to denote that of (𝑈, 𝑉), and these are shown in the diagrams below. Firstly, note that there are 4 inequalities specifying ranges of 𝑥 and𝑦, and these give 4 inequalities concerning 𝑢 and𝑣, from which ℬcan be determined. That is, 𝑥 ≥ 0 ⇒ 𝑢 + 𝑣 ≥ 0, that is, 𝑣 ≥ −𝑢 𝑥 ≤ 1 ⇒ 𝑢 + 𝑣 ≤ 2, that is 𝑣 ≤ 2 − 𝑢 𝑦 ≥ 0 ⇒ 𝑢 − 𝑣 ≥ 0, that is 𝑣 ≤ 𝑢 𝑦 ≤ 1 ⇒ 𝑢 − 𝑣 ≤ 2, that is 𝑣 ≥ 𝑢 − 2 Drawing the four lines 𝑣 = −𝑢, 𝑣 = 2 − 𝑢, 𝑣 = 𝑢, 𝑣 = 𝑢 − 2 On the graph, enables us to see the region specified by the 4 inequalities.

14

Now, we have 1 1 −𝑢 ≤ 𝑣 ≤ 𝑢, 0 ≤ 𝑢 ≤ 1 = , { 𝑢 − 2 ≤ 𝑣 ≤ 2 − 𝑢, 1 ≤ 𝑢 ≤ 2 2 2 The importance of having the range space correct is seen when we find marginal pdf of 𝑈. ∞ 𝑓𝑈 (𝑢) = ∫−∞ 𝑓𝑈,𝑉 (𝑢, 𝑣)𝑑𝑣 𝑓𝑈,𝑉 (𝑢, 𝑣) = 1 ∗

𝑢 1

∫−𝑢 2 𝑑𝑣, = { ∫2−𝑢 1 𝑑𝑣, 𝑢−2 2 0, ={

0≤𝑢≤1 1≤𝑢≤2 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

𝑢, 0≤𝑢≤1 2 − 𝑢, 1 ≤ 𝑢 ≤ 2

= 𝑢𝐼[0,1] (𝑢) + (2 − 𝑢)𝐼(1,2] (𝑢), using indicator functions. Example 9. Given 𝑋and 𝑌 are independent random variables 1

𝑥

each with pdf𝑓𝑋 (𝑥) = 2 𝑒 −2 , 𝑥 ∈ [0, ∞), find the distribution of(𝑋 − 𝑌)/2. We note that the joint pdf of 𝑋 and 𝑌 is 1 𝑥+𝑦 𝑓𝑋,𝑌 (𝑥, 𝑦) = 𝑒 2 , 0 ≤ 𝑥 < ∞, 0 ≤ 𝑦 < ∞. 4 15

Define𝑈 = (𝑋 − 𝑌)/2. Now we need to introduce a second random variable 𝑉 which is a function of 𝑋 and𝑌. We wish to do this in such a way that the resulting bivariate transformation is one-to-one and our actual task of finding the pdf of U is as easy as possible. Our choice for 𝑉 is of course, not unique. Let us define𝑉 = 𝑌. Then the transformation is, (using𝑢, 𝑣, 𝑥, 𝑦, since we are really dealing with the range spaces here). 𝑥 = 2𝑢 + 𝑣 𝑦=𝑣 From it, we find the Jacobian, 2 1 𝐽=| |=2 0 1 To determineℬ, the range space of 𝑈 and𝑉, we note that 𝑥 ≥ 0 ⇒ 2𝑢 + 𝑣 ≥ 0 , that is 𝑣 ≥ −2𝑢 𝑥 < ∞ ⇒ 2𝑢 + 𝑣 < ∞ 𝑦≥0 ⇒ 𝑣≥0 𝑦