Mathematical Statistics

Method of Transformations and Moment-Generating Functions

Samir Orujov, PhD

ADA University, School of Business

Information Communication Technologies Agency, Statistics Unit

2026-02-22

๐ŸŽฏ Learning Objectives

By the end of this lecture, you will be able to:

  • Apply the method of transformations (change of variables) to find pdfs of transformed random variables

  • Use the Jacobian for the univariate transformation formula

  • Apply the moment-generating function method to identify distributions of sums

  • Recognize when the MGF method is more efficient than direct integration

  • Apply these techniques to derive distributions of portfolio returns and risk measures

๐Ÿ“ฑ Attendance Check-in

๐Ÿ“‹ Overview

๐Ÿ“š Topics Covered Today

  • Method of Transformations โ€“ Direct formula for monotonic functions

  • The Jacobian in 1D โ€“ Why \(|dy/du|\) appears in the formula

  • MGF Method โ€“ Using moment-generating functions to identify distributions

  • Sums of Random Variables โ€“ Convolutions and the MGF approach

  • Case Study โ€“ Distribution of portfolio returns using MGF

๐Ÿ“– Why Faster Transformation Methods?

๐ŸŽฏ Motivation

The distribution function method from last lecture works but can be tedious. In finance, we need efficient tools:

Direct Formula Needed For:

  • Modeling stock prices as exponentials of normal returns (log-normal)
  • Simulating asset paths from uniform random numbers
  • Pricing derivatives requiring PDF transformations
  • Converting between return types (simple vs log)

MGF Method Needed For:

  • Finding portfolio return distributions (sums of asset returns)
  • Proving normality of diversified portfolios
  • Insurance claim aggregation (sum of exponentials)
  • Testing portfolio variance with chi-square distributions

๐Ÿ“– Recall: Distribution Function Method

๐Ÿ”— From Last Lecture

The distribution function method works for any transformation:

  1. Find \(F_U(u) = P(U \leq u) = P(g(Y) \leq u)\)
  2. Express in terms of \(Y\)
  3. Differentiate to get \(f_U(u)\)

Limitation: Can be tedious when the function is monotonic and differentiable.

Todayโ€™s Question: Can we get a direct formula for \(f_U(u)\) without going through the CDF?

Answer: Yes! The method of transformations provides exactly this shortcut.

๐Ÿ“– Definition: Method of Transformations

๐Ÿ“ Theorem 6.2: Univariate Transformation

Let \(Y\) be a continuous random variable with pdf \(f_Y(y)\) on support \((a, b)\).

Let \(U = g(Y)\) where \(g\) is strictly monotonic and differentiable.

Let \(h = g^{-1}\) be the inverse function, so \(Y = h(U)\).

Then the pdf of \(U\) is:

\[f_U(u) = f_Y(h(u)) \cdot \left| \frac{dh}{du} \right| = f_Y(h(u)) \cdot |h'(u)|\]

for \(u\) in the range of \(g\).

The term \(|h'(u)| = |dy/du|\) is called the Jacobian of the transformation.

๐Ÿงฎ Why Does the Jacobian Appear?

Intuition: Stretching and Compressing

Consider a small interval \([y, y + dy]\) that maps to \([u, u + du]\).

Probability is conserved: \[f_Y(y) \, dy = f_U(u) \, du\]

Solving for \(f_U(u)\): \[f_U(u) = f_Y(y) \cdot \frac{dy}{du} = f_Y(h(u)) \cdot |h'(u)|\]

The absolute value ensures the density is positive!

If \(g\) is increasing: \(h'(u) > 0\)

  • Orientation preserved
  • \(|h'(u)| = h'(u)\)

If \(g\) is decreasing: \(h'(u) < 0\)

  • Orientation reversed
  • \(|h'(u)| = -h'(u)\)

๐Ÿ“Œ Example 1: Simulating Default Times

Problem: A bank models time-to-default of a loan as \(Y \sim \text{Exponential}(\beta)\). To simulate defaults using uniform random numbers, define \(U = 1 - e^{-Y/\beta}\). Find the distribution of \(U\).

Solution:

Step 1: Identify \(g(y) = 1 - e^{-y/\beta}\). This is strictly increasing on \(y > 0\).

Step 2: Find the inverse. From \(u = 1 - e^{-y/\beta}\):

\[e^{-y/\beta} = 1 - u \implies y = -\beta \ln(1-u) = h(u)\]

Step 3: Compute the Jacobian: \[h'(u) = \frac{d}{du}[-\beta \ln(1-u)] = \frac{\beta}{1-u}\]

Step 4: Apply the formula. Since \(f_Y(y) = \frac{1}{\beta}e^{-y/\beta}\): \[f_U(u) = \frac{1}{\beta}e^{-h(u)/\beta} \cdot \frac{\beta}{1-u} = \frac{1}{\beta}(1-u) \cdot \frac{\beta}{1-u} = 1 \; \text{for} \; 0 < u < 1 \rightarrow \text{Uniform}(0,1)!\]

Finance Application: Any exponential default time can be simulated from Uniform(0,1) โ€“ the basis of Monte Carlo credit risk models.

๐Ÿงฎ Theorem: Probability Integral Transform

Theorem 6.3: Probability Integral Transform

Let \(Y\) be a continuous random variable with CDF \(F_Y(y)\).

Part 1: If \(U = F_Y(Y)\), then \(U \sim \text{Uniform}(0, 1)\).

Part 2: Conversely, if \(U \sim \text{Uniform}(0, 1)\), then \(Y = F_Y^{-1}(U)\) has CDF \(F_Y\).

Why This Matters:

  • Simulation: Generate any distribution from uniform random numbers!
  • Goodness-of-fit: Transform data to uniform for testing
  • Copulas: Model dependence using uniform marginals

Finance Application: Generate correlated asset returns by transforming correlated uniforms.

๐Ÿ“Œ Example 2: Log-Normal Distribution

Problem: If \(Y \sim N(\mu, \sigma^2)\), find the distribution of \(U = e^Y\).

Solution:

Step 1: \(g(y) = e^y\) is strictly increasing. Range: \(U > 0\).

Step 2: Inverse: \(y = \ln(u) = h(u)\)

Step 3: Jacobian: \(h'(u) = \frac{1}{u}\)

Step 4: Apply formula: \[f_U(u) = \frac{1}{\sigma\sqrt{2\pi}} \exp\left[-\frac{(\ln u - \mu)^2}{2\sigma^2}\right] \cdot \frac{1}{u}\]

\[= \frac{1}{u\sigma\sqrt{2\pi}} \exp\left[-\frac{(\ln u - \mu)^2}{2\sigma^2}\right] \quad \text{for } u > 0\]

This is the Log-Normal distribution: \(U \sim \text{LogNormal}(\mu, \sigma^2)\).

๐Ÿ“– The Log-Normal in Finance

๐Ÿ“ Why Log-Normal for Stock Prices?

If log-returns are normal: \(r_t = \ln(P_t/P_{t-1}) \sim N(\mu, \sigma^2)\)

Then: \(\ln(P_t) = \ln(P_0) + \sum_{i=1}^{t} r_i\)

By CLT, \(\ln(P_t)\) is approximately normal, so \(P_t = e^{\ln(P_t)}\) is log-normal.

Properties of Log-Normal:

  • Always positive (prices canโ€™t be negative!)
  • Right-skewed
  • Mean: \(E[U] = e^{\mu + \sigma^2/2}\)
  • Variance: \(V(U) = e^{2\mu + \sigma^2}(e^{\sigma^2} - 1)\)

Black-Scholes Model:

Stock price follows geometric Brownian motion: \[dS_t = \mu S_t \, dt + \sigma S_t \, dW_t\]

Solution: \(S_t\) is log-normally distributed!

๐ŸŽฎ Interactive: Log-Normal Parameters

Explore: How do \(\mu\) and \(\sigma\) affect the log-normal stock price distribution?

Mean:

Median:

Mode:

Red dashed: Mean | Green dashed: Median

๐Ÿ“– Method of Moment-Generating Functions

๐Ÿ“ Theorem 6.4: MGF Uniqueness

If two random variables have the same moment-generating function in a neighborhood of \(t = 0\), they have the same distribution.

Method: 1. Find \(M_U(t) = E[e^{tU}]\) for the transformed variable \(U\) 2. Recognize \(M_U(t)\) as the MGF of a known distribution 3. Conclude \(U\) has that distribution

When to Use MGF Method:

  • Finding distribution of sums of independent RVs
  • When the MGF has a recognizable form
  • Avoiding complex integration

๐Ÿงฎ Key MGF Property: Sums of Independent RVs

Theorem 6.5: MGF of Sums

If \(Y_1, Y_2, \ldots, Y_n\) are independent random variables, then:

\[M_{Y_1 + Y_2 + \cdots + Y_n}(t) = M_{Y_1}(t) \cdot M_{Y_2}(t) \cdots M_{Y_n}(t)\]

Proof: \[M_{\sum Y_i}(t) = E[e^{t\sum Y_i}] = E[\prod e^{tY_i}] = \prod E[e^{tY_i}] = \prod M_{Y_i}(t)\]

The last equality uses independence.

Power of This Result: Instead of complex convolution integrals, just multiply MGFs!

๐Ÿ“Œ Example 3: Two-Asset Portfolio Return

Problem: A portfolio holds two uncorrelated assets with returns \(Y_1 \sim N(\mu_1, \sigma_1^2)\) and \(Y_2 \sim N(\mu_2, \sigma_2^2)\), independent. Find the distribution of the total return \(U = Y_1 + Y_2\).

Solution:

Step 1: Recall the normal MGF: \(M_Y(t) = e^{\mu t + \sigma^2 t^2/2}\)

Step 2: Compute product of MGFs: \[M_U(t) = M_{Y_1}(t) \cdot M_{Y_2}(t) = e^{\mu_1 t + \sigma_1^2 t^2/2} \cdot e^{\mu_2 t + \sigma_2^2 t^2/2}\]

\[= e^{(\mu_1 + \mu_2)t + (\sigma_1^2 + \sigma_2^2)t^2/2}\]

Step 3: Recognize this as the MGF of \(N(\mu_1 + \mu_2, \sigma_1^2 + \sigma_2^2)\)

\[\boxed{Y_1 + Y_2 \sim N(\mu_1 + \mu_2, \sigma_1^2 + \sigma_2^2)}\]

Portfolio Insight: Variances add for uncorrelated assets โ€“ this is why diversification across truly independent markets reduces risk most effectively!

๐Ÿ“Œ Example 4: Total Insurance Claim Processing Time

Problem: An insurance company processes \(n\) independent claims, each taking \(Y_i \sim \text{Exponential}(\beta)\) days. Find the distribution of total processing time \(U = \sum_{i=1}^n Y_i\).

Solution:

Step 1: Exponential MGF: \(M_Y(t) = (1 - \beta t)^{-1}\) for \(t < 1/\beta\)

Step 2: Product of MGFs: \[M_U(t) = \prod_{i=1}^n M_{Y_i}(t) = [(1 - \beta t)^{-1}]^n = (1 - \beta t)^{-n}\]

Step 3: Recognize as Gamma MGF with \(\alpha = n\):

\[\boxed{U = \sum_{i=1}^n Y_i \sim \text{Gamma}(n, \beta)}\]

Insurance Insight: Total time to process \(n\) claims follows a Gamma distribution โ€“ actuaries use Gamma quantiles to plan staffing and reserves.

๐Ÿ“Œ Example 5: Testing Portfolio Variance

Problem: A risk analyst standardizes \(n\) independent asset returns to get \(Z_i \sim N(0,1)\). To test portfolio variance, they compute \(U = \sum_{i=1}^n Z_i^2\). What is the distribution of \(U\)?

Solution:

Step 1: We showed \(Z^2 \sim \chi^2(1)\), which has MGF: \(M_{Z^2}(t) = (1 - 2t)^{-1/2}\)

Step 2: Product of MGFs: \[M_U(t) = \prod_{i=1}^n (1 - 2t)^{-1/2} = (1 - 2t)^{-n/2}\]

Step 3: This is the MGF of \(\chi^2(n)\):

\[\boxed{\sum_{i=1}^n Z_i^2 \sim \chi^2(n)}\]

Risk Testing: The \(\chi^2\) distribution underlies variance tests in portfolio risk management โ€“ risk managers use it to test if realized volatility exceeds model predictions.

๐Ÿ’ฐ Case Study: Portfolio Return Data

Scenario: 40% AAPL, 35% MSFT, 25% GOOG (daily log returns, 2020-2024)

๐Ÿ“Š Show Code
library(tidyverse)
library(tidyquant)
library(knitr)

# Download data for 3 assets
symbols <- c("AAPL", "MSFT", "GOOG")
prices <- tq_get(symbols, from = "2020-01-01", to = "2024-12-31")

# Calculate log returns
returns <- prices %>%
  group_by(symbol) %>%
  mutate(log_ret = log(adjusted / lag(adjusted))) %>%
  na.omit() %>%
  select(date, symbol, log_ret) %>%
  pivot_wider(names_from = symbol, values_from = log_ret)

# Portfolio weights
w <- c(AAPL = 0.4, MSFT = 0.35, GOOG = 0.25)

# Portfolio return (weighted sum)
returns <- returns %>%
  mutate(portfolio = w["AAPL"]*AAPL + w["MSFT"]*MSFT + w["GOOG"]*GOOG)

# Summary statistics table
summary_stats <- data.frame(
  Asset = c("AAPL", "MSFT", "GOOG", "Portfolio"),
  Weight = c("40%", "35%", "25%", "โ€”"),
  Mean = c(mean(returns$AAPL), mean(returns$MSFT),
           mean(returns$GOOG), mean(returns$portfolio)) * 252 * 100,
  StdDev = c(sd(returns$AAPL), sd(returns$MSFT),
             sd(returns$GOOG), sd(returns$portfolio)) * sqrt(252) * 100
)

kable(summary_stats, digits = 2,
      col.names = c("Asset", "Weight", "Ann. Mean (%)", "Ann. SD (%)"),
      caption = "Daily Log Return Statistics (Annualized)")
Daily Log Return Statistics (Annualized)
Asset Weight Ann. Mean (%) Ann. SD (%)
AAPL 40% 24.93 31.66
MSFT 35% 20.41 30.53
GOOG 25% 20.86 32.42
Portfolio โ€” 22.33 28.40

๐Ÿ’ฐ Case Study: Portfolio Return Distribution

Does the portfolio return look normal? MGF theory predicts yes, if returns are approximately normal and independent.

๐Ÿ“Š Show Code
# Plot portfolio return distribution
ggplot(returns, aes(x = portfolio)) +
  geom_histogram(aes(y = after_stat(density)),
                 bins = 50, fill = "steelblue", alpha = 0.7) +
  stat_function(fun = dnorm,
                args = list(mean = mean(returns$portfolio),
                           sd = sd(returns$portfolio)),
                color = "red", linewidth = 1.2) +
  labs(title = "Portfolio Return Distribution",
       subtitle = "40% AAPL, 35% MSFT, 25% GOOG | Red = Normal fit",
       x = "Daily Log Return", y = "Density") +
  theme_minimal(base_size = 14)

๐Ÿ’ฐ Case Study: Correlation & Portfolio Math

๐Ÿ“Š Show Analysis Code
# Correlation matrix
cor_matrix <- cor(returns %>% select(AAPL, MSFT, GOOG))
kable(cor_matrix, digits = 3, caption = "Correlation Matrix")
Correlation Matrix
AAPL MSFT GOOG
AAPL 1.000 0.751 0.651
MSFT 0.751 1.000 0.745
GOOG 0.651 0.745 1.000

The Math (from MGF perspective):

If returns were independent: \[V(R_p) = w_1^2\sigma_1^2 + w_2^2\sigma_2^2 + w_3^2\sigma_3^2\]

With correlation: \[V(R_p) = \sum_i w_i^2\sigma_i^2 + 2\sum_{i<j}w_i w_j \rho_{ij}\sigma_i\sigma_j\]

Since \(\rho_{ij} < 1\), portfolio variance is less than the case with perfect correlation!

๐Ÿ’ฐ Case Study: Diversification Benefit

๐Ÿ“Š Show Analysis Code
# Weighted average of individual SDs
weighted_avg_sd <- sum(w * c(sd(returns$AAPL),
                              sd(returns$MSFT),
                              sd(returns$GOOG)))

# Actual portfolio SD
portfolio_sd <- sd(returns$portfolio)

# Risk reduction table
risk_comparison <- data.frame(
  Metric = c("Weighted Avg SD", "Actual Portfolio SD", "Risk Reduction"),
  Value = c(sprintf("%.4f", weighted_avg_sd),
            sprintf("%.4f", portfolio_sd),
            sprintf("%.1f%%", 100 * (1 - portfolio_sd/weighted_avg_sd)))
)

kable(risk_comparison, caption = "Diversification Benefit")
Diversification Benefit
Metric Value
Weighted Avg SD 0.0198
Actual Portfolio SD 0.0179
Risk Reduction 9.7%

This is the mathematical foundation of diversification!

๐Ÿ’ฐ Case Study: Key Findings

๐Ÿ“Š Analysis Results

MGF Insight:

  • Portfolio return = weighted sum of individual returns

  • If returns were normal and independent, portfolio would be normal

  • MGF method: multiply individual MGFs

Reality Check:

  • Returns are not independent (correlated)

  • Correlations < 1 enable diversification

  • Portfolio SD significantly less than weighted average

Practical Implications:

  1. Diversification works because correlations < 1

  2. Risk reduction is quantifiable using variance formulas

  3. Portfolio optimization balances return vs. risk

๐Ÿค Think-Pair-Share: Choosing the Right

๐Ÿ’ญ Activity (4 minutes)

A hedge fund analyst needs to find the distribution of a weighted portfolio return \(R_p = 0.5R_1 + 0.3R_2 + 0.2R_3\) where each \(R_i \sim N(\mu_i, \sigma_i^2)\) independently.

๐Ÿง  Think (1 min):

  • Which method is most efficient: distribution function, transformation, or MGF?
  • What makes this problem easy for MGFs?

๐Ÿ‘ซ Pair (2 min):

  • Compare your method choices
  • Work out \(M_{R_p}(t)\) together
  • What distribution do you recognize?

๐Ÿ—ฃ๏ธ Share (1 min):

  • What is the final distribution of \(R_p\)?
  • How would correlation change your approach?

๐Ÿ“ Quiz #1: Transformation Method

A risk analyst models a stock return \(Y\) with pdf \(f_Y(y)\). To convert to a price ratio \(U = e^Y\) (strictly increasing, inverse \(h(u) = \ln(u)\)), the pdf of \(U\) is:

  • \(f_U(u) = f_Y(\ln(u)) \cdot \frac{1}{u}\)
  • \(f_U(u) = f_Y(e^u) \cdot e^u\)
  • \(f_U(u) = f_Y(\ln(u))\)
  • \(f_U(u) = f_Y(\ln(u)) \cdot u\)

๐Ÿ“ Quiz #2: Stock Price Distribution

If daily log-returns of a stock follow \(Y \sim N(\mu, \sigma^2)\), and the price ratio is \(S/S_0 = e^Y\), what distribution does \(S/S_0\) follow?

  • Log-Normal\((\mu, \sigma^2)\)
  • Normal\((\mu, \sigma^2)\)
  • Exponential\((e^\mu)\)
  • Gamma\((\mu, \sigma^2)\)

๐Ÿ“ Quiz #3: Portfolio Return MGF

Two uncorrelated assets have return MGFs \(M_1(t)\) and \(M_2(t)\). Total portfolio return is \(R = R_1 + R_2\). What is \(M_R(t)\)?

  • \(M_1(t) \cdot M_2(t)\)
  • \(M_1(t) + M_2(t)\)
  • \(M_1(t) / M_2(t)\)
  • \(M_1(M_2(t))\)

๐Ÿ“ Quiz #4: Insurance Claim Aggregation

An insurer processes 5 independent claims, each with processing time Exponential\((\beta)\). Using the MGF method, the distribution of total processing time is:

  • Gamma\((5, \beta)\)
  • Exponential\((5\beta)\)
  • Normal\((5\beta, 5\beta^2)\)
  • Chi-square\((5)\)

๐Ÿ“ Summary

โœ… Key Takeaways

  • Transformation method: \(f_U(u) = f_Y(h(u)) \cdot |h'(u)|\) for monotonic \(g\) with inverse \(h\) โ€” the Jacobian accounts for stretching/compressing

  • Probability integral transform: \(F_Y(Y) \sim \text{Uniform}(0,1)\) โ€” foundation for Monte Carlo simulation

  • Log-normal distribution: \(e^Y\) where \(Y \sim N(\mu, \sigma^2)\) โ€” models stock prices and other positive quantities

  • MGF method: For sums of independent RVs, \(M_{\sum Y_i}(t) = \prod M_{Y_i}(t)\)

  • Key results: Normals sum to normal, exponentials to gamma, \(\chi^2(1)\)โ€™s to \(\chi^2(n)\) โ€” proven elegantly via MGFs

๐Ÿ“š Practice Problems

๐Ÿ“ Homework Problems

Problem 1 (Transformation โ€“ Risk): An insurance loss is modeled as \(Y \sim \text{Exponential}(2)\). Use the transformation method to find the pdf of the cube-root loss severity \(U = Y^{1/3}\).

Problem 2 (Log-Normal โ€“ Stock Pricing): A stock price follows \(S \sim \text{LogNormal}(4, 0.09)\). Find \(E[S]\) and \(P(S > 60)\).

Problem 3 (MGF โ€“ Claim Counts): Two branch offices have independent claim counts \(Y_1 \sim \text{Poisson}(\lambda_1)\) and \(Y_2 \sim \text{Poisson}(\lambda_2)\). Use MGFs to show total claims \(Y_1 + Y_2 \sim \text{Poisson}(\lambda_1 + \lambda_2)\).

Problem 4 (Chi-Square โ€“ Variance Test): A risk analyst standardizes 10 independent daily returns to get \(Z_i \sim N(0,1)\). Find \(P(\sum Z_i^2 > 18.31)\) to test if realized variance is unexpectedly high.

Problem 5 (Portfolio): A pension fund holds two uncorrelated asset classes with returns \(N(0.08, 0.04)\) and \(N(0.05, 0.01)\). Find the distribution of the 60-40 portfolio return using the MGF method.

๐Ÿ“ฑ Late Check-in

๐Ÿ‘‹ Thank You!

๐Ÿ“ฌ Contact Information:

Samir Orujov, PhD

Assistant Professor

School of Business

ADA University

๐Ÿ“ง Email: sorujov@ada.edu.az

๐Ÿข Office: D312

โฐ Office Hours: By appointment

๐Ÿ“… Next Class:

Topic: Multivariate Transformations and Order Statistics

Reading: Chapter 6, Sections 6.6-6.7

Preparation: Review partial derivatives and Jacobian determinants

โฐ Reminders:

โœ… Complete Practice Problems 1-5

โœ… Review matrix determinants

โœ… Think about min/max of random samples

โœ… Work hard!

โ“ Questions?

๐Ÿ’ฌ Open Discussion

Key Topics for Discussion:

  • When is the MGF method preferable to the distribution function method?

  • Why do stock prices follow log-normal rather than normal distributions?

  • How does the probability integral transform enable Monte Carlo simulation?

  • What happens when random variables are not independent?