Schweser Book 2

📚 Schweser Book 2.pdf

Brief overview

This document provides a comprehensive study of statistical concepts and quantitative methods essential for financial analysis. Understanding these topics is crucial for interpreting financial data, building models, and making informed investment decisions.

Key points

  • Fundamentals of probability and random variables, including events and distributions.
  • Common univariate and multivariate probability distributions and their applications.
  • Estimation of sample moments and procedures for hypothesis testing.
  • Principles of linear regression, including estimation and diagnostic checks.
  • Techniques for time series analysis and forecasting.

1. Fundamentals of probability and random variables (part 1)

1.1 Basics of probability

  • A random variable has an outcome that is unknown. Its possible outcomes have associated probabilities.
  • Probabilities range from 0 (impossible) to 1 (certain).
  • A conditional probability is the chance of an event happening given another event already occurred, denoted as P(A∣B)P(A|B).
  • An unconditional probability (or marginal probability) is the probability of an event without any other event influencing it.
  • A joint probability, P(AB)P(AB), is the chance that both event A and event B occur 13.

1.2 Events and event spaces

  • An event is a single outcome or a set of outcomes for a random variable.
  • The event space is the collection of all possible outcomes for a random variable.

1.3 Independent and mutually exclusive events

  • Two events are independent if knowing one's outcome doesn't change the probability of the other.
  • For independent events, P(A×B)=P(A)×P(B)P(A \times B) = P(A) \times P(B).
  • Also, P(A∣B)=P(A)P(A|B) = P(A).
  • Two events are mutually exclusive if they cannot both occur simultaneously 14.
  • For mutually exclusive events, P(A or B)=P(A)+P(B)P(A \text{ or } B) = P(A) + P(B).

1.4 Conditionally independent events

  • Events A and B are conditionally independent given C if P(A∣C)×P(B∣C)=P(AB∣C)P(A|C) \times P(B|C) = P(AB|C).
  • Conditional independence may exist even if unconditional independence does not 15.

1.5 Conditional, unconditional, and joint probabilities

1.6 Discrete probability function

  • A discrete probability function assigns probabilities to a finite set of possible outcomes.
  • The sum of probabilities for all possible outcomes must equal 1.

📝 Example: For outcomes x=1,2,3,4x = 1, 2, 3, 4, if P(x)=x/10P(x) = x/10, then P=3/10P = 3/10. The probability of 22 or 44 is P+P=2/10+4/10=6/10P + P = 2/10 + 4/10 = 6/10 2 3 4.

1.7 Conditional and unconditional probabilities

  • Conditional probability, P(A∣B)P(A|B), is the chance of A happening given B has occurred.
  • Unconditional probability is the probability of an event without any prior conditions.
  • The joint probability can be found by P(AB)=P(A∣B)×P(B)P(AB) = P(A|B) \times P(B) 16.

Total probability rule

  • If events B1,B2,…,BnB_1, B_2, \dots, B_n are mutually exclusive and exhaustive, then the probability of event A is the sum of joint probabilities: P(A)=∑i=1nP(A∣Bi)P(Bi)P(A) = \sum_{i=1}^{n} P(A|B_i)P(B_i)
  • This rule sums the probabilities of A occurring under each possible condition.

📝 Example: For Acme, Inc., if P(40+ | ND) = 10%, P(40+ | BD) = 70%, P(40+ | HBD) = 100% and P(ND)=60%, P(BD)=30%, P(HBD)=10%, then P(40+) = (0.10)(0.60) + (0.70)(0.30) + (1.00)(0.10) = 0.06 + 0.21 + 0.10 = 0.37 or 37%.

Calculating conditional probability

  • A conditional probability can be calculated using the formula: P(A∣B)=P(AB)P(B)P(A|B) = \frac{P(AB)}{P(B)}.

1.8 Bayes' rule

  • Bayes' rule updates prior probabilities with new information.
  • The formula is: P(A∣B)=P(B∣A)P(A)P(B)P(A|B) = \frac{P(B|A)P(A)}{P(B)}.
  • This can also be written as: P(A∣B)=P(B∣A)P(A)∑i=1nP(B∣Bi)P(Bi)P(A|B) = \frac{P(B|A)P(A)}{\sum_{i=1}^{n} P(B|B_i)P(B_i)} 17.

📝 Example: Given an economy has a 60% chance of outperforming and a 40% chance of underperforming, and a stock has a 70% chance of rising with an outperforming economy and 20% with an underperforming one. The probability the economy outperformed given the stock rose is: P(Outperform∣Gains)=P(Gains∣Outperform)P(Outperform)P(Gains∣Outperform)P(Outperform)+P(Gains∣Underperform)P(Underperform)P(\text{Outperform}|\text{Gains}) = \frac{P(\text{Gains}|\text{Outperform})P(\text{Outperform})}{P(\text{Gains}|\text{Outperform})P(\text{Outperform}) + P(\text{Gains}|\text{Underperform})P(\text{Underperform})} P(Outperform∣Gains)=(0.70)(0.60)(0.70)(0.60)+(0.20)(0.40)=0.420.42+0.08=0.420.50=0.84P(\text{Outperform}|\text{Gains}) = \frac{(0.70)(0.60)}{(0.70)(0.60) + (0.20)(0.40)} = \frac{0.42}{0.42 + 0.08} = \frac{0.42}{0.50} = 0.84 or 84% 18.

📝 Example: A shipment of 1,000 cars has 600 blue (B) and 400 red (R). Of blue cars, 150 have driver assist (DA); of red cars, 200 have DA.

  • Unconditional: P(B) = 60%, P(R) = 40%.
  • Conditional: P(DA|B) = 150/600 = 25%, P(DA|R) = 200/400 = 50%.
  • Joint: P(B and DA) = 0.25 * 0.60 = 15%, P(R and DA) = 0.50 * 0.40 = 20%.
  • Total Probability: P(DA) = P(DA|B)P(B) + P(DA|R)P(R) = 15% + 20% = 35%.
  • Bayes' Rule: P(B|DA) = P(B and DA) / P(DA) = 15% / 35% = 42.9% 19.

🔑 Important: Understanding the difference between independent and mutually exclusive events is crucial. Independent events can occur together, while mutually exclusive events cannot. Bayes' rule is essential for updating probabilities with new evidence.

1.9 Basic probability concepts

  • Event: A specific outcome or a set of outcomes from a random occurrence.
  • Event space: The collection of all possible subsets of outcomes, including the empty set.

1.10 Types of events

  • Independent events: Two events where the occurrence of one does not affect the probability of the other.
  • Conditions for independence:
  • P(A)×P(B)=P(AB)P(A) \times P(B) = P(AB)
  • P(A∣B)=P(A)P(A|B) = P(A).
  • Mutually exclusive events: Events that cannot happen at the same time.
  • Their joint probability is zero: P(AB)=0P(AB) = 0.
  • The probability of either event occurring is the sum of their individual probabilities: P(A or B)=P(A)+P(B)P(A \text{ or } B) = P(A) + P(B).

🔑 Important: Independence means events are unrelated; mutual exclusivity means they are opposite (cannot coexist).

1.11 Conditional probability

  • Conditional probability: The likelihood of an event occurring given that another event has already occurred.
  • Formula for joint probability: P(AB)=P(A∣B)×P(B)P(AB) = P(A|B) \times P(B).
  • This can be rearranged to find conditional probability: P(A∣B)=P(AB)P(B)P(A|B) = \frac{P(AB)}{P(B)}.

📝 Example: The probability of Acme shares increasing given Best shares increase.

1.12 Probability distributions

  • Probability function: Describes probabilities for each outcome in a discrete distribution.
  • For example, P(x)=x/25P(x) = x/25 for outcomes {1,2,3,4,5}\{1, 2, 3, 4, 5\}.

1.13 Conditional independence

  • Conditionally independent events: Events are independent when conditioned on a third event.
  • If P(AB∣C)=P(A∣C)×P(B∣C)P(AB|C) = P(A|C) \times P(B|C), then A and B are conditionally independent.
  • Events can be independent overall but dependent when conditioned, or vice versa 20.

🔑 Important: Conditional independence is a specific type of independence that only applies under certain conditions.

🔑 Important: The most exam-relevant insight for this topic is understanding the distinct conditions and formulas for independent, mutually exclusive, and conditionally independent events.

2. Fundamentals of probability and random variables (part 2)

2.1 Random variables and probability functions

  • Discrete random variable: Can take on a countable number of possible outcomes (e.g., Bernoulli, number of days with temp > 70).
  • Continuous random variable: Can take on an uncountable number of possible outcomes (e.g., rainfall amount). Probability of any single value is zero 22.

2.1.1 Probability mass function (PMF)

  • PMF, f(x)=P(X=x)f(x) = P(X = x): Gives the probability that a discrete random variable XX equals a specific value xx.
  • For any PMF, the sum of probabilities for all possible outcomes must be 100%.

📝 Example: For a six-sided die, the PMF is f(x)=1/6f(x) = 1/6 for x∈{1,2,3,4,5,6}x \in \{1, 2, 3, 4, 5, 6\}.

2.1.2 Cumulative distribution function (CDF)

  • CDF, F(x)=P(X≤x)F(x) = P(X \le x): Gives the probability that a random variable XX is less than or equal to a value xx.
  • The CDF is defined for all real numbers, even if the PMF is not.
  • The CDF is the sum of probabilities of all outcomes less than or equal to xx.

📝 Example: For a six-sided die, F=P(X≤3)=f+f+f=1/6+1/6+1/6=3/6=50%F = P(X \le 3) = f + f + f = 1/6 + 1/6 + 1/6 = 3/6 = 50\%3.

2.1.3 Expected value

  • Expected value, E(X)E(X): The weighted average of possible outcomes, where weights are their probabilities.
  • Formula: E(X)=∑i=1nP(xi)xiE(X) = \sum_{i=1}^{n} P(x_i)x_i 23.
  • It represents the best guess for the outcome of a random variable, minimizing the average difference from actual outcomes.

📝 Example: For a fair coin (X=1X=1 for heads, X=0X=0 for tails): E(X)=P+P=(0.5)+(0.5)=0.5E(X) = P + P = (0.5) + (0.5) = 0.5 .

📝 Example: For a fair six-sided die: E(X)=(1/6)+(1/6)+...+(1/6)=3.5E(X) = (1/6) + (1/6) +... + (1/6) = 3.5 16 24.

📝 Example: Expected earnings per share (EPS): E(EPS)=0.10(1.80)+0.20(1.60)+0.40(1.20)+0.30(1.00)=1.28E(EPS) = 0.10(1.80) + 0.20(1.60) + 0.40(1.20) + 0.30(1.00) = 1.28 pounds.

  • Useful properties:
  • E(cX)=cE(X)E(cX) = cE(X) for a constant cc.
  • E(X+Y)=E(X)+E(Y)E(X + Y) = E(X) + E(Y) for random variables XX and YY 25.

2.2 Moments of a probability distribution

  • Common population moments describe a distribution's characteristics.
Moment TypeDescriptionFormula
First Moment (Mean)Expected value, μ\mu.E(X)E(X)
Second MomentVariance, σ2\sigma^2. Measures dispersion around the mean.E[(X−μ)2]E[(X - \mu)^2]
Third MomentSkewness. Measures distribution symmetry (standardized third central moment).E[(X−μ)3/σ3E[(X - \mu)^3 / \sigma^3
Fourth MomentKurtosis. Measures tail probability relative to the rest of the distribution.E[(X−μ)4/σ4E[(X - \mu)^4 / \sigma^4
  • Variance (σ2\sigma^2): Measures how spread out values are.
  • Standard deviation (σ\sigma): The square root of variance, in the same units as the variable.
  • Skewness: Measures symmetry. Skew = 0 means perfect symmetry 26.
  • Kurtosis: Measures tail fatness. Higher kurtosis means more probability in tails (fat tails) 27.

🔑 Important: Higher kurtosis indicates a greater probability of extreme positive and negative returns.

2.3 Probability density functions (PDFs) and quantiles

2.3.1 Probability density function (PDF)

  • A PDF describes probabilities for a continuous random variable.
  • The probability of an outcome between two values is the area under the PDF over that interval (calculated via integration).
  • Unlike a PMF, the probability of any single outcome for a PDF is zero.

🔑 Important: A PDF applies only to continuous random variables; a PMF is for discrete variables.

2.3.2 Quantile functions

  • Quantile function, Q(p)Q(p): The inverse of the CDF, returning the value below which p%p\% of outcomes fall.
  • F[Q(p)]=pF[Q(p)] = p and Q(F(x))=xQ(F(x)) = x.

📝 Example: If F=30%F = 30\%, then Q(30%)=2Q(30\%) = 2 2 28.

  • Median: Q(50%)Q(50\%), the value below which 50% of outcomes fall.
  • For symmetric distributions, mean = median.
  • Interquartile Range (IQR): The range between Q(25%)Q(25\%) and Q(75%)Q(75\%), covering the middle 50% of outcomes.
  • IQR measures variability, similar to standard deviation.

🔑 Important: The CDF F[Q(23%)]F[Q(23\%)] equals 23%.

2.4 Linear transformations of random variables

  • A linear transformation of XX is Y=a+bXY = a + bX, where aa shifts and bb rescales.
CharacteristicTransformation of Y=a+bXY = a + bX
MeanE(Y)=a+bE(X)E(Y) = a + bE(X)
VarianceVar(Y)=b2Var(X)Var(Y) = b^2 Var(X)
Standard Deviation$SD(Y) =
Skewnessskew(Y)=skew(X)skew(Y) = skew(X) if b>0b > 0; skew(Y)=−skew(X)skew(Y) = -skew(X) if b<0b < 0
Kurtosiskurtosis(Y)=kurtosis(X)kurtosis(Y) = kurtosis(X)
MedianMedian(Y)=a+b⋅Median(X)Median(Y) = a + b \cdot Median(X)
Interquartile Range$IQR(Y) =

29.

🔑 Important: The variance of Y=a+bXY = a + bX is b2b^2 times the variance of XX.

🔑 Important: Linear transformations do not change kurtosis 30.

🔑 Important: For a linear transformation Y=a+bXY=a+bX, the variance of YY is σY2=b2σX2\sigma_Y^2 = b^2 \sigma_X^2 31.

3. Common univariate and multivariate random variables (part 1)

3.1 Uniform, Bernoulli, binomial, and Poisson distributions

  • Continuous uniform distribution: Outcomes are equally likely within a specified range [a,b][a, b].
  • Probability of XX being between x1x_1 and x2x_2: P(x1≤X≤x2)=x2−x1b−aP(x_1 \le X \le x_2) = \frac{x_2 - x_1}{b - a} 32.
  • Mean: μ=a+b2\mu = \frac{a+b}{2}.
  • Variance: σ2=(b−a)212\sigma^2 = \frac{(b-a)^2}{12}.
  • Bernoulli distribution: A single trial with two possible outcomes: success or failure 1.
  • Probability of success: pp.
  • Probability of failure: 1−p1-p.
  • Probability mass function: f(x)=px(1−p)1−xf(x) = p^x (1-p)^{1-x}.
  • Mean: μ=p\mu = p.
  • Variance: σ2=p(1−p)\sigma^2 = p(1-p).
  • Binomial distribution: The number of successes in a fixed number of independent Bernoulli trials (nn).
  • Probability of exactly xx successes: P(X=x)=(nx)px(1−p)n−xP(X=x) = \binom{n}{x} p^x (1-p)^{n-x} 34.
  • Mean: E(X)=npE(X) = np.
  • Variance: Var(X)=np(1−p)Var(X) = np(1-p) 35.
  • Poisson distribution: The number of events occurring in a fixed interval of time or space.
  • Parameter λ\lambda: The average or expected number of successes per unit.
  • Probability of XX successes: P(X=x)=e−λλxx!P(X=x) = \frac{e^{-\lambda} \lambda^x}{x!}.
  • Mean: E(X)=λE(X) = \lambda.
  • Variance: Var(X)=λVar(X) = \lambda 36.

🔑 Important: The binomial distribution models a fixed number of trials with two outcomes, while the Poisson distribution models the number of events in a continuous interval.

3.2 Normal and lognormal distributions

  • Normal distribution: A continuous, symmetric, bell-shaped distribution.
  • Defined by mean (μ\mu) and variance (σ2\sigma^2), denoted X∼N(μ,σ2)X \sim N(\mu, \sigma^2).
  • Skewness = 0, Kurtosis = 3 38.
  • 68% of outcomes are within 1 standard deviation of the mean.
  • 95% of outcomes are within 2 standard deviations of the mean.
  • Confidence intervals: A range expected to contain the true value a certain percentage of the time.
  • 90% interval: Xˉ±1.65s\bar{X} \pm 1.65s.
  • 95% interval: Xˉ±1.96s\bar{X} \pm 1.96s.
  • 99% interval: Xˉ±2.58s\bar{X} \pm 2.58s 39.
  • Standard normal distribution (z-distribution): A normal distribution with mean 0 and standard deviation 1.
  • Standardization formula: z=X−μσz = \frac{X - \mu}{\sigma}.
  • Used with z-tables to find probabilities P(Z<z)P(Z < z).
  • P(Z<−z)=1−P(Z<z)P(Z < -z) = 1 - P(Z < z) due to symmetry 40.
  • Lognormal distribution: A distribution where the natural logarithm of the variable is normally distributed (Y=eXY = e^X, where XX is normal).
  • Skewed to the right.
  • Bounded below by zero, useful for modeling asset prices 43.

🔑 Important: Standardizing normal variables allows the use of a single z-table for probability calculations.

3.3 Student’s t, Chi-squared, and F-distributions

  • Student's t-distribution: Similar to normal but with fatter tails, used for small samples (n<30n<30) with unknown variance.
  • Defined by degrees of freedom (df=n−1df = n-1).
  • Approaches the normal distribution as dfdf increases 44.
  • Confidence intervals are wider than for normal distribution with the same confidence level.
  • Chi-squared distribution (χ2\chi^2): Asymmetrical, bounded below by zero.
  • Used for hypothesis tests concerning population parameters and models of positive random variables.
  • Test statistic formula: χ2=(n−1)s2σ02\chi^2 = \frac{(n-1)s^2}{\sigma_0^2}.
  • Approaches normal distribution as dfdf increases 45.
  • F-distribution: Right-skewed, bounded by zero.
  • Used for testing equality of variances of two populations.
  • Defined by two degrees of freedom: numerator (df1df_1) and denominator (df2df_2).
  • Test statistic formula: F=s12s22F = \frac{s_1^2}{s_2^2}.
  • Approaches normal distribution as sample sizes increase 46.

🔑 Important: Student's t, Chi-squared, and F-distributions are all skewed and approach normality with increasing degrees of freedom, but have different applications based on sample size and known parameters.

3.4 Exponential and Beta distributions

  • Exponential distribution: Models waiting times for an event.
  • PDF: f(x)=1βe−x/βf(x) = \frac{1}{\beta} e^{-x/\beta} for x≥0x \ge 0.
  • Parameter β\beta: Scale parameter (reciprocal of rate λ\lambda).
  • Mean: E(X)=βE(X) = \beta.
  • Variance: Var(X)=β2Var(X) = \beta^2.
  • Related to Poisson distribution for counts of events over time 47.
  • Beta distribution: Models probabilities or rates between 0 and 1.
  • Used in credit risk modeling.
  • Shape depends on parameters α\alpha and β\beta.
  • Can be symmetric or skewed.

🔑 Important: The exponential distribution is for continuous waiting times, while the beta distribution models probabilities within a fixed range.

3.5 Mixture distributions

  • Mixture distribution: A combination of two or more probability distributions.
  • Created when underlying data doesn't fit a single predetermined distribution 48.
  • Combines parametric component distributions with nonparametric weights.
  • Can alter skewness, kurtosis, and create multiple modes.
  • Improves risk models by incorporating rare, high-impact events 49.

🔑 Important: Mixture distributions allow for more complex modeling by combining simpler distributions, capturing features like multiple modes or extreme event potential.

3.6 Properties of common distributions

  • Log-normal distribution: A random variable XX is log-normally distributed if ln⁡(X)\ln(X) is normally distributed. This distribution is useful for modeling variables that are strictly positive.

  • Values less than zero are not possible for a log-normally distributed variable.

  • Student's t-distribution: This distribution is used for confidence intervals with small sample sizes. It is appropriate when the population variance is unknown but the population is normal or approximately normal.

  • Chi-squared and F-distributions: There is no fixed relationship between the mean and standard deviation for these distributions.

🔑 Important: The t-distribution is preferred over the normal distribution for small samples when the population standard deviation is unknown.

3.7 Examples and calculations

  • Bernoulli trial probability: The probability of success in a Bernoulli trial is denoted by pp. The probability of failure is q=1−pq = 1 - p.

  • Poisson approximation to binomial: When the number of trials nn is large and the probability of success pp is small, a binomial distribution can be approximated by a Poisson distribution with parameter λ=np\lambda = np.

  • Example: If the probability of a defective car is p=0.05p=0.05 and we consider 3 cars (n=3n=3), the Poisson parameter is λ=(0.05)=0.15\lambda = (0.05) = 0.15 3.

  • Binomial probability calculation: The probability of getting exactly kk successes in nn independent Bernoulli trials is given by the binomial formula: P(X=k)=(nk)pk(1−p)n−kP(X=k) = \binom{n}{k} p^k (1-p)^{n-k} where (nk)=n!k!(n−k)!\binom{n}{k} = \frac{n!}{k!(n-k)!}.

  • Example: For 6 trials, with success probability p=0.6p=0.6, the probability of exactly 4 successes is: (64)(0.6)4(0.4)6−4=15(0.1296)(0.16)=0.311\binom{6}{4} (0.6)^4 (0.4)^{6-4} = 15(0.1296)(0.16) = 0.311.

  • Cumulative distribution function (CDF) for normal distribution: The probability that a normally distributed random variable XX is less than or equal to a value xx is denoted by F(x)=P(X≤x)F(x) = P(X \le x). The probability of XX being greater than xx is 1−F(x)1 - F(x).

  • Example: If F=0.9772F = 0.9772, then P(X>2)=1−0.9772=0.0228P(X > 2) = 1 - 0.9772 = 0.0228 2.

🔑 Important: For a log-normally distributed variable, negative values are impossible, whereas financial security returns can be negative 51.

4. Common univariate and multivariate random variables (part 2)

4.1 Marginal and conditional distributions

  • Multivariate random variables are vectors of random variables, measuring dependency between them.
  • A bivariate random variable has two components, X1X_1 and X2X_2.
  • A probability mass function (PMF) for a bivariate variable gives the probability that both X1X_1 and X2X_2 take specific values 52.

A probability matrix illustrates a PMF's properties:

  • Probabilities are between 0 and 1.
  • The sum of all probabilities for all outcomes is 1.

📝 Example: A company's stock return depends on earnings announcements (positive, neutral, negative). A probability matrix shows joint probabilities for stock returns (e.g., -3%, 0%, 3%) and announcement types 53.

  • A marginal distribution describes a single component of a bivariate variable (a univariate distribution).
  • To find it, sum probabilities across rows or columns of the joint PMF matrix.

📝 Example: To find the marginal PMF for a 3% stock return, sum all probabilities where the return is 3%, regardless of the earnings announcement 54.

  • A conditional distribution describes probabilities for one variable given a specific value of another.
  • It's calculated as: P(X1=x1∣X2=x2)=P(X1=x1,X2=x2)P(X2=x2)P(X_1=x_1 | X_2=x_2) = \frac{P(X_1=x_1, X_2=x_2)}{P(X_2=x_2)}.

📝 Example: The conditional distribution of stock returns given a negative earnings announcement uses the probabilities from the "negative announcement" row, divided by the marginal probability of a negative announcement 55.

4.2 Moments of bivariate random distributions

  • The expectation of a bivariate random function g(X1,X2)g(X_1, X_2) is a probability-weighted average of the function's outcomes. E[g(X1,X2)]=∑x1∑x2g(x1,x2)P(X1=x1,X2=x2)E[g(X_1, X_2)] = \sum_{x_1} \sum_{x_2} g(x_1, x_2) P(X_1=x_1, X_2=x_2).

📝 Example: Calculate the expectation of X1×X2X_1 \times X_2 by multiplying each possible product of X1X_1 and X2X_2 by its joint probability and summing the results 56.

  • Covariance measures how two variables move together.

  • Formula: Cov[X1,X2=E[(X1−E[X1])(X2−E[X2])]=E[X1X2−E[X1]E[X2]\text{Cov}[X_1, X_2 = E[(X_1 - E[X_1])(X_2 - E[X_2])] = E[X_1 X_2 - E[X_1]E[X_2] 57.

  • A positive covariance means variables tend to move in the same direction.

  • A negative covariance means variables tend to move in opposite directions.

  • A zero covariance suggests no linear relationship.

  • Correlation coefficient standardizes covariance, making it easier to interpret.

  • Formula: ρX1,X2=Corr(X1,X2)=Cov[X1,X2]σX1σX2\rho_{X_1, X_2} = \text{Corr}(X_1, X_2) = \frac{\text{Cov}[X_1, X_2]}{\sigma_{X_1} \sigma_{X_2}}.

  • It ranges from -1 (perfect negative linear relationship) to +1 (perfect positive linear relationship).

  • A correlation of 0 implies no linear relationship but not necessarily independence.

🔑 Important: Correlation helps interpret dependency between variables with different scales 58.

4.3 Behavior of moments for bivariate random variables

Linear transformations affect covariance and correlation:

EffectDescriptionFormula/Rule
Sign of bDetermines the correlation between components; 1 if b>0b>0, 0 if b=0b=0, -1 if b<0b<0 (for X2=a+bX1X_2 = a + bX_1).Corr(X1,X2)∈{−1,0,1}\text{Corr}(X_1, X_2) \in \{-1, 0, 1\}
Scale of bScale of bb determines changes in variance by b2b^2. Location shifts (aa, cc) do not affect variance or covariance.Var[a+bX1=b2Var[X1]\text{Var}[a + bX_1 = b^2 \text{Var}[X_1]
Scale of b and dScale of covariance is determined by bb and dd.Cov[a+bX1,c+dX2=bdCov[X1,X2]\text{Cov}[a + bX_1, c + dX_2 = bd \text{Cov}[X_1, X_2]
Coskewness/CokurtosisRelates to cross-variable versions of skewness and kurtosis, measuring how one variable's power impacts another.N/A (concepts are complex and defined in later readings).
59* The variance of a weighted sum of two random variables incorporates their covariance.
  • Formula: Var[aX1+bX2=a2Var[X1+b2Var[X2+2abCov[X1,X2]\text{Var}[aX_1 + bX_2 = a^2\text{Var}[X_1 + b^2\text{Var}[X_2 + 2ab\text{Cov}[X_1, X_2].

🔑 Important: This formula is crucial for calculating portfolio variance, where aa and bb are asset weights.

📝 Example: To compute the variance of a two-asset portfolio (30% in asset 1, 70% in asset 2), use their individual variances, covariance, and weights in the portfolio variance formula 60.

  • A conditional expectation is computed based on a specific event occurring.
  • It uses a conditional PMF as a weighted average.

📝 Example: The conditional expectation of a stock's return given a negative earnings announcement uses the conditional distribution of returns for that specific announcement 62.

4.4 Independent and identically distributed (i.i.d.) random variables

  • Independent and identically distributed (i.i.d.) variables share three key features:

  • Independence: Each variable is independent of all others.

  • Identical distribution: All variables come from the same univariate distribution.

  • Same moments: All variables have identical expected values and variances65.

  • For a sum of nn i.i.d. random variables:

  • Expected value: E[∑i=1nXi=nμE[\sum_{i=1}^n X_i = n\mu.

  • Variance: Var[∑i=1nXi=nσ2\text{Var}[\sum_{i=1}^n X_i = n\sigma^2.

  • The variance of the sum grows linearly with nn.

  • The variance of the average of multiple i.i.d. random variables decreases as nn increases 63.

🔑 Important: The independence of i.i.d. variables means all covariances are zero, simplifying variance calculations for sums 64.

🔑 Important: Understanding bivariate distributions, covariance, and correlation is key for assessing financial risk and portfolio management 67.

5. Sample moments and hypothesis testing (part 1)

5.1 Estimating mean, variance, and standard deviation

  • The sample mean (Xˉ\bar{X}) estimates the population mean (μ\mu). It's calculated by summing all sample values and dividing by the sample size (nn).
  • The sum of deviations from the sample mean is always zero: ∑i=1n(Xi−Xˉ)=0\sum_{i=1}^{n}(X_i - \bar{X}) = 0.
  • The biased sample variance estimator (s2s^2) uses the sum of squared deviations divided by nn 68. sbiased2=∑i=1n(Xi−Xˉ)2ns^2_{biased} = \frac{\sum_{i=1}^{n}(X_i - \bar{X})^2}{n}
  • The unbiased sample variance estimator uses the sum of squared deviations divided by n−1n-1. This is preferred for exams unless otherwise stated. sunbiased2=∑i=1n(Xi−Xˉ)2n−1s^2_{unbiased} = \frac{\sum_{i=1}^{n}(X_i - \bar{X})^2}{n-1}
  • The standard deviation is the square root of the variance.

Always compute the unbiased variance by dividing by (n−1)(n-1) unless instructed otherwise.

📝 Example: Calculating sample moments for Alpha Corporation stock returns (24%, 34%, 18%, 54%, 10%).

  1. Calculate the sample mean: Xˉ=(24+34+18+54+10)/5=28.8%\bar{X} = (24+34+18+54+10)/5 = 28.8\%.
  2. Calculate deviations from the mean and square them to find ∑(Xi−Xˉ)2=0.1152\sum(X_i - \bar{X})^2 = 0.1152 69.
  3. Calculate unbiased variance: s2=0.1152/(5−1)=0.0288s^2 = 0.1152 / (5-1) = 0.0288.
  4. Calculate unbiased standard deviation: s=0.0288≈0.1697s = \sqrt{0.0288} \approx 0.1697 or 16.97%16.97\%.

5.2 Population vs. sample moments

  • Population moments describe the entire population, like the population mean (μ\mu).
  • Sample moments are calculated from a subset of the population (a sample) to estimate population moments.
  • The sample mean (Xˉ\bar{X}) is an estimate of the population mean (μ\mu), denoted with a hat (μ^\hat{\mu}) 70.
  • The variance of the mean estimator decreases as the sample size (nn) increases.

A larger sample size leads to better estimates of population parameters 71.

MomentPopulation MeasureSample Estimator
First (Mean)μ\muXˉ\bar{X}
Second (Var.)σ2\sigma^2s2s^2

5.3 Estimators and bias

  • A point estimate is a single sample value used to estimate a population parameter.
  • An estimator is the formula used to compute a point estimate.
  • The bias of an estimator is the difference between its expected value and the true population value 72. Bias(θ^)=E(θ^)−θ\text{Bias}(\hat{\theta}) = E(\hat{\theta}) - \theta
  • The sample mean (Xˉ\bar{X}) is an unbiased estimator of the population mean (μ\mu) because E(Xˉ)=μE(\bar{X}) = \mu.
  • The biased sample variance estimator (sbiased2s^2_{biased}) uses nn as the divisor, systematically underestimating σ2\sigma^2 for small samples.
  • The unbiased sample variance estimator (sunbiased2s^2_{unbiased}) uses n−1n-1 as the divisor, making it unbiased.

5.4 Best Linear Unbiased Estimator (BLUE)

  • The Best Linear Unbiased Estimator (BLUE) is the most efficient linear unbiased estimator for a population parameter.
  • When data is independent and identically distributed (i.i.d.), the sample mean (Xˉ\bar{X}) is BLUE for the population mean (μ\mu) 73.
  • Linear estimators are computed as weighted sums of observations: ∑wiXi\sum w_i X_i. For the mean, weights are wi=1/nw_i = 1/n.

5.5 Consistency, Law of Large Numbers (LLN), and Central Limit Theorem (CLT)

  • A consistent estimator reduces bias and variance as sample size (nn) increases.
  • The Law of Large Numbers (LLN) ensures that consistent estimators approach the true population value with large samples 74.
  • The Central Limit Theorem (CLT) states that the sampling distribution of the sample mean approaches a normal distribution with mean μ\mu and variance σ2/n\sigma^2/n, regardless of the population's distribution, if nn is large (typically n≥30n \ge 30).
  • The CLT is crucial for hypothesis testing and confidence intervals because it allows inference using the normal distribution.

🔑 Important: The CLT requires a finite variance, while the LLN only requires a finite mean.

5.6 Skewness and Kurtosis

  • Skewness measures the asymmetry of a distribution. It's the standardized third central moment 75.
  • Positive skew (skewed right): Long tail to the right; mean > median > mode.
  • Negative skew (skewed left): Long tail to the left; mode > median > mean 76.
  • Kurtosis measures the "fatness" or "thinness" of a distribution's tails. It's the standardized fourth central moment.
  • A normal distribution has kurtosis = 3.
  • Leptokurtic distributions have kurtosis > 3 (fat tails), indicating a higher probability of extreme values.
  • Platykurtic distributions have kurtosis < 3 (thin tails).
  • Excess kurtosis is kurtosis - 3. A normal distribution has an excess kurtosis of 0 77.
  • In risk management, skewness and kurtosis are vital as actual security returns often deviate from normal distributions, especially in the tails where risk is concentrated.

🔑 Important: High positive kurtosis and negative skewness in returns suggest increased risk.

5.7 Median and quantile estimates

  • The median is the 50th percentile or midpoint of sorted data.
  • It is a robust measure, meaning it is not affected by outliers, unlike the mean 78.
  • For an odd number of observations (nn), the median is the observation at position (n+1)/2(n+1)/2.
  • For an even number of observations (nn), the median is the average of observations at positions n/2n/2 and n/2+1n/2 + 1.
  • Quantiles divide data into equal probability portions (e.g., quartiles). Estimating them involves sorting data and finding specific positions.
  • The Interquartile Range (IQR) is the difference between the 75th and 25th quantiles and is a measure of dispersion robust to outliers.

📝 Example: Estimating the median for returns {30%, 15%, 25%, 21%, 23%}.

  1. Sort data: {30%, 25%, 23%, 21%, 15%}.
  2. The middle value (3rd) is the median: 23%. 📝 Example: Estimating the median for returns {30%, 15%, 25%, 21%, 23%, 28%}.
  3. Sort data: {30%, 28%, 25%, 23%, 21%, 15%}.
  4. Average the two middle values (3rd and 4th): (25% + 23%) / 2 = 24.0% 79.

5.8 Mean of two random variables

  • The mean of two random variables, XX and YY, is estimated by their respective sample means, Xˉ\bar{X} and Yˉ\bar{Y}.
  • If XX and YY are i.i.d., the CLT applies to their mean estimators.
  • A vector of mean estimators [Xˉ,Yˉ][\bar{X}, \bar{Y}] is asymptotically normally distributed if the underlying random variable [X,Y][X, Y] is i.i.d..

5.9 Covariance and correlation between random variables

  • Covariance measures the linear relationship and co-movement between two variables 80.
  • Positive covariance: Variables move in the same direction.
  • Negative covariance: Variables move in opposite directions.
  • The population covariance is Cov(X,Y)=E[(X−E(X))(Y−E(Y))]Cov(X,Y) = E[(X - E(X))(Y - E(Y))].
  • The sample covariance estimator is ∑i=1n(Xi−Xˉ)(Yi−Yˉ)n−1\frac{\sum_{i=1}^{n}(X_i - \bar{X})(Y_i - \bar{Y})}{n-1}.
  • Correlation coefficient standardizes covariance, making it easier to interpret, ranging from -1 to +1. ρ(X,Y)=Cov(X,Y)σXσY\rho(X,Y) = \frac{Cov(X,Y)}{\sigma_X \sigma_Y}

📝 Example: Calculating covariance for Stock A and Stock B returns.

  1. Calculate expected returns for each stock: E(RA)=0.13E(R_A) = 0.13, E(RB)=0.14E(R_B) = 0.14.
  2. Calculate the sum of the product of deviations: ∑(RA,i−E(RA))(RB,i−E(RB))=0.0058\sum (R_{A,i} - E(R_A))(R_{B,i} - E(R_B)) = 0.0058.
  3. Calculate covariance: Cov(RA,RB)=0.0058Cov(R_A, R_B) = 0.0058 81. 📝 Example: Calculating correlation for Stocks A and B.
  4. Given Cov(RA,RB)=0.0058Cov(R_A, R_B) = 0.0058, σ(RA)=0.0529\sigma(R_A) = 0.0529, σ(RB)=0.1114\sigma(R_B) = 0.1114.
  5. ρ(RA,RB)=0.0058/(0.0529×0.1114)≈0.988\rho(R_A, R_B) = 0.0058 / (0.0529 \times 0.1114) \approx 0.988.

5.10 Coskewness and cokurtosis

  • Coskewness measures the third cross-moment, indicating the likelihood of large directional movements in one variable when the other is large.
  • Cokurtosis measures the fourth cross-moment, related to the tail behavior of two variables jointly 82.
  • For bivariate normal distributions, symmetric cokurtosis (k(X,X,Y,Y)k(X,X,Y,Y)) ranges from 1 to 3 and is 1 when correlation is 0, increasing with correlation 83.
  • Asymmetric cokurtosis ranges from -3 to +3 and is linear with correlation 84.

🔑 Important: Coskewness and cokurtosis are important for understanding joint tail risk in financial applications.

🔑 Important: This part of the topic focuses on estimating population moments from sample data and introduces the foundational concepts for hypothesis testing, particularly the Law of Large Numbers and Central Limit Theorem. Understanding unbiased estimators and the properties of skewness and kurtosis is key for analyzing data distributions.

5.11 Estimating population moments

  • Point estimates: Single values from a sample used to estimate population parameters.
  • Estimator: The formula used to calculate a point estimate.

5.12 Estimator properties

  • Bias: The difference between an estimator's expected value and the true population value.
  • BLUE: Best Linear Unbiased Estimator. It offers the minimum variance among all linear unbiased estimators for the population mean.
  • Consistent estimator: As sample size grows, bias shrinks to zero, and variance approaches zero.

5.13 Key theorems

  • Law of Large Numbers (LLN): Sample averages converge to the true population value with many samples.
  • Central Limit Theorem (CLT): For large sample sizes, sums of independent and identically distributed (i.i.d.) random variables follow a normal distribution.

LLN says averages get close; CLT says sums become normal for large samples.

5.14 Higher moments

  • Skewness: Measures asymmetry of a distribution around its mean (third central moment).
  • Kurtosis: Measures tail fatness of a distribution (fourth central moment).

5.15 Median calculation

  • Odd sample size (nn): Median = x(n+1)/2x_{(n+1)/2}
  • Even sample size (nn): Median = 12(xn/2+xn/2+1)\frac{1}{2}(x_{n/2} + x_{n/2+1})

Median formula depends on whether the sample size is odd or even.

5.16 Estimating relationships between variables

5.17 Covariance and correlation

  • Covariance: Measures how two random variables move together relative to their means. Cov(X,Y)=E{[X−E(X)][Y−E(Y)]}\text{Cov}(X,Y) = E\{[X - E(X)][Y - E(Y)]\}
  • Correlation: A standardized measure of association between two random variables. It ranges from -1 to +1.
MeasureFormulaRange
CovarianceE{[X−E(X)][Y−E(Y)]}E\{[X - E(X)][Y - E(Y)]\}(−∞,∞)(-\infty, \infty)
CorrelationCov(X,Y)Var(X)Var(Y)\frac{\text{Cov}(X,Y)}{\sqrt{\text{Var}(X)\text{Var}(Y)}}USDUSD
  • Coskewness: Indicates the likelihood of one variable moving significantly when the other does. It's zero if there's no relationship in the direction of large movements.
  • Cokurtosis: Describes tail dependence for bivariate distributions.
  • Symmetric case: Ranges from +1 to +3. Increases with correlation away from zero.
  • Asymmetric case: Ranges from -3 to +3. Linearly related to correlation.

Cokurtosis captures how tail events of two variables relate, influenced by their correlation.

5.18 Sample calculations example

Sample calculations for mean and variance use sample observations to estimate population values.

A sample calculation for mean and variance is as follows:

YearReturnReturn - Mean(Return - Mean)2^2
10.150.030.0009
20.10-0.020.0004
30.11-0.010.0001
Sum0.360.000.0014
  • Sum of returns: 0.36
  • Sample size (nn): 3
  • Sample mean: 0.36/3=0.120.36 / 3 = 0.12 (unbiased estimate)
  • Sum of squared deviations: 0.0014
  • Estimated variance: 0.0014/(3−1)=0.00070.0014 / (3-1) = 0.0007 (unbiased estimate)
  • Estimated standard deviation: 0.0007≈0.0265\sqrt{0.0007} \approx 0.0265

Note: The example in the source document had a sum of squared deviations of 0.338 for an estimated variance of 0.0169. The values here are adjusted for clarity based on the calculation steps described 87.

🔑 Important: Understanding the properties of estimators (bias, BLUE, consistency) and key theorems like the LLN and CLT is crucial for interpreting sample data 86.

6. Sample moments and hypothesis testing (part 2)

6.1 Hypothesis testing basics

Hypothesis testing is a statistical method to assess a statement about a population parameter. It helps determine if a hypothesis is reasonable or should be rejected.

A hypothesis is a statement about a population parameter, like the mean return (μ\mu). Hypothesis testing uses sample statistics to evaluate this statement at a given significance level.

Key components of a hypothesis test include:

  • Null hypothesis (H0H_0): Specifies a value for the population parameter that is assumed to be true. It always includes an "equal to" condition.
  • Alternative hypothesis (HAH_A): Specifies the values of the test statistic that would lead to rejecting the null hypothesis. It is often what the researcher aims to support.
  • Test statistic: Calculated from sample data.
  • Significance level (α\alpha): The probability of rejecting the null hypothesis when it is true (Type I error).
  • Critical value: The threshold value compared to the test statistic to decide on rejecting H0H_0.
  • Decision rule: The rule for rejecting or failing to reject H0H_0 based on the comparison.

Hypothesis tests assess population parameters using sample data.

6.2 One-tailed versus two-tailed tests

The alternative hypothesis dictates whether a test is one-tailed or two-tailed.

  • Two-tailed test: Used when testing if a parameter is simply different from a hypothesized value (HA:μ≠μ0H_A: \mu \neq \mu_0). It considers deviations above and below the hypothesized value and uses two critical values.

  • Example: Testing if mean return is not equal to zero.

  • One-tailed test: Used when testing if a parameter is greater than or less than a hypothesized value (HA:μ>μ0H_A: \mu > \mu_0 or HA:μ<μ0H_A: \mu < \mu_0).

  • Upper tail test: H0:μ≤μ0H_0: \mu \le \mu_0 versus HA:μ>μ0H_A: \mu > \mu_0.

  • Lower tail test: H0:μ≥μ0H_0: \mu \ge \mu_0 versus HA:μ<μ0H_A: \mu < \mu_0.

One-tailed tests assess directionality; two-tailed tests assess difference.

6.3 Type I and Type II errors

Hypothesis testing involves potential errors due to sampling variability.

  • Type I error: Rejecting the null hypothesis when it is actually true. The probability of this error is the significance level, α\alpha.
  • Type II error: Failing to reject the null hypothesis when it is actually false. The probability of this error is denoted as β\beta.

α\alpha = P(Type I error), β\beta = P(Type II error).

The power of a test is the probability of correctly rejecting a false null hypothesis, which is 1−β1 - \beta.

  • Decreasing α\alpha (e.g., from 5% to 1%) increases β\beta and reduces the power of the test.
  • Increasing the sample size can decrease β\beta and increase power for a given α\alpha.

6.4 Test statistics and confidence intervals

Test statistics quantify how far a sample statistic deviates from the hypothesized population parameter.

The general formula for a test statistic is: Test Statistic=Sample Statistic−Hypothesized ValueStandard Error of the Sample Statistic\text{Test Statistic} = \frac{\text{Sample Statistic} - \text{Hypothesized Value}}{\text{Standard Error of the Sample Statistic}}

The standard error measures the variability of the sample statistic.

6.5 z-test and t-test

The choice between a z-test and a t-test depends on whether the population variance is known and the sample size.

TestPopulation Variance (σ2\sigma^2)Sample Size (nn)Distribution Used
z-testKnownAnyStandard Normal
z-testUnknownLarge (n≥30n \ge 30)Standard Normal
t-testUnknownSmall (n<30n < 30)t-distribution
t-testUnknownLarge (n≥30n \ge 30)t-distribution
  • The z-statistic formula uses σ\sigma (population standard deviation) when known, or ss (sample standard deviation) when nn is large.
  • The t-statistic formula uses ss and involves degrees of freedom (n−1n-1). It is preferred when σ\sigma is unknown, especially for small samples.

The t-test is more conservative when population variance is unknown.

6.6 p-value

The p-value is the probability of observing a test statistic as extreme as, or more extreme than, the one calculated, assuming the null hypothesis is true.

  • For a two-tailed test, it's the sum of the probabilities in both tails beyond the computed test statistic's absolute value.
  • For a one-tailed test, it's the probability in the relevant tail.

A smaller p-value indicates stronger evidence against the null hypothesis.

Reject H0H_0 if p-value ≤α\le \alpha.

6.7 Relation between confidence intervals and hypothesis tests

Confidence intervals (CIs) and hypothesis tests are closely related. A CI provides a range of plausible values for a population parameter.

  • For a two-tailed test of H0:μ=μ0H_0: \mu = \mu_0 at significance level α\alpha, if μ0\mu_0 falls outside the (1−α)×100%(1-\alpha) \times 100\% confidence interval, we reject H0H_0.
  • If μ0\mu_0 falls inside the CI, we fail to reject H0H_0.

The critical values used in hypothesis tests are directly linked to the confidence levels of CIs.

A (1−α)×100%(1-\alpha) \times 100\% CI corresponds to a two-tailed test at significance level α\alpha.

A 95% CI means we are 95% confident that the true population parameter lies within that range. If the hypothesized value is not in this range, we reject the null hypothesis.

🔑 Important: Statistical significance does not always imply practical significance; consider transaction costs, taxes, and risk.

6.8 Advanced hypothesis testing concepts

6.9 Testing the difference between two population means

Testing if two population means are equal is equivalent to testing if the difference between them is zero. If two series X and Y are independent and identically distributed (i.i.d.) with covariance cov(X,Y), the test statistic is: Z=(Xˉ−Yˉ)−(μX−μY)σX2nX+σY2nY+2cov(X,Y)nXnYZ = \frac{(\bar{X} - \bar{Y}) - (\mu_X - \mu_Y)}{\sqrt{\frac{\sigma_X^2}{n_X} + \frac{\sigma_Y^2}{n_Y} + 2 \frac{\text{cov}(X,Y)}{n_X n_Y}}} This statistic follows a standard normal distribution under the null hypothesis H0:μX=μYH_0: \mu_X = \mu_Y.

6.10 Multiple hypothesis testing

Multiple testing occurs when several hypotheses are tested on the same dataset. This increases the overall probability of making a Type I error.

  • If you test kk hypotheses, each at significance level α\alpha, the probability of at least one Type I error increases significantly beyond α\alpha.
  • This can lead to biased results, as seemingly significant findings might arise purely by chance 88.

Multiple testing inflates the probability of a Type I error.

🔑 Important: The most likely bias from testing multiple hypotheses on one dataset is an increase in the Type I error rate.

6.11 The hypothesis testing framework

  • Hypothesis testing involves several steps. These include stating null and alternative hypotheses. You must also select the correct test statistic and significance level. A decision rule is specified. Then, a sample statistic is calculated. Finally, a decision is made about the hypotheses.

  • The test statistic is the basis for deciding whether to reject a hypothesis.

6.12 Types of alternative hypotheses

  • A two-tailed test uses a two-sided alternative hypothesis (e.g., HA:μ≠μ0H_A: \mu \neq \mu_0).
  • A one-tailed test uses a one-sided alternative hypothesis (e.g., HA:μ>μ0H_A: \mu > \mu_0 or HA:μ<μ0H_A: \mu < \mu_0).

6.13 Decision rules and confidence intervals

  • Hypothesis testing compares a calculated test statistic to a critical value. This comparison occurs at a stated level of significance, which defines the decision rule.

  • You reject a hypothesis about a population parameter if the sample statistic falls outside a confidence interval for the hypothesized value. This is done at the chosen significance level.

6.14 The p-value

  • The p-value is the probability of observing a test statistic that would lead to rejecting the null hypothesis. This assumes the null hypothesis is true.
  • It represents the smallest significance level at which the null hypothesis can be rejected 104.

6.15 Specific test statistics

6.16 T-test for population mean

  • For testing a population mean, the t-statistic is computed. This statistic uses n−1n-1 degrees of freedom.

  • The formula for the t-statistic is: t=xˉ−μ0s/nt = \frac{\bar{x} - \mu_0}{s / \sqrt{n}}.

  • To conduct a t-test, you compare the calculated t-statistic to a critical t-value. This comparison is made at the desired significance level and with the correct degrees of freedom.

6.17 Test statistic for difference of population means

  • The appropriate test statistic to check if two population means are equal is: z=xˉ1−xˉ2σ12n1+σ22n2z = \frac{\bar{x}_1 - \bar{x}_2}{\sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}}.
  • This test statistic follows a standard normal distribution when the null hypothesis is true.

6.18 Multiple testing issues

  • Multiple testing means conducting several hypothesis tests on the same data.
  • The issue is that the alpha level (significance level) is accurate for only one test.
  • When you perform more tests, the actual alpha for the repeated testing increases. A larger alpha means a higher probability of a Type I error.

🔑 Important: With multiple tests, the chance of a Type I error (rejecting a true null hypothesis) increases significantly because the overall alpha level inflates.

🔑 Important: Hypothesis testing does not prove a hypothesis; conclusions are either to reject the null or fail to reject it 105.

7. Linear regression and model diagnostics (part 1)

7.1 Regression analysis overview

  • Regression analysis: Measures how changes in dependent variables are explained by independent variables.
  • Linear regression models these relationships using linear equations.
  • Dependent variable (Y): The variable being explained.
  • Independent variable (X): The variable used to explain Y.

The core idea is to find a line that best fits the data points, explaining Y based on X.

7.2 The regression equation

  • The general form of a simple linear regression equation is: Y=α+β×X+εY = \alpha + \beta \times X + \varepsilon.
  • α\alpha is the intercept, representing Y when X is 0. If X cannot be 0, α\alpha ensures the mean of Y is on the line.
  • β\beta is the slope coefficient, showing Y's sensitivity to a one-unit change in X.
  • ε\varepsilon is the random error term, the unexplained part of Y 106.

7.3 Conditions for linear regression

  • The relationship between Y and X must be linear.
  • The error term must be additive, with constant variance.
  • All X variables must be observable.
  • Linearity applies to both variables and coefficients. Non-linear relationships can be transformed.

Transformations allow fitting non-linear relationships using linear methods 107.

7.4 Dummy variables

  • Dummy variables are binary (0 or 1).
  • They quantify the impact of qualitative variables.
  • Example: A January dummy variable indicates if a stock return occurred in January.

7.5 Ordinary Least Squares (OLS) estimation

  • OLS estimates α\alpha and β\beta by minimizing the sum of squared residuals.
  • The estimated slope is calculated as β^=Cov(X,Y)Var(X)\hat{\beta} = \frac{Cov(X, Y)}{Var(X)}.
  • The estimated intercept is α^=Yˉ−β^Xˉ\hat{\alpha} = \bar{Y} - \hat{\beta}\bar{X} 108.

7.6 Interpreting OLS results

  • Intercept (α\alpha): The expected value of Y when all independent variables are zero.
  • Slope coefficient (β\beta): The estimated change in Y for a one-unit change in X, holding other variables constant (in multiple regression).

In multiple regression, slope coefficients are often called partial slope coefficients 109.

7.7 Coefficient of determination (R-squared)

  • R-squared (R²)*: Measures the proportion of variation in Y explained by the independent variable(s).
  • For a single independent variable, R2=rX,Y2R^2 = r_{X,Y}^2, where rX,Yr_{X,Y} is the correlation between X and Y.

7.8 Assumptions of OLS estimation

  • The expected value of the error term, conditional on X, is zero (E(εi∣Xi)=0E(\varepsilon_i | X_i) = 0).
  • All (X, Y) observations are independent and identically distributed (i.i.d.).
  • The variance of X is positive.
  • The variance of the errors is constant (homoskedasticity).
  • Large outliers are unlikely.

Violations can lead to bias, such as from omitted variables or sample selection.

7.9 Violations of assumptions

Violation TypeDescription
Survivorship/Selection BiasObservations are collected after events, or contingent on specific outcomes.
Simultaneity BiasX and Y values are determined simultaneously.
Omitted VariablesImportant explanatory variables are excluded from the model.
Attenuation BiasX variables are measured with error, leading to underestimation of coefficients.

110

7.10 Properties of OLS estimators

  • OLS estimators (α,β\alpha, \beta) are random variables with sampling distributions.
  • Unbiased estimator: The expected value of the estimator equals the population parameter.
  • Consistent estimator: Accuracy increases as sample size increases (due to CLT for large samples).
  • Sampling distributions of α\alpha and β\beta are approximately normal, enabling statistical inference.
  • The variance of β\beta increases with error variance and decreases with X variance.

Higher variance in X means a more representative sample, leading to a more reliable slope estimate 111.

7.11 Hypothesis testing and confidence intervals

  • Hypothesis testing for regression coefficients follows these steps:
  1. Specify the hypothesis.
  2. Calculate the test statistic.
  3. Compare the statistic to the critical value to decide on rejection.
  • The standard error of the regression coefficient is SbS_b.
  • The t-statistic for testing H0:β=β0H_0: \beta = \beta_0 is t=β−β0Sbt = \frac{\beta - \beta_0}{S_b}.

Reject H0H_0 if the absolute t-statistic exceeds the critical t-value (with n-2 degrees of freedom).

7.12 Confidence intervals

  • Confidence interval for β\beta: β^±(tc×Sb)\hat{\beta} \pm (t_c \times S_b), where tct_c is the critical t-value 113.
  • If the hypothesized value β0\beta_0 is outside the interval, reject H0H_0.

7.13 P-value

  • The p-value is the smallest significance level where H0H_0 can be rejected.
  • Reject H0H_0 if the p-value is less than the significance level.

A p-value of 0.026 and a significance level of 5% mean we reject H0H_0 114.

🔑 Important: Hypothesis tests and confidence intervals for slope coefficients are directly related; a hypothesized value falling outside the confidence interval leads to rejecting the null hypothesis 115.

7.14 Regression model fit and R-squared

  • The strength of a regression model increases as data points get closer to the regression line. This means errors are smaller.
  • Ordinary Least Squares (OLS) estimation aims to minimize the sum of squared differences between predicted and actual values.
  • The total variation in the dependent variable (YY) can be broken down into explained and unexplained components.

The total variation in YY is expressed as: TSS=ESS+RSSTSS = ESS + RSS

Where:

  • TSSTSS = total sum of squares (total variation in YY)
  • ESSESS = explained sum of squares (variation in YY explained by the model)
  • RSSRSS = residual sum of squares (unexplained variation in YY).

The coefficient of determination (R2R^2) measures the proportion of variation in YY explained by the regression model. R2=ESS/TSSR^2 = ESS/TSS 123.

  • In a multiple regression, R2R^2 is the square of the correlation between YY and its predicted value.
  • However, R2R^2 alone can be misleading because it tends to increase when more independent variables are added, even if they are not significant. This can lead to overestimation of explanatory power.
  • R2R^2 is also not comparable across models with different dependent variables.
  • There are no universal thresholds for R2R^2 to define a "good" model. Low R2R^2 models can still offer valuable insights for noisy variables like currency values.

7.15 Adjusted R-squared

  • The adjusted R-squared adjusts R2R^2 for the number of independent variables in the model. This helps to overcome the issue of overestimation.

  • The formula for adjusted R2R^2 is: Adjusted R2=1−(1−R21)×n−1n−k−1\text{Adjusted } R^2 = 1 - \left( \frac{1 - R^2}{1} \right) \times \frac{n - 1}{n - k - 1} Where:

  • nn = number of observations

  • kk = number of independent variables.

  • Adjusted R2R^2 is always less than or equal to R2R^2.

  • Adding a new variable might increase R2R^2, but it could decrease adjusted R2R^2.

  • Adjusted R2R^2 can sometimes be negative if R2R^2 is very low.

📝 Example: A regression using 5 independent variables has a TSSTSS of 460 and an RSSRSS of 170 over 60 months.

  • R2=(460−170)/460=290/460=0.630R^2 = (460 - 170) / 460 = 290 / 460 = 0.630 or 63%. This means the 5 variables explain 63% of the variation in returns.
  • Adjusted R2=1−((1−0.630)∗(60−1)/(60−5−1))=1−(0.370∗59/54)=1−0.406=0.594R^2 = 1 - ((1 - 0.630) * (60 - 1) / (60 - 5 - 1)) = 1 - (0.370 * 59 / 54) = 1 - 0.406 = 0.594 or 59.4% 124.

📝 Example: Adding four more variables to the previous regression increases R2R^2 from 63% to 65%.

  • Original model: n=60n=60, k=5k=5, R2=0.63R^2=0.63, Adjusted R2=0.594R^2=0.594.
  • New model: n=60n=60, k=9k=9, R2=0.65R^2=0.65.
  • New adjusted R2=1−((1−0.65)∗(60−1)/(60−9−1))=1−(0.35∗59/50)=1−0.413=0.587R^2 = 1 - ((1 - 0.65) * (60 - 1) / (60 - 9 - 1)) = 1 - (0.35 * 59 / 50) = 1 - 0.413 = 0.587 or 58.7%. The analyst would prefer the first model (with 5 variables) because its adjusted R2R^2 is higher (59.4% vs 58.7%), indicating better explanatory power per variable.

7.16 Hypothesis testing for individual coefficients

  • In multiple regression, the magnitude of coefficients alone doesn't show a variable's importance. Hypothesis testing is needed to assess their significant contribution.
  • The t-statistic is used to test the significance of individual coefficients. t=bj−βjSE(bj)t = \frac{b_j - \beta_j}{SE(b_j)}
  • For a multiple regression, the t-statistic has (n−k−1n - k - 1) degrees of freedom, where nn is the number of observations and kk is the number of independent variables.

🔑 Important: The most common test is for statistical significance:

  • Null Hypothesis (H0H_0): bj=0b_j = 0 (the coefficient is not significantly different from zero)
  • Alternative Hypothesis (HAH_A): bj≠0b_j \neq 0 (the coefficient is significantly different from zero).

📝 Example: Test the statistical significance of the Price-to-Dividend Ratio (PRPR) in explaining future 10-year real earnings growth (EG10EG10) using the yield curve slope (YCSYCS).

  • Given: n=46n=46.
  • We want to test H0:bPR=0H_0: b_{PR} = 0 versus HA:bPR≠0H_A: b_{PR} \neq 0 at a 10% significance level.
  • The critical t-value for a 10% significance level with (46−k−146 - k - 1) degrees of freedom would be needed to make the decision 125.

🔑 Important: Higher R2R^2 is not always better; consider adjusted R2R^2 to balance fit with model complexity.

🔑 Important: Always test the statistical significance of individual coefficients to confirm their explanatory power.

8. Linear regression and model diagnostics (part 2)

8.1 Hypothesis testing and model evaluation

  • A t-statistic greater than the critical t-value allows rejection of the null hypothesis. This means the regression coefficient is statistically significant.
  • The confidence interval for a regression coefficient is calculated as: Estimate±(Criticalt−value)∗(Standarderror)Estimate ± (Critical t-value) * (Standard error).

8.1.1 The F-test

  • The F-test evaluates a model against competing partial models. It checks if additional variables improve the model's explanatory power.
  • To test if two additional variables (β₂ and β₃) contribute meaningfully: H₀: β₂ = β₃ = 0 versus H₁: either β₂ ≠ 0 or β₃ ≠ 0.
  • The F-statistic for multiple regression is calculated as: F=(RSSP−RSSF)/qRSSF/(n−kF−1)F = \frac{(RSS_P - RSS_F) / q}{RSS_F / (n - k_F - 1)} Where:
  • RSS_P is the residual sum of squares of the partial (restricted) model.
  • RSS_F is the residual sum of squares of the full model.
  • q is the number of variables removed.
  • n is the number of observations.
  • k_F is the number of independent variables in the full model 126.
  • If the calculated F-statistic exceeds the critical F-value, the full model significantly explains the variation in Y.
  • To test if all k independent variables contribute to explaining Y: H₀: β₁ = β₂ =... = βk = 0 versus H₁: at least one βⱼ ≠ 0.
  • The F-statistic is calculated as: F=ESS/kRSS/(n−k−1)F = \frac{ESS / k}{RSS / (n - k - 1)} Where:
  • ESS is the explained sum of squares.
  • RSS is the residual sum of squares.
  • k is the number of independent variables.
  • n is the number of observations 128.

📝 Example: A researcher wants to know if two extra variables improve a stock return model. With 64 observations, the full model has RSS = 6,650, and the restricted model has RSS = 7,140. The full model has 3 variables (k_F = 3). The F-statistic is: F=(7,140−6,650)/26,650/(64−3−1)=2456,650/60≈2.21F = \frac{(7,140 - 6,650) / 2}{6,650 / (64 - 3 - 1)} = \frac{245}{6,650 / 60} \approx 2.21 The critical F-value (2 df numerator, 60 df denominator) at 5% is 3.15. Since 2.21 < 3.15, the extra variables do not significantly improve the model 127.

8.1.2 R-squared and adjusted R-squared

  • R² measures the proportion of variance in the dependent variable explained by the regression model. R² = ESS / TSS.
  • Adjusted R² accounts for the number of independent variables. It penalizes the addition of variables that do not significantly improve the model 130. Adjusted R2=1−(1−R2)(n−1)(n−k−1)Adjusted\ R^2 = 1 - \frac{(1 - R^2)(n - 1)}{(n - k - 1)} Where:
  • n is the number of observations.
  • k is the number of independent variables.
  • R² generally increases when adding variables, even irrelevant ones. Adjusted R² may decrease if a new variable adds little explanatory power.

🔑 Important: R² does not confirm that the chosen independent variables are the most appropriate or that all relevant variables have been included 129.

8.2 Regression diagnostics

8.2.1 Heteroskedasticity

  • Homoskedasticity means the variance of residuals is constant across all observations.
  • Heteroskedasticity occurs when the residual variance is not constant.
  • Unconditional heteroskedasticity is not related to independent variables' levels. It causes minor problems.
  • Conditional heteroskedasticity is related to independent variable levels. It significantly impacts statistical inference.

Effects of Heteroskedasticity:

  • Coefficient estimates (bⱼ) remain consistent and unbiased.
  • Standard errors are unreliable.
  • Hypothesis testing becomes unreliable due to faulty standard errors.

Detecting Heteroskedasticity:

  • A scatterplot of residuals versus independent variables can reveal patterns.
  • A chi-squared test:
  1. Regress Y on X variables using OLS and obtain residuals.
  2. Regress squared residuals on the original X variables.
  3. Calculate χ² = nR² from the second regression.
  4. Compare χ² to critical value with k × (k + 3) / 2 degrees of freedom.
  • If χ² > critical χ², reject the null hypothesis of no conditional heteroskedasticity 133.

Correcting for Heteroskedasticity:

  • Use White standard errors (heteroskedasticity-consistent standard errors) for hypothesis testing.

8.2.2 Multicollinearity

  • Perfect collinearity: one independent variable is a perfect linear combination of others (e.g., X₃ = 2X₁ + 3X₂). This violates regression assumptions.
  • Multicollinearity: two or more independent variables are highly correlated. It does not violate assumptions but compromises reliability.

Effect of Multicollinearity:

  • Increases the probability of Type II errors (failing to reject a false null hypothesis).
  • Makes it difficult to determine the individual contribution of each independent variable.

Detecting Multicollinearity:

  • High R² for the overall model, but insignificant t-tests for individual coefficients140.
  • Calculate the Variance Inflation Factor (VIF) for each variable.
  • VIF is calculated using the R² from regressing an independent variable on all others: VIF=11−Rj2VIF = \frac{1}{1 - R_j^2}
  • A VIF > 10 (meaning R_j² > 90%) is problematic.

Correcting Multicollinearity:

  • Omit one or more of the correlated independent variables.
  • Statistical procedures like stepwise regression can help identify variables to remove.

📝 Example: A regression has a high R² (0.95), but all individual t-tests are insignificant (p-values > 0.10). This indicates multicollinearity, where variables together explain much, but their individual impacts are unclear 135.


8.3 Model specification issues

8.3.1 Omitting relevant variables

  • Omitted variable bias occurs when:
  1. The omitted variable is correlated with included independent variables.
  2. The omitted variable is a determinant of the dependent variable.
  • Bias occurs regardless of sample size and makes OLS estimators inconsistent.
  • The included variables' coefficients absorb the omitted variable's impact, leading to biased estimates.

8.3.2 Including irrelevant variables

  • Including irrelevant variables does not cause serious challenges or bias the coefficients.
  • It typically leads to a decline in the adjusted R² unless the variable adds significant explanatory power 136.

8.3.3 Bias-Variance Tradeoff

  • Overfitting: Models with too many variables explain in-sample data well but perform poorly out-of-sample. They have low bias and high variance.
  • Underfitting: Smaller models with fewer variables have higher bias and lower variance.

Strategies for Bias-Variance Tradeoff:

  • General-to-specific model: Start with a large model and drop variables with the smallest t-statistic.
  • m-fold cross-validation: Split data into training and validation sets to assess out-of-sample performance.

8.4 Residual analysis and outliers

8.4.1 Residual plots

  • Basic residual plots show residuals against predicted values of the dependent variable.
  • Ideally, residuals should be small and unrelated to any explanatory variable.
  • Standardized residuals (residuals divided by their standard deviation) can help identify outliers. Values over ±4 are problematic.

8.4.2 Identifying outliers

  • Outliers can skew estimated regression parameters.
  • Cook's measure quantifies an observation's influence: Dj=rj2k+1×11−hjjD_j = \frac{r_j^2}{k+1} \times \frac{1}{1 - h_{jj}} Where:
  • rⱼ² is the squared residual for observation j.
  • k is the number of independent variables.
  • hⱼⱼ is the leverage of observation j.
  • Large Cook's measure values (Dj > 1) indicate an outlier141.

🔑 Important: OLS is the Best Linear Unbiased Estimator (BLUE) when its assumptions (linearity, homoskedasticity, independence of residuals) are met 138.

🔑 Important: The most exam-relevant takeaway is understanding the consequences of heteroskedasticity and multicollinearity, and the trade-offs in model specification, such as the bias-variance tradeoff 132 134 137.

9. Time series analysis and forecasting (part 1)

9.1 Covariance stationarity

  • A time series is data collected over regular intervals.
  • For forecasting, a time series must be covariance stationary. This means its past patterns are expected to continue.

Requirements for covariance stationarity

  • A time series is covariance stationary if it meets three conditions:
  1. A stable mean over time.
  2. A finite and stable variance over time.
  3. A stable covariance structure over time 142.

Covariance structure and lags

  • Covariance structure refers to covariances between values at different lags (periods apart).
  • Lag τ\tau compares values τ\tau periods apart.

Autocovariance and autocorrelation functions

  • Autocovariance at lag τ\tau is the covariance between the current value and the value τ\tau periods ago.

  • The autocovariance function includes autocovariances for all lags.

  • For a stationary series, the autocovariance function is stable over time.

  • The autocorrelation function (ACF) is found by dividing autocovariances by the variance.

  • ACFs range from -1 to +1 and show the strength of relationships at different lags.

  • For a covariance stationary series, autocorrelations approach zero as lags increase 143.

  • The partial autocorrelation function controls for intermediate lags.

  • Partial autocorrelations often drop sharply after a few lags.

  • Significant partial autocorrelations suggest lags for inclusion in an AR model.

ACF decays gradually; partial ACF often cuts off sharply.

9.2 White noise process

  • White noise is a serially uncorrelated series with a mean of zero and constant variance.
  • Independent white noise also means observations are independent.
  • Normal (Gaussian) white noise is independent white noise that follows a normal distribution 144.

Purpose of white noise

  • A forecasting model's errors should follow a white noise process.

  • If errors are not white noise, the model can be improved.

  • Wold's theorem states any covariance stationary process can be modeled as an infinite distributed lag of white noise.

  • This leads to the general linear process: yt=∑i=0∞biϵt−iy_t = \sum_{i=0}^{\infty} b_i \epsilon_{t-i} 145.

9.3 Autoregressive (AR) models

  • Autoregressive (AR) models regress a variable on its past values.
  • The AR model is: yt=d+Φyt−1+ϵty_t = d + \Phi y_{t-1} + \epsilon_t.
  • dd is the intercept.
  • Φ\Phi is the coefficient for the lagged variable.
  • ϵt\epsilon_t is a white noise shock.

Covariance stationarity in AR models

  • For an AR process to be covariance stationary, ∣Φ∣<1|\Phi| < 1.
  • For an AR(p) process, the sum of all coefficients should be less than 1.

Mean reversion

  • The long-run mean reverting level for AR is d1−Φ\frac{d}{1-\Phi}.
  • This level acts as an attractor, pulling the series back over time 146.

Yule-Walker equations

  • The Yule-Walker equations estimate AR parameters using autocovariances.
  • For AR processes, autocorrelations decay geometrically.

AR processes exhibit gradual autocorrelation decay.

9.4 Moving Average (MA) models

  • Moving Average (MA) models regress a variable on current and past unobserved white noise error terms.
  • MA models are always covariance stationary.
  • The MA model is: yt=μ+ϵt+θϵt−1y_t = \mu + \epsilon_t + \theta \epsilon_{t-1}.
  • μ\mu is the mean of the series.
  • θ\theta is the coefficient for the lagged error term 147.

Autocorrelation cutoff

  • A key feature of MA processes is the autocorrelation cutoff.
  • Autocorrelations become zero after the last lagged error term. For MA this is after lag 1 1.

MA processes show autocorrelation cutoff.

  • The variance of an MA(q) process is σy2=σϵ2(1+θ12+⋯+θq2)\sigma_y^2 = \sigma_{\epsilon}^2 (1 + \theta_1^2 + \dots + \theta_q^2) 148.

9.5 Lag operators

  • The lag operator (L) shifts a time series value back by one period: Lyt=yt−1L y_t = y_{t-1}.
  • Applying the lag operator mm times: Lmyt=yt−mL^m y_t = y_{t-m}.

Lag polynomials and invertibility

  • A lag polynomial is an expression involving lag operators, like (1+0.7L+0.4L2)(1 + 0.7L + 0.4L^2).
  • An AR process is covariance stationary only if its lag polynomial is invertible.
  • Invertibility is used in the Box-Jenkins methodology to select models 149.

Invertible lag polynomials are key for AR stationarity.

9.6 Autoregressive Moving Average (ARMA) models

  • Autoregressive Moving Average (ARMA) models combine AR and MA components.
  • They capture series influenced by both lagged values and lagged shocks.
  • The ARMA(1,1) model is: yt=d+Φyt−1+ϵt+θϵt−1y_t = d + \Phi y_{t-1} + \epsilon_t + \theta \epsilon_{t-1}.

ARMA stationarity and autocorrelations

  • For ARMA stationarity, ∣Φ∣<1|\Phi| < 1 is required.

  • Autocorrelations in ARMA models decay gradually, similar to AR processes 150.

  • ARMA models can be generalized to ARMA(p,q), with pp AR lags and qq MA lags.

9.7 Model selection and evaluation

  • If an ACF cuts off abruptly, consider an MA process.
  • If an ACF decays gradually, consider an AR or ARMA process.
  • Periodic spikes in ACF suggest seasonality, favoring AR or ARMA 151.

Sample autocorrelations and residuals

  • Sample autocorrelations and partial autocorrelations use sample data to select and validate models.
  • If a model fits well, residual autocorrelations should not be statistically significant.

Testing residual autocorrelations

  • The Box-Pierce (BP) Q-statistic jointly tests if all residual autocorrelations are zero.
  • The Ljung-Box (LB) Q-statistic is preferred for smaller sample sizes (T≤100T \le 100).

Q=T(T+2)∑i=1hri2T−iQ = T(T+2) \sum_{i=1}^{h} \frac{r_i^2}{T-i} 152.

LB statistic is better for small samples.

9.8 Modeling seasonality

  • Seasonality shows a recurring pattern at the same time each year.
  • For pure AR or MA processes, seasonality can be modeled by including seasonal lags (e.g., lag 4 for quarterly data).
  • An ARMA model with seasonality is denoted ARMA(p,q) × (ps,qs), where ps,qsp_s, q_s are 0 or 1 153.

AR and ARMA models can capture seasonality.

🔑 Important: Understanding the decay (gradual for AR/ARMA, cutoff for MA) of ACFs is crucial for model selection.

🔑 Important: A time series must be covariance stationary for its past values to reliably predict its future.

9.9 Time trends

Non-stationary time series can have deterministic or stochastic trends. Time trends are a type of deterministic trend.

They indicate a consistent upward or downward movement over time.

  • Linear time trend: The series changes by a constant amount each period. This is modeled as yt=δ0+δ1t+ϵty_t = \delta_0 + \delta_1 t + \epsilon_t, where ϵt\epsilon_t is a white noise process. This model assumes observations depend on time.
  • Limitations of linear trends: Linear models can produce unrealistic negative values for quantities or prices. They also imply a decreasing rate of growth over time for upward trends.

Non-linear trends are often more suitable for financial and economic data.

  • Polynomial time trend: Uses higher-degree polynomials. A second-degree quadratic model is yt=δ0+δ1t+δ2t2+ϵty_t = \delta_0 + \delta_1 t + \delta_2 t^2 + \epsilon_t.
  • Log-linear time trend: Represents a constant growth rate. Modeled as ln⁡(yt)=δ0+δ1t+ϵt\ln(y_t) = \delta_0 + \delta_1 t + \epsilon_t.
  • Log-quadratic model: Extends the log-linear model with a quadratic term: ln⁡(yt)=δ0+δ1t+δ2t2+ϵt\ln(y_t) = \delta_0 + \delta_1 t + \delta_2 t^2 + \epsilon_t.

Estimating trend models uses regression, provided ϵt\epsilon_t is white noise. If not, regression results for significance and fit can be misleading.

🔑 Important: A constant growth rate is modeled with a log-linear trend, not a linear one.

9.10 Forecasting with time trends

Forecasts can be made using the estimated trend model. For a linear trend yt=δ0+δ1t+ϵty_t = \delta_0 + \delta_1 t + \epsilon_t, the forecast for hh periods ahead is yt+h=δ0+δ1(t+h)+ϵt+hy_{t+h} = \delta_0 + \delta_1 (t+h) + \epsilon_{t+h}.

Confidence intervals can be placed around forecasts if ϵt\epsilon_t is normally distributed white noise.

  • Detrended series: Removing the trend component results in a detrended series. This series may be covariance stationary but not white noise.
  • Further modeling: If the detrended series is not white noise, autoregressive (AR), moving average (MA), or ARMA techniques can forecast it.

🔑 Important: Trend models are often the first step; subsequent analysis might use ARMA on the detrended series.

9.11 Trend estimation and forecasting example

Model TypeEquationDescription
Linearyt=δ0+δ1t+ϵty_t = \delta_0 + \delta_1 t + \epsilon_tConstant amount change per period
Polynomialyt=δ0+δ1t+δ2t2+ϵty_t = \delta_0 + \delta_1 t + \delta_2 t^2 + \epsilon_tNon-constant amount change
Log-linearln⁡(yt)=δ0+δ1t+ϵt\ln(y_t) = \delta_0 + \delta_1 t + \epsilon_tConstant growth rate
Log-quadraticln⁡(yt)=δ0+δ1t+δ2t2+ϵt\ln(y_t) = \delta_0 + \delta_1 t + \delta_2 t^2 + \epsilon_tAccelerating/decelerating growth

158 159

9.12 Seasonality

Seasonality refers to patterns that repeat yearly, like increased retail sales before Christmas. Calendar effects, or cycles shorter than a year (e.g., weekly patterns), are also included.

9.13 Modeling seasonality with dummy variables

Seasonal patterns can be modeled using dummy variables in a regression. These variables take values of 1 or 0 to indicate the presence or absence of a season.

  • Variable definition: For a monthly series, a dummy for January is 1 if the observation is in January, and 0 otherwise.
  • Number of dummies: A regression can include dummy variables for up to one less than the data's frequency (e.g., 11 for monthly data, 3 for quarterly). This avoids multicollinearity.

🔑 Important: Including dummies for all periods causes multicollinearity; one period must be omitted as a reference.

9.14 Example: Quarterly EPS seasonality

The model for quarterly earnings per share (EPS) is: EPSt=β0+β1D1,t+β2D2,t+β3D3,t+ϵtEPSt = \beta_0 + \beta_1 D_{1,t} + \beta_2 D_{2,t} + \beta_3 D_{3,t} + \epsilon_t

  • β0\beta_0: Average EPS for the omitted fourth quarter.
  • β1,β2,β3\beta_1, \beta_2, \beta_3: Differences in EPS for quarters 1, 2, and 3, respectively, compared to the fourth quarter.

If β0=1.25\beta_0 = 1.25, β1=0.75\beta_1 = 0.75, β2=−0.20\beta_2 = -0.20, and β3=0.10\beta_3 = 0.10:

  • Average fourth-quarter EPS: 1.251.25.
  • Average first-quarter EPS: 1.25+0.75=2.001.25 + 0.75 = 2.00.
  • Average second-quarter EPS: 1.25−0.20=1.051.25 - 0.20 = 1.05.
  • Average third-quarter EPS: 1.25+0.10=1.351.25 + 0.10 = 1.35.

These values serve as forecasts for the respective quarters of the next year.

9.15 Seasonal differencing

Seasonal differencing models the difference between a series' current level and its level from the same period last year. This can help with seasonality, time trends, and unit roots.

🔑 Important: Seasonal differencing accounts for year-over-year changes, smoothing out regular seasonal patterns.

Seasonality Modeling TechniqueDescription
Dummy VariablesIndicator variables (0 or 1) for specific seasons within a regression.
Seasonal DifferencingAnalyzing the difference between a period and the same period last year.

160 161

🔑 Important: Understanding how to model time trends and seasonality is crucial for transforming non-stationary series into manageable forms for forecasting 157.

10. Time series analysis and forecasting (part 2)

10.1 Handling non-stationarity with trends and seasonality

  • Time series with a trend can be modeled using: $y_t = \beta_0 + \beta_1 t + \epsilon_t$ where β1t\beta_1 t represents the time trend.
  • Seasonal effects can be incorporated using dummy variables. For ss seasons, use s−1s-1 dummy variables if an intercept is included to avoid multicollinearity.
  • A complete model can include time trends and dummy variables for holidays and trading days.

📝 Example: For quarterly data (s=4s=4) with an intercept, three dummy variables are used to model seasonality.

  • Forecasts for hh periods ahead use the time trend value at T+hT+h and appropriate dummy variable values for that period.

📝 Example: A model ∆Salest = 4.9 − 2.1DQ2 − 3.8DQ3 + 6.5DQ4 forecasts a sales decrease of 3.8 in the third quarter 162.

10.2 Unit root processes

  • A random walk is a time series where the current value equals the previous value plus a random shock: yt=yt−1+ϵty_t = y_{t-1} + \epsilon_t.
  • A random walk's variance increases with time, making it non-covariance stationary.
  • Unit root processes are a broader class including random walks. They have a root of 1 in their lag polynomial representation, e.g., (1−L)(1−0.65L)yt=ϵt(1 - L)(1 - 0.65L) y_t = \epsilon_t.

🔑 Important: Random walks and unit root processes can often be treated interchangeably for modeling purposes.

Challenges of modeling unit roots

  • Series with unit roots do not revert to a mean.
  • They can show spurious relationships with other time series.
  • ARMA models with unit roots lead to parameter estimates following a Dickey-Fuller distribution, hindering model selection and forecasting.

Addressing unit roots

  • Modeling the first differences (changes from period to period) of a unit root series resolves these issues 163.
  • Differencing can also address time trends and seasonality.
  • Over-differencing (taking differences of an already stationary series) complicates models unnecessarily.

Testing for unit roots: Augmented Dickey-Fuller test

  • The augmented Dickey-Fuller (ADF) test checks if the lagged level of a series significantly predicts its current value.
  • The model can include deterministic factors and lagged differences to ensure the error term (ϵt\epsilon_t) is white noise.
  • Null Hypothesis (H0H_0): γ=0\gamma = 0 (series has a unit root).
  • Alternative Hypothesis (HAH_A): γ<0\gamma < 0 (series is covariance stationary) 164 165.
  • Reject H0H_0 if the coefficient on the lagged value (γ\gamma) is statistically significantly less than zero 166.

> ADF Test Rule: Reject unit root if lagged coefficient is significantly negative.

10.3 Measuring returns, volatility, and dependence

Returns and volatility

  • Simple return (RR) over one period: R=Pt−Pt−1Pt−1R = \frac{P_t - P_{t-1}}{P_{t-1}}.
  • Continuously compounded (log) return (rr) over one period: rt=ln⁡Pt−ln⁡Pt−1r_t = \ln P_t - \ln P_{t-1} 167.
  • Multi-period returns:
  • Simple: Product of individual period simple returns.
  • Log: Sum of individual period log returns.
  • Conversion: 1+Rt=exp⁡rt1 + R_t = \exp r_t. Log returns are always less than simple returns.

🔑 Important: Log returns are preferred for shorter horizons and are more appropriate for financial modeling.

  • Volatility (σ\sigma) is the standard deviation of returns; variance (σ2\sigma^2) is its square.
  • Asset return model: rt=μ+σetr_t = \mu + \sigma e_t, where ete_t is a shock with mean 0 and variance 1.
  • Annualized volatility is calculated by scaling period volatility (e.g., daily) by the number of periods in a year (e.g., 252\sqrt{252}).
  • Implied volatility is derived from option prices using models like Black-Scholes-Merton (BSM).
  • The VIX Index measures forward-looking implied volatility for the S&P 500 over 30 days.

🔑 Important: A drawback of the BSM model for implied volatility is the assumption of constant variance 168.

Distributions of financial returns

  • Normal distributions are symmetric with thin tails, zero skewness, and kurtosis of 3 (excess kurtosis of 0).
  • Financial returns often exhibit nonnormal distributions with skewness (asymmetry) and excess kurtosis (fatter tails than normal).

Jarque-Bera (JB) test

  • Tests the null hypothesis that a distribution is normal (H0:S=0,K=3H_0: S=0, K=3) against the alternative that it is not (HA:S≠0,K≠3H_A: S \neq 0, K \neq 3) 169.
  • Test statistic: JB=T6(S2+(K−3)24)JB = \frac{T}{6} \left( S^2 + \frac{(K-3)^2}{4} \right)
  • Smaller JB values suggest the null hypothesis is likely true. Reject H0H_0 if JB exceeds critical values (e.g., 5.99 at 5% significance) 170.

> JB Test Rule: Small JB statistic supports normality; large JB statistic rejects normality.

Power law tails

  • Distributions with power law tails, like the Student's t-distribution, have fatter tails than normal distributions.
  • This means extreme observations (far from the mean) are more common.
  • Probability of a return greater than xx: P(X>x)=kx−αP(X > x) = kx^{-\alpha}.

> Power Law Tails: More frequent extreme events than in a normal distribution.

Correlations and dependence

  • Covariance measures the directional relationship between two variables.
  • Pearson's correlation measures linear dependence, ranging from -1 to 1.
  • If variables are standardized to unit variance, Pearson's correlation equals the regression slope coefficient (β\beta).
  • For nonlinear dependence, use Spearman's rank correlation or Kendall's τ\tau (tau) 171.

Spearman's rank correlation

  • Measures the linear relationship between the ranks of observations.
  • Formula: rs=1−6∑di2n(n2−1)r_s = 1 - \frac{6 \sum d_i^2}{n(n^2 - 1)}, where did_i is the difference in ranks and nn is the number of observations.
  • Less sensitive to outliers than Pearson's correlation because it uses ranks 172.
  • A value of 0.48 indicates positive nonlinear dependence 177.

> Spearman's Rule: Ranks matter, not exact values; robust to outliers.

Kendall's τ\tau

  • Measures agreement between pairs of observations.
  • Calculated as: τ=nc−ndnc+nd+nt\tau = \frac{n_c - n_d}{n_c + n_d + n_t}, where ncn_c is concordant pairs, ndn_d is discordant pairs, and ntn_t is ties 173.
  • ncn_c pairs agree in order; ndn_d pairs disagree.

> Kendall's Tau Rule: Concordant pairs add value, discordant pairs subtract value.

Positive definiteness

  • Correlation matrices must be positive definite, meaning any weighted average of random variables has non-negative variance 174 176.
  • Equicorrelation sets all correlations to the same value to ensure positive definiteness 175.
  • Another method assumes correlations arise from common factors: ρi,j=YiYj\rho_{i,j} = Y_i Y_j.

> Equicorrelation: All pairwise correlations are set to an identical value.

🔑 Important: Understanding unit root processes and how to test for them is crucial, as mismodeling can lead to spurious results and poor forecasts. Methods like differencing and the ADF test are key tools.

11. Simulation, bootstrapping, and machine learning fundamentals (part 1)

11.1 Monte Carlo simulation

Monte Carlo simulations model uncertainty by creating random inputs that follow specified probability distributions. They are useful for complex problems or when sample sizes are small.

Financial applications include option pricing and stress testing.

The basic steps for a Monte Carlo simulation are:

  • Generate random draw data from an assumed data generating process (DGP).
  • Calculate a statistic or function of this data.
  • Repeat steps one and two many times to create numerous replications.
  • Estimate the quantity of interest from these results.
  • Evaluate accuracy by computing the standard error and increase replications if needed 178.

📝 Example: To estimate a portfolio's ending capital, we use an initial investment and a random variable for the annual return, simulating multiple scenarios to see the range of possible outcomes.

11.2 Reducing sampling error

Sampling error in Monte Carlo simulations is measured by the standard error estimate. This is calculated as the standard deviation of the output variables divided by the square root of the number of scenarios (NN) 179.

  • To reduce the standard error by a factor of 10, you must increase NN by a factor of 100.
  • Increasing the number of scenarios can be costly for complex simulations.

Variance reduction techniques offer an alternative to increasing NN. The most common are antithetic variates and control variates.

11.3 Antithetic variates

This technique reduces sampling error by rerunning the simulation with a complement set of random variables.

  • If original random draws are utu_t, the complement set is −ut-u_t.
  • This approach should lead to a lower variance because the two sets are perfectly negatively correlated (corr(ut,−ut)=−1corr(u_t, -u_t) = -1) 180.
  • Negative covariance reduces the total variance of the estimated quantity 187.

11.4 Control variates

A control variate replaces a variable xx with unknown properties with a similar variable yy that has known properties.

  • Both xx and yy are simulated using the same random numbers.
  • The estimate for xx is redefined as x∗=xˉ−β(yˉ−E[y])x^* = \bar{x} - \beta(\bar{y} - E[y]), where E[y]E[y] is the known expected value of yy.
  • The new estimate x∗x^* has a smaller sampling error if xx and yy are highly correlated.
  • This method reduces error if the variance of x∗x^* is less than the variance of the original estimate xˉ\bar{x}.

> The control variate method reduces sampling error if the control statistic and the statistic of interest are highly correlated. 181.

📝 Example: When pricing Asian options, which depend on the average underlying asset price, a European option (with known properties via Black-Scholes-Merton) can serve as a control variate 182.

11.5 Bootstrapping and random number generation

11.6 Bootstrapping method

Bootstrapping draws random data from an actual sample of historical data, rather than from a theoretical probability distribution.

  • It does not require assumptions about the data's distribution.
  • Data is sampled with replacement.

11.7 Types of bootstrapping

  • Independent and identically distributed (i.i.d.) bootstrap: Samples individual observations one by one with replacement. Best suited for independent data.

📝 Example: Sampling three times with replacement from 10 observations yields samples like {x2,x7,x9}\{x_2, x_7, x_9\} or {x1,x1,x8}\{x_1, x_1, x_8\} 183.

  • Circular block bootstrap (CBB): Samples blocks of observations with replacement. Used when data is dependent over time.

📝 Example: With 10 observations, blocks of size three could be {x1,x2,x3}\{x_1, x_2, x_3\}, {x2,x3,x4}\{x_2, x_3, x_4\}, or wrap-around blocks like {x9,x10,x1}\{x_9, x_{10}, x_1\}. A block size of n\sqrt{n} is generally appropriate for sample size nn.

11.8 Limitations of bootstrapping

  • Unreliable in abnormal market conditions: If current market conditions differ significantly from historical norms, bootstrapping may underestimate risk.

🔑 Important: Bootstrapping relies on the assumption that the present resembles the past 186.

  • Structural changes: Permanent changes in market fundamentals can make historical data unrepresentative.

11.9 Pseudo-random number generation

Pseudo-random number generators (PRNGs) create sequences of numbers using algorithms.

  • These numbers are not truly random but are generated from a formula.
  • PRNGs typically produce numbers uniformly distributed between 0 and 1 184.
  • An initial seed value determines the sequence of numbers generated.

🔑 Important: The recurring nature of PRNG outputs offers two benefits: repeatability for experiments and consistent data for computing clusters 185.

11.10 Machine learning fundamentals

Machine learning (ML) techniques recognize data patterns for practical applications. They handle big data, offer flexibility, and can capture non-linear interactions.

11.11 ML vs. classical econometrics

FeatureClassical EconometricsMachine Learning
Driving forceEconomic/financial theoryData patterns
Model/variable choiceAnalyst selectsData decides
FocusParameter estimation, significance, theory testingPrediction accuracy
AssumptionsExplanatory variable independence, normal distribution, etc.Less reliant on strict statistical assumptions
FlexibilityPrimarily linear specificationsFlexible functional forms, non-linear interactions

ML is valuable when theory doesn't guide variable choice or when linear models are insufficient.

11.12 Categories of machine learning

  • Supervised learning: Predicts a variable's value or classifies an observation using labeled data.

📝 Example: Predicting car value using features (make, model, year) or predicting a game's outcome (win/loss) based on team records.

  • Unsupervised learning: Identifies patterns in data without a specific target. Includes data clustering and factor identification.

📝 Example: An auditor might use it to group company transactions for further review.

  • Reinforcement learning: Uses trial and error to make decisions in a changing environment to maximize rewards.

📝 Example: Used in risk management for trading, hedging, or portfolio management 190.

11.13 Data preparation

Machine learning models often require data to be on a consistent scale. Two primary methods are used:

  • Standardization: Creates variables with zero mean and unit variance. Preferred for data with outliers.
  • Formula: (x−mean(x))/stddev(x)(x - \text{mean}(x)) / \text{stddev}(x)
  • Normalization (Min-Max Transformation): Scales variables to a range between zero and one.

Data cleaning is crucial for ML and addresses:

IssueRemediation Strategies
Missing dataRemove observations, impute with mean/median, or estimate from other data.
OutliersObservations far from the mean.
Duplicate observationsRemove identical records.
Inconsistent recordingStandardize data formats.
Unwanted observationsRemove irrelevant data points.191

11.14 Modeling challenges

  • Underfitting: The model is too simple and cannot capture the underlying data patterns.
  • Overfitting: The model is too complex and captures noise in the training data, performing poorly on new data.
  • Sample splitting: Data is divided into training, validation, and test sets to build and evaluate models effectively.

🔑 Important: Machine learning models are powerful for handling large, complex datasets and identifying non-linear relationships, but require careful data preparation and understanding of potential pitfalls like overfitting 189.

11.15 Dimension reduction and clustering

Principal Components Analysis (PCA) is an unsupervised learning technique. It reduces the dimensionality of data.

The goal is to capture almost the same information with fewer uncorrelated components. PCA is used to reduce the number of features in a model.

  • Yield curve movements: PCA can describe these using a few uncorrelated components. The most important are parallel shifts and twists.
  • Variation explained: The first three components can explain 99% of yield movement variation 192.

K-Means clustering is another unsupervised learning algorithm. It separates data into groups called clusters.

  • K value: This is the number of clusters, set by an analyst.
  • Centroids: These are the centers of the clusters. They are initially random.
  • Process: Data points are assigned to the nearest centroid. Then, centroids are recalculated. This repeats until centroids stabilize.

Data points can be allocated using Euclidean or Manhattan distance. Inertia measures the distance from each data point to its centroid.

🔑 Important: A lower inertia indicates a better cluster fit 193.

To find the optimal number of clusters (K), a "scree plot" can be used. This plot shows where inertia starts to decrease more slowly as K increases.

The "elbow" point is often considered optimal. Alternatively, the silhouette coefficient compares distances within and between clusters.

A higher silhouette score suggests an optimal K.

11.16 Underfitting, overfitting, and sample splitting

Overfitting occurs when a model is too complex, with too many parameters. This leads to poor performance on new data.

  • Training data: Used to estimate model parameters.
  • Validation data: Used to evaluate performance on separate data.

An overfitted model has a low error rate on the training set but performs poorly on unseen data 194.

Underfitting happens when a model is too simple. It fails to capture important patterns in the data.

Conventional models have a greater risk of underfitting than machine learning models.

The bias-variance tradeoff describes model fit.

Model TypeBiasVariance
UnderfittedHighLow
OverfittedLowHigh
Appropriately fittedBalancedBalanced
  • Training set: Used to estimate model parameters and learn patterns.
  • Validation set: Used to choose between alternative models.
  • Test set: Used to determine the chosen model's effectiveness.

Model generalization is achieved when the fit to the test sample is similar to the training sample fit.

A typical split is two-thirds for training, one-sixth for validation, and one-sixth for testing. For time-series data, the order is training, then validation, then test.

K-fold cross-validation is used for smaller datasets. The data is split into 'k' sub-samples.

Most are used for training and validation, with one reserved for testing. This process is repeated.

Performance is averaged across all folds 196.

🔑 Important: Choosing the correct model complexity is key to avoiding underfitting and overfitting 195.

11.17 Reinforcement learning

Reinforcement learning creates policies to maximize rewards. It uses trial and error, similar to game-playing AI.

  • Applications: Derivatives hedging, trading rules, and large-volume trade management.
  • Data needs: Requires large training datasets; initial performance is weak but improves over time.

Key components of reinforcement learning include:

ComponentDescription
States (S)Define the environment.
Actions (A)Represent decisions made.
Rewards (R)Maximized by making the best decision.
  • Exploitation: Choosing the best action already identified.
  • Exploration: Trying a new action.

The probability of exploitation is 'p', and exploration is '1-p'. As the algorithm learns, 'p' increases.

Two methods evaluate actions and rewards:

  • Monte Carlo method: Evaluates actions and subsequent rewards. The Q-value update is: Q(S,A)←Q(S,A)+α(R−Q(S,A))Q(S, A) \leftarrow Q(S, A) + \alpha(R - Q(S, A)) where α\alpha is a learning rate.
  • Temporal difference learning: Assumes the current best strategy is for the future and looks only one decision ahead. The Q-value update is: Q(S,A)←Q(S,A)+α(R+γmax⁡A′Q(S′,A′)−Q(S,A))Q(S, A) \leftarrow Q(S, A) + \alpha(R + \gamma \max_{A'} Q(S', A') - Q(S, A)) where γ\gamma is a discount factor for future rewards.

🔑 Important: Reinforcement learning aims to find optimal decision-making policies through maximizing rewards 197.

12. Simulation, bootstrapping, and machine learning fundamentals (part 2)

12.1 Machine learning fundamentals

Machine learning (ML) uses models to recognize data patterns for practical applications. It handles large data volumes and offers more flexibility than traditional statistics.

ML models learn directly from data without pre-set hypotheses. They use flexible forms to capture complex, non-linear variable interactions.

The primary focus is on prediction accuracy. ML uses inputs/features and outputs/targets.

Data splitting

ML models typically divide data into three sets:

  • Training set: Used for the model to learn patterns.
  • Validation set: Used to choose between competing ML models.
  • Test set: Used to evaluate the final chosen model's effectiveness.

A common split is two-thirds for training, one-sixth for validation, and one-sixth for testing. Small training sets risk biased parameter estimation.

Small validation sets risk inaccurate model estimations.

For time-series data, split chronologically: training, then validation, then testing.

Cross-validation, like k-fold, is used for smaller datasets. It combines training and validation data.

Leave-one-out cross-validation sets k equal to the number of data points.

Model fitting

  • Overfitting: Occurs when a model is too complex, large, or has too many parameters. Performance degrades with new data.
  • Underfitting: Occurs when a model is too simple and misses relevant patterns. Conventional models often underfit.

An underfitted model has biased predictions with low variance. An overfitted model has low bias but high variance across datasets.

Dimension reduction

Principal Component Analysis (PCA) reduces dimensions. It aims to retain information using fewer uncorrelated components than many correlated ones.

PCA is used for yield curve movements, with parallel shifts and twists being key components.

Clustering

The K-means algorithm groups data into K clusters. Analysts set K.

Cluster centers are called centroids.

  • Distance measures: Euclidean or Manhattan distance.
  • Goal: Minimize the distance between data points and their centroids.
  • Inertia: Measures point-to-centroid distance; lower is better.
  • Scree plot: Helps find optimal K where inertia's decline slows (the "elbow").
  • Silhouette coefficient: Another metric to find optimal K 200.

Lower inertia means data points are closer to their cluster center.

12.2 Machine learning categories

Machine learning methodologies fall into three categories:

  • Supervised learning: Predicts a variable's value or an observation's class using labeled data.
  • Unsupervised learning: Finds patterns in data without a specific target; used for data exploration, not prediction.
  • Reinforcement learning: Uses trial-and-error for decision-making in changing environments.

Data preparation

Two methods ensure scale consistency for ML models:

  • Standardization: Creates variables with zero mean and unit variance.
  • Normalization: Scales variables to a range between zero and one.

Data cleaning addresses missing data, outliers, duplicates, and inconsistencies.

Reinforcement learning

Reinforcement learning creates a policy to maximize rewards. Algorithms need vast training data and improve over time.

Key elements are states, actions, and rewards. The Q-value is the expected reward of an action in a state.

Algorithms choose between exploitation (best known action) and exploration (new action).

  • Monte Carlo method: Evaluates actions, states, and rewards.
  • Temporal difference learning: Assumes the best current strategy is for the future, looking one decision ahead 201.

Exploitation uses known good actions; exploration tries new ones.

12.3 Encoding and regularization

Categorical variables

Mapping (encoding) converts non-numerical data to numbers for ML models.

  • Nominal data (no natural order, e.g., county): Use one-hot encoding. Each category gets a dummy variable (1 for its presence, 0 otherwise).
  • Ordinal data (natural order, e.g., income range): Dummy variables can take ordered values (0, 1, 2...).

One-hot encoding creates a binary variable for each category.

Regularization

Regularization simplifies models to prevent overfitting. It adds a penalty term to the objective (loss) function.

This shrinks coefficient estimates, reducing model variance.

Two main techniques:

TechniquePenalty TermApproachFeature Selection?
Ridge (L2)Sum of squares of slope coefficientsAnalyticalNo
LASSO (L1)Sum of absolute values of slope coefficientsNumericalYes
  • Ridge regression: Shrinks slope coefficients (β\beta) towards zero.
  • LASSO: Sets less important coefficients exactly to zero, performing feature selection. Higher λ\lambda removes more features.
  • Elastic net: A hybrid combining penalties from both Ridge and LASSO.

Regularization helps control model complexity and prevent overfitting.

Logistic regression

Logistic regression (logit model) is used for binary outcomes (0 or 1). It uses the cumulative logistic function (sigmoid curve) to output probabilities between 0 and 1.

The logistic function is: P(y=1∣X)=11+e−(α+βX)P(y=1|X) = \frac{1}{1+e^{-(\alpha + \beta X)}}

The model estimates parameters (α,β\alpha, \beta) using maximum likelihood estimation. A log-likelihood function is often maximized.

Predictions are made by:

  1. Setting a threshold (ZZ).
  2. Estimating the probability for y=1y=1.
  3. Assigning the category based on probability vs. ZZ.

A threshold of 0.5 assumes equal costs for misclassification. Lower thresholds favor the "1" outcome.

Model performance for continuous outputs is measured by Mean Squared Forecast Error (MSFE) or Mean Absolute Forecast Error.

12.4 Advanced ML techniques

Decision trees

Decision trees are supervised learning models that visually represent sequential input features. They are used for classification and regression (CARTs).

Often called "white-box models.".

  • Root node: Top node.
  • Decision nodes: Internal nodes.
  • Terminal nodes (leaves): End nodes.

Information gain measures how much a feature reduces uncertainty. Entropy and Gini impurity are used to measure this.

  • Entropy: Measures disorder (0 to 1).
  • Gini measure: Also measures impurity.

Decision trees aim for "pure sets" at leaf nodes, where all observations belong to one class.

Overfitting is a risk; it's managed by pre-pruning (stopping splits early) or post-pruning (removing weak branches).

Ensemble learning

Ensembles combine outputs from multiple models to improve predictions and protect against overfitting.

Techniques include:

  • Bootstrap aggregation (bagging): Creates multiple decision trees from sampled data. Aggregates predictions, reducing variance. Data is sampled with replacement.
  • Random forests: An ensemble of decision trees. Improves bagging by reducing correlations between trees. Uses a subset of features at each split.
  • Boosting: Improves performance sequentially. Builds new models on residuals (gradient boosting) or increases weights on misclassified data (adaptive boosting).

The "wisdom of crowds" in ensembles averages predictions to improve robustness.

K-Nearest Neighbors (KNN) and Support Vector Machines (SVM)

  • K-Nearest Neighbors (KNN): A supervised "lazy learner." It classifies based on the K closest training samples. The choice of K and distance measure is crucial. Too large K leads to high bias, low variance; too small K leads to low bias, high variance.
  • Support Vector Machines (SVMs): Effective for many features. Finds a hyperplane that maximally separates data points of different classes. Support vectors lie on the boundary edges.

SVMs aim for the widest possible margin between classes.

12.5 Neural networks and performance

Neural networks

Artificial Neural Networks (ANNs) mimic the human brain for computation. Feedforward networks with backpropagation are common.

  • Structure: Input layer, hidden layer(s), output layer.
  • Weights (w): Applied to inputs to determine node output.
  • Bias (b): An activation parameter; determines how easily a node "fires."
  • Activation function: Introduces non-linearity (e.g., logistic function).

Weights and biases combine to generate node output: output=activation(∑(w⋅input)+b)output = \text{activation}(\sum (w \cdot \text{input}) + b).

Activation functions are key to modeling non-linear relationships.

Parameter values are optimized using gradient descent, minimizing a loss function. The learning rate controls step size.

Overfitting is managed by monitoring performance on both training and validation datasets simultaneously. Training stops when validation performance degrades.

🔑 Important: Understanding model fitting (under/overfitting), data splitting, and core ML categories is crucial for exam success.

12.6 Natural Language Processing (NLP)

Natural Language Processing (NLP) analyzes human language. It is used for fraud detection, sentiment analysis, and text categorization.

NLP offers speed and consistency.

Steps in NLP:

  1. Tokenizing: Identifies words, converts to lowercase.
  2. Stop word removal: Removes common words ("the," "a").
  3. Stemming: Reduces words to their root (e.g., "argue" from "arguing").
  4. Lemmatization: Reduces words to their dictionary form (e.g., "bad" from "worse").
  5. N-grams: Considers meaningful word groups (e.g., "exceed analyst expectations").

NLP treats text as a "bag of words," often ignoring word order except for N-grams.

Sentiment analysis counts positive, negative, and neutral words. Challenges include handling nuanced language 198 199.

🔑 Important: Proper text preprocessing is vital for effective NLP analysis.

12.7 Machine learning for prediction

Categorical variable encoding

  • Nominal variables: Use one-hot encoding for categories without a natural order.
  • Ordinal variables: Can be assigned numerical values reflecting their order 203.

Regularization techniques

  • Ridge regression: Shrinks coefficients using L2 penalty. Reduces variance without necessarily setting coefficients to zero.
  • LASSO: Shrinks coefficients using L1 penalty. Can set coefficients to exactly zero, performing feature selection.
  • Elastic net: Combines Ridge and LASSO penalties 204.

Regularization helps prevent overfitting by penalizing model complexity.

Used for binary outcomes (0 or 1). It maps predictions to probabilities between 0 and 1 using the sigmoid function 205.

  • Parameters: Estimated using Maximum Likelihood Estimation (MLE).
  • Threshold (ZZ): Sets the cutoff for classification.
  • Z=0.5Z=0.5 implies equal misclassification costs.
  • Adjusting ZZ manages trade-offs between Type I and Type II errors 206.

🔑 Important: Understanding the trade-offs in choosing a prediction threshold is key for practical applications.

12.8 Advanced prediction models

Visual models that split data based on feature values. They use information gain (via entropy or Gini impurity) to select optimal splits 207 208.

  • Overfitting: Mitigated by pre- or post-pruning.

Combines multiple models for improved accuracy and robustness.

  • Bagging: Aggregates predictions from models trained on bootstrapped samples.
  • Random Forests: Improves bagging by randomizing feature selection.
  • Boosting: Sequentially trains models, focusing on prior errors 209.

K-Nearest Neighbors (KNN)

Classifies data points based on the majority class of their 'K' nearest neighbors. A "lazy learner" as it doesn't explicitly build a model.

Support Vector Machines (SVMs)

Finds the optimal hyperplane to separate classes with the largest margin. Uses support vectors for boundary definition 210.

🔑 Important: Each advanced model has unique strengths for classification and prediction tasks.

12.9 Neural networks for prediction

Artificial Neural Networks (ANNs) use interconnected nodes (neurons) in layers. Weights and biases are adjusted via backpropagation and gradient descent to minimize a loss function.

Activation functions introduce non-linearity 212.

  • Backpropagation: Updates weights and biases iteratively.
  • Gradient descent: Finds optimal parameters by moving down the "valley" of the loss function.
  • Learning rate: Controls step size in gradient descent.

🔑 Important: Neural networks are powerful for complex, non-linear patterns but are prone to overfitting without careful tuning.

12.10 Evaluating binary classification models

  • A confusion matrix is used for binary categorical outputs (0 or 1) to assess model accuracy.

  • It shows four outcomes:

  • True positives (TP): Predicted positive, actually positive.

  • False positives (FP): Predicted positive, actually negative.

  • True negatives (TN): Predicted negative, actually negative.

  • False negatives (FN): Predicted negative, actually positive.

  • The Receiver Operating Characteristic (ROC) curve illustrates the trade-off between true positive and false positive rates.

  • The Area Under the ROC Curve (AUC) measures predictive power.

  • AUC = 1: Perfect predictions.

  • AUC = 0.5: No predictive value (random model).

  • AUC < 0.5: Negative predictive value.

📝 Example: A model predicts company acquisitions. Out of 500 companies, 150 made acquisitions. The confusion matrix helps evaluate if the predictions of acquisitions were accurate 213.

12.11 Comparing logistic regression and neural networks

  • Comparing logistic regression and neural network models can reveal differences in performance metrics like accuracy, precision, and recall.
  • Contradictory indicators may arise, making it hard to definitively say which model is superior without further analysis.
  • Confusion matrices can highlight where one model predicts more events for a specific sample, while another excels on a different sample.

🔑 Important: A model is considered slightly overfit when its performance is stronger on training data than on validation data 214.

12.12 Key machine learning concepts

  • Mapping (encoding) transforms non-numerical data into numbers.

  • For data without a natural order, use dummy variables (0 or 1) for each category.

  • For ordered categories, dummy variables can exceed 0 and 1.

  • Regularization simplifies models and reduces overfitting by adding a penalty term to the objective function.

  • Ridge regression: Penalizes the sum of squared slope coefficients. Shrinks coefficients towards zero.

  • LASSO (Least Absolute Shrinkage and Selection Operator): Penalizes the sum of absolute slope coefficients. Sets unimportant coefficients to exactly zero.

  • Elastic net: A hybrid combining ridge and LASSO penalties.

  • Decision trees are supervised learning models that use questions at nodes to classify data.

  • Information gain measures how a feature reduces uncertainty, with entropy and Gini coefficient used for calculation.

  • Pre-pruning stops splitting when node observations are below a threshold.

  • Post-pruning removes weak nodes after a large tree is built.

  • Ensemble learning combines predictions from multiple models to prevent overfitting.

  • Techniques include bagging, random forests, and boosting 216.

Model TypeDescriptionPenalty Term TypeGoal
Ridge RegressionShrinks slope coefficients towards zero using an analytical approach.Sum of squares of slope coefficientsShrink coefficients close to zero
LASSO (Least Absolute...)Sets less important slope coefficients to exactly zero using a numerical approach.Sum of absolute values of slope coefficientsSet unimportant coefficients to zero
Elastic NetHybrid of ridge and LASSO, summing both penalty terms.Combined ridge and LASSO penaltiesCombines benefits of both

12.13 Supervised learning models

  • K-nearest neighbors (KNN) classifies or predicts target values based on the 'K' nearest training samples.

  • Choosing 'K' is crucial: too large 'K' leads to high bias/low variance, too small leads to low bias/high variance.

  • 'K' is often set to the square root of the training sample size.

  • Support Vector Machines (SVMs) are effective for datasets with many features.

  • They find the widest path between two parallel lines separating data points.

  • Support vectors are data points on the edge of this path.

  • The output is a hyperplane in higher dimensions.

12.14 Artificial neural networks

  • Artificial neural networks (ANNs) use computations to identify non-linear relationships.

  • Feedforward networks with backpropagation are common, updating biases and weights iteratively.

  • Gradient descent minimizes the objective (loss) function.

  • The learning rate controls the step size in gradient descent.

  • Too large a rate causes excessive movement; too small causes slow convergence.

  • Overfitting is a risk in ANNs with many layers/nodes.

  • Monitor validation and training datasets simultaneously to prevent overfitting.

  • Stop gradient descent when validation error increases while training error continues to decrease.

🔑 Important: The point to stop gradient descent in a neural network is when the validation set's objective function value starts increasing, even if the training set's is still improving 215 217.

13. Simulation, bootstrapping, and machine learning fundamentals (part 3)

13.1 Simulation methods

Simulation uses random numbers to model uncertain outcomes. It helps analyze complex systems that are hard to solve analytically.

  • Monte Carlo simulation: This method uses repeated random sampling to obtain numerical results. It's useful when direct calculation is impossible or too complex.

Monte Carlo methods are like rolling dice many times to estimate probabilities.

  • Reducing sampling error: Techniques like antithetic variates and control variates can improve the accuracy of simulation results.
  • Antithetic variates use negatively correlated random numbers to cancel out errors.
  • Control variates use known related variables to adjust simulation outcomes.

13.2 Bootstrapping

Bootstrapping is a resampling technique. It treats the observed data as the population.

We draw samples with replacement from this data. This allows us to estimate the sampling distribution of statistics.

  • It's a non-parametric method, meaning it doesn't assume a specific underlying distribution for the data.
  • Bootstrapping is similar to Monte Carlo methods in that both use random sampling. However, bootstrapping resamples from the observed data, while Monte Carlo uses a known or assumed data distribution.

13.3 Machine learning fundamentals

Machine learning involves algorithms that learn from data. They identify patterns and make predictions or decisions.

13.3.1 Learning paradigms

Machine learning is broadly categorized into three main types:

ParadigmDescriptionCommon Tasks
Supervised learningLearns from labeled data (input-output pairs) to predict outputs for new inputs.Classification, Regression
Unsupervised learningLearns from unlabeled data to find hidden structures, patterns, or relationships.Clustering, Dimensionality Reduction
Reinforcement learningLearns by interacting with an environment, receiving rewards or penalties for its actions.Game playing, Robotics

Before training a model, data needs to be prepared. This ensures the data is suitable for algorithms.

  • Data cleaning: Handling missing values, outliers, and inconsistent data.
  • Data preparation: Transforming data into a format the model can use. This includes feature scaling and encoding categorical variables.

13.3.3 Model fitting and generalization

A key challenge in machine learning is achieving good generalization. This means the model performs well on unseen data.

  • Underfitting: The model is too simple to capture the underlying patterns in the data. It performs poorly on both training and test data.
  • Overfitting: The model learns the training data too well, including its noise. It performs very well on training data but poorly on test data.

Overfitting is like memorizing answers instead of understanding the concepts.

13.3.4 Sample splitting

To evaluate a model's generalization ability, data is split into sets.

  • Training set: Used to train the model.
  • Validation set: Used to tune model hyperparameters and prevent overfitting during training.
  • Test set: Used for a final, unbiased evaluation of the model's performance on unseen data.

Use a training set to learn, a validation set to adjust, and a test set to judge.

🔑 Important: Preventing overfitting through techniques like cross-validation and regularization is crucial for building models that generalize well to new data 218.

14. Simulation, bootstrapping, and machine learning fundamentals (part 4)

14.1 Simulation methods

  • Monte Carlo simulation: a numerical method using random sampling to obtain results. It's useful when analytical solutions are difficult or impossible to find.
  • It repeatedly draws random samples from a probability distribution. These samples are then used to estimate values of unknown parameters or to evaluate complex integrals.

14.1.1 Reducing sampling error

  • Antithetic variates: uses negatively correlated random variables to reduce variance. If one random variable is high, the antithetic one is low, helping to cancel out extreme values.
  • Control variates: uses known variables correlated with the target variable. These known variables help to adjust the estimates from the random samples, improving accuracy.

14.1.2 Random number generation

  • Pseudo-random number generators (PRNGs): algorithms that produce sequences of numbers that approximate the properties of random numbers. These sequences are deterministic but appear random for practical purposes.

14.2 Bootstrapping

  • Bootstrapping: a resampling technique that treats the observed sample as a population. It involves drawing samples with replacement from the original sample to estimate the sampling distribution of a statistic.
  • This method is valuable for estimating standard errors and confidence intervals, especially when the underlying distribution is unknown or complex.

🔑 Important: Bootstrapping is conceptually similar to Monte Carlo methods but uses empirical data to generate its "random" samples, rather than a pre-defined theoretical distribution 238.

14.3 Machine learning fundamentals

Machine learning enables systems to learn from data without explicit programming.

14.3.1 Types of machine learning

TypeDescriptionGoal
Supervised learningLearns from labeled data (input-output pairs).Predicts outcomes for new, unseen data.
Unsupervised learningLearns from unlabeled data.Finds patterns, structures, or relationships in the data.
Reinforcement learningLearns through trial and error, receiving rewards or penalties for actions.Maximizes cumulative reward by learning optimal decision-making policies.

206 214

14.3.2 Data preparation and model issues

  • Normalization/Standardization: Scaling data to a common range (e.g., 0 to 1) or to have zero mean and unit variance. This helps algorithms that are sensitive to feature scales 207.
  • One-hot encoding: Converts categorical variables into numerical format by creating a new binary column for each category 223.

🔑 Important: Models can suffer from underfitting (too simple, poor performance) or overfitting (too complex, performs well on training data but poorly on new data) 211.

14.3.3 Sample splitting

  • Training set: Used to train the machine learning model.
  • Validation set: Used to tune hyperparameters and evaluate model performance during development.
  • Test set: Used for a final, unbiased evaluation of the model's performance on unseen data.

🔑 Important: Proper data splitting is crucial for assessing a model's generalization ability and avoiding an overestimation of its performance.

🔑 Important: The entire topic of simulation, bootstrapping, and machine learning fundamentals relies on generating reliable random numbers for simulations and robust data splitting for model evaluation 212 240.

© 2026 Maeve. All rights reserved. This content is protected by copyright.

See also