Week 7
Expectation and Linear Transformations
- Let X be a continuous random variable with probability density function (pdf) f(x).
- For any real-valued function g, the expectation is given by
- Special case: if Y = aX + b, then
since
Nonnegative g(X): an alternative expression for E[g(X)]
- Theorem (nonnegative g): if g(x) ≥ 0 for all x, then
E[g(X)] = \int_{0}^{\infty} \Pr{g(X) > y} \, dy. - Sketch of proof:
- For nonnegative Y with density fY, we have E[Y] = \int{0}^{\infty} \Pr{Y > y} \, dy.
- Since \Pr{Y > y} = \int{y}^{\infty} fY(x) \, dx,
interchanging integrals (Tonelli/Fubini) yields
E[Y] = \int{0}^{\infty} \int{x:g(x) > y} f(x) \, dx \, dy = \int_{-\infty}^{\infty} g(x) f(x) \, dx.
- This justifies using the tail integral representation for nonnegative functions of X.
Example: E[e^X] for X ~ Uniform(0,1)
- Density:
- Directly,
- Alternative method via Y = e^X:
- CDF: for 1 ≤ x ≤ e,
- Therefore pdf:
- Expectation:
- CDF: for 1 ≤ x ≤ e,
- Result: (same result, different method).
Normal Approximation to Binomial Distributions (DeMoivre–Laplace)
- Let For any real numbers a < b, where
- Binomial approximations:
- Poisson approximation when n is large and p is small: if n p is moderate, use Poisson with parameter .
- Normal approximation is good when is large, typically ≥ 10.
Examples: Binomial approximations and exact calculations
- Example 1: 40 fair coin tosses, X = number of heads. Find
- Continuity correction: \Pr{19.5 < X < 20.5}.
- Standardize:
and similarly for 20.5. Thus
- Exact value:
- Example 2: Class size, 450 offers, each attending with probability 0.3. X ~ Bin(450, 0.3). Compute
- Use continuity correction:
- With np = 450×0.3 = 135 and Var = 450×0.3×0.7 = 94.5, SD = \sqrt{94.5} \approx 9.725.
- Z-value:
- Tail probability:
- Example 3: In 10,000 coin tosses, observed heads = 5800. Is the coin fair?
- If X ~ Bin(10000, 0.5), then E[X] = 5000, Var(X) = 2500, SD = 50.
- Continuity-corrected:
- Standardize:
- Result: probability is effectively 0; thus the coin is not fair in practical terms.
Exponential Distribution
- Density:
f(x) = \begin{cases} \lambda e^{-\lambda x}, & x \ge 0, \[2pt] 0, & x < 0. \end{cases} - CDF:
- Survival function: \Pr(X > x) = 1 - F(x) = e^{-\lambda x}, \quad x \ge 0.
- Parameter: \lambda > 0.
- Moments: If , then
- Recurrence for moments:
- Memoryless property: Exponential is memoryless:
- Practical note: Not a good model for human lifetime (memorylessness implies equal remaining life for people at different ages).
- Relation to Poisson process: If events occur as a Poisson process with rate , then the time until the next event T is Exp(), with tail \Pr(T > t) = e^{-\lambda t}.
Gamma Distribution
- Motivation: Waiting time until the n-th event in a Poisson process. Let T_n be this waiting time.
- CDF:
- PDF (Gamma density): for shape \alpha > 0 and rate \lambda > 0,
g(t) = \frac{\lambda^{\alpha}}{\Gamma(\alpha)} t^{\alpha - 1} e^{-\lambda t}, \quad t > 0. - When , Gamma reduces to the Exponential distribution:
- Interpretation: The waiting time until the -th event is Gamma with parameters ; the Gamma variable is the sum of i.i.d. Exp() variables (only strictly true for integer ).
- Applications: modeling arrival times in Poisson processes, time to failures, positive-valued quantities (rainfalls), and financial quantities like insurance claim sizes.
- Gamma function connection: The gamma function is defined as
\Gamma(x) = \int_{0}^{\infty} u^{x-1} e^{-u} \, du, \quad x > 0.
- It satisfies the recursive relation
- For positive integers,
- It satisfies the recursive relation
- Gamma density with two parameters: shape \alpha > 0 and rate \lambda > 0 is often written as
g(t) = \frac{\lambda^{\alpha}}{\Gamma(\alpha)} t^{\alpha - 1} e^{-\lambda t}, \quad t > 0. - Mean and variance of Gamma:
- Important special cases and interpretations:
- If with integer $n$, then $X$ is the sum of $n$ i.i.d. Exp() variables.
- The Gamma distribution generalizes the exponential distribution; when we recover Exp().
- Example in seismology: times between microearthquakes may be modeled with Gamma vs Exponential; Gamma often provides better fit when inter-event times exhibit variability beyond Poisson assumptions.
Additional notes on Gamma and related concepts
- If , then the case (a positive integer) corresponds to the sum of $n$ independent Exp() random variables.
- The gamma function appears in the normalization constant of the gamma density; it generalizes the factorial to non-integer values.
- In practice, the gamma distribution is used for positive-valued data with skewness controlled by the shape parameter ; larger yields more symmetric (approximately normal) shapes when scaled appropriately.
Quick recap and connections to foundational principles
- Linearity of expectation: expectations of sums are sums of expectations; transformations of random variables preserve linear relationships under expectation.
- Integral representations and Fubini/Tonelli theorem allow swapping order of integration, enabling tail-integral representations.
- Normal approximation to binomial relies on central limit intuition: binomial counts behave like normal distributions under appropriate scaling.
- Exponential distribution embodies memoryless property, linking to Poisson processes and waiting-time problems.
- Gamma distribution connects to Poisson processes as the waiting time to the n-th event; its properties extend the exponential case to sums of independent exponentials.
Key formulas to remember (LaTeX)
- Expectation of a transformation:
- Linear transformation of X:
- Tail-integral representation (for nonnegative g):
E[g(X)] = \int_{0}^{\infty} \Pr{g(X) > y} \, dy. - Normal approximation to Binomial (DeMoivre–Laplace):
- Exponential distribution:
f(x) = \lambda e^{-\lambda x} (x \ge 0), \quad F(x) = 1 - e^{-\lambda x} (x \ge 0), \quad \Pr(X > x) = e^{-\lambda x}. - Mean and variance of Exp():
- Memoryless property (Exponential):
- Gamma density (shape , rate ):
g(t) = \frac{\lambda^{\alpha}}{\Gamma(\alpha)} t^{\alpha - 1} e^{-\lambda t}, \quad t > 0. - Gamma function:
\Gamma(x) = \int_{0}^{\infty} u^{x-1} e^{-u} \, du, \quad x > 0,
- Gamma moments: for ,