Apply Transformations

Apply Transformations

Transformations allow us to find the distribution of a function of random variables. There are different methods of applying transformations.

The Method of Distribution Function

Given a random variable \(Y\) that is a function of a random variable \(X\), that is  \(Y=u(X)\), we can find the cumulative density function of \(Y\), that is \(G(y)\), directly and then differentiate this cumulative distribution function (CDF) to get the PDF of \(Y\), that is \(g(y)\):

$$ \begin{align*} G\left(y\right)&=P\left(Y\le y\right)=P[u\left(X\right)\le y] \\ g\left(y\right)&=G^\prime\left(y\right) \end{align*} $$

Example: The Method of Distribution Function

A random variable \(X\) has a uniform distribution over the interval \([-2,2]\), and another variable \(Y\) is defined as \(Y=X^2\).

Find the probability density function of \(Y\), \(f(y)\).

Solution

We first find the cumulative density function of \(Y\), that is \(G(y)\):

$$\begin{align}G(y)&=P(Y\leq y)\\ & =P(X^2\leq y)\\ &=P(X\leq \sqrt{y})\\ &=P(-\sqrt {y}\le X\le \sqrt {y}\\ &=\int_{-\sqrt y}^{\sqrt y}{f\left(x\right)dx=2*\int_{0}^{\sqrt y}{\frac{1}{4}dx=2*\frac{1}{4}\left[x\right]_0^{\sqrt y}}}\\ &=\frac{\sqrt y}{2}\end{align}$$

Thus,

$$g\left(y\right)=\frac{d}{dy}\left(\sqrt y\right)=\frac{1}{4\sqrt y}\ ,\ for-2\le y\le 2$$

The Method of Transformation 

In this method, we consider a variable \(X\), whose PDF, \(f(x)\), is given and another variable \(Y\), such that, \(Y=u(X) \) where \(u(x)\) is either an increasing or decreasing function of \(x\) that is \(u\left(x\right) > 0\).

We first find the inverse function of  \(u\left(x\right)\), that is \(x=u^{-1}\left(y\right)\).

We then evaluate:

$$\frac{du^{-1}}{dy}=\frac{d\left[u^{-1}\left(y\right)\right]}{dy}$$

We then finally find \(f(y)\), using the formula:

$$f_Y\left(y\right)=f_X\left[u^{-1}\left(y\right)\right]\left|\frac{du^{-1}}{dy}\right|$$

Example: Applying Transformation – Use of the Inverse Function

Let \(X\) be a random variable with a PDF:

$$f(x)=\begin{cases} x^2 +\frac{2}{3},&0 < x < 1\\ 0, & \text{otherwise}\end{cases}$$

Find the PDF of \(U=2x-3\).

Solution

Let \(z(X)=2x-3\).

If \(u=2x-3\); and making \(x\) the subject of the formula:

$$x=z^{-1}(u)=\frac{u+3}{2}$$

And thus,

$$\frac{{dz}^{-1}(u)}{du}=\frac{dx}{du}=\frac{1}{2}$$

Now,

$$\begin{align}f\left(u\right)&=f_X\left(z^{-1}\left(u\right)\right)\left|\frac{dx}{du}\right|\\&=\begin{cases} [(u+3/2)^2+2/3]|1/2|=1/2 (u+3/2)^2+1/3, &-3 < u < 1\\0, & \text{elsewhere}\end{cases} \end{align}$$

Change of Variable Technique

We can use the change-of-variable technique to  find the PDF of a transformed variable, \(Y\).

$$ g\left( y \right) =f\left[ \upsilon \left( y \right) \right] |{ \upsilon }^{ \prime }\left( y \right) | $$

where \(\upsilon \left( y \right)\) is the inverse function of \(y\).

Example: Change-of-variable Technique

Given the following probability density function of a continuous random variable:

$$ f\left( x \right) =\begin{cases} { x }^{ 2 }+\cfrac { 2 }{ 3, } & 0< x < 1 \\ 0, & \text{otherwise} \end{cases} $$

Let \(Y = X – 50\).

Find \(g(y)\).

Solution

\(v\left(y \right) = Y + 50\)

\(v^{\prime} \left(y \right) = 1\)

$$ g\left( y \right) =f\left[ \upsilon \left( y \right) \right] \left[ { \upsilon }^{ \prime }\left( y \right) \right] =\left[ { \left( Y+50 \right) }^{ 2 }+\frac { 2 }{ 3 } \right] \left[ 1 \right] ={ \left( Y+50 \right) }^{ 2 }+\frac { 2 }{ 3 } $$

The PDF of a discrete transformed random variable can be found in a similar manner, as shown in the formula below:

$$ g\left( y \right) =f\left[ \upsilon \left( y \right) \right] $$

Note: \(|{ \upsilon }^{ \prime }\left( y \right) |\) is not needed in this case.

Learning Outcome:

Topic 2g: Univariate Random Variables – Apply transformations.

Shop CFA® Exam Prep

Offered by AnalystPrep

Featured Shop FRM® Exam Prep Learn with Us

    Subscribe to our newsletter and keep up with the latest and greatest tips for success
    Shop Actuarial Exams Prep Shop Graduate Admission Exam Prep


    Daniel Glyn
    Daniel Glyn
    2021-03-24
    I have finished my FRM1 thanks to AnalystPrep. And now using AnalystPrep for my FRM2 preparation. Professor Forjan is brilliant. He gives such good explanations and analogies. And more than anything makes learning fun. A big thank you to Analystprep and Professor Forjan. 5 stars all the way!
    michael walshe
    michael walshe
    2021-03-18
    Professor James' videos are excellent for understanding the underlying theories behind financial engineering / financial analysis. The AnalystPrep videos were better than any of the others that I searched through on YouTube for providing a clear explanation of some concepts, such as Portfolio theory, CAPM, and Arbitrage Pricing theory. Watching these cleared up many of the unclarities I had in my head. Highly recommended.
    Nyka Smith
    Nyka Smith
    2021-02-18
    Every concept is very well explained by Nilay Arun. kudos to you man!
    Badr Moubile
    Badr Moubile
    2021-02-13
    Very helpfull!
    Agustin Olcese
    Agustin Olcese
    2021-01-27
    Excellent explantions, very clear!
    Jaak Jay
    Jaak Jay
    2021-01-14
    Awesome content, kudos to Prof.James Frojan
    sindhushree reddy
    sindhushree reddy
    2021-01-07
    Crisp and short ppt of Frm chapters and great explanation with examples.