Lecture Ba 03
Lecture Ba 03
ANALYTICS
LECTURE #3
STATISTICS
Random variables
Expectations
Standard deviation and variance
Parametric distributions
SUM OF GEOMETRIC SERIES
Be Careful
𝛿𝑆 = 𝑆 − 1 𝑆 = 𝛿 + 𝛿2 + 𝛿3 + ⋯
1=𝑆 1−𝛿
1 𝛿
𝑆= 𝑆=
1−𝛿 1−𝛿
SUM OF GEOMETRIC SERIES
Combination
How many different groups of k items can you create from n items?
Order does not matter
Example In general
Given {a, b, c}, you can create 3 combinations of 2 objects: 𝑛!
𝑛
𝐶𝑘𝑛 = =
{a, b} 𝑘 𝑘! 𝑛 − 𝑘 !
{a, c}
{b, c}
COMBINATORICS
Permutation
How many different groups of k items can you create from n items?
Order does matter
Example
In general
Given {a, b, c}, you can create 6 permutations of 2 objects:
There are k! ways to order k objects
{a, b} {b, a}
𝑛!
{a, c} {c, a} 𝑃𝑘𝑛 = 𝑘! × 𝐶𝑘𝑛 =
𝑛−𝑘 !
{b, c} {c, b}
MINI-QUIZ #1
RANDOM VARIABLES
Random variable
More than one possible outcome
Some outcomes may be more likely
Probability of all outcomes must be 100%
Discrete vs Continuous
Discrete: P[X = 5]
Continuous: P[0 ≤ Y ≤ 10]
RANDOM VARIABLES
Joint distribution
F↑ F↓ Conditional probability
M↑ 40% 10% P[𝑋|𝑌]
M↓ 20% 30% Independent random variables
P 𝑋&𝑌 = P 𝑋 P[𝑌] independence
Continuous
10
example: P[2 ≤ X ≤ 10] = 2 𝑝 𝑥 𝑑𝑥
∞
−∞ 𝑝 𝑥 𝑑𝑥 = 1
Conditional Expectations
If X = 5 + 10Y then
E[X] = 5 + 10E[Y]
E[X|Y] = 5 + 10Y (treat Y as if it were known, as if it was constant)
Independence ⇒ E[X|Y] = E[X]
PARAMETER ESTIMATES
Population vs sample
MINI-QUIZ #3
STANDARD DEVIATION & VARIANCE
Variance
Expectations 𝜎2 = 𝐸 𝑋 − 𝜇 2
= 𝐸 𝑋 2 − 𝐸[𝑋]2
1
Population 𝜎 2 = σ𝑛𝑖=1 𝑥𝑖 − 𝜇 2
𝑛
1 Standard deviation
Sample 𝜎2 = σ𝑛𝑖=1 𝑥𝑖 − 𝜇Ƹ 2
𝑛−1
+∞ 𝜎 = 𝜎2
2 2
Continuous 𝜎 = −∞ 𝑝 𝑥 𝑥 − 𝜇 𝑑𝑥
𝜎𝑎+𝑏𝑥 = |𝑏|𝜎𝑥
a.k.a. volatility
COVARIANCE & CORRELATION
Cov[X, Y]
σX,Y = E[(X − μX)(Y − μY)]
𝜎𝑋,𝑌
Corr[X, Y] = ρXY =
2
𝜎𝑋+𝑌 = 𝜎𝑋2 + 𝜎𝑌2 + 2𝜌𝜎𝑋 𝜎𝑌
𝑤1 𝜎1,1 ⋯ 𝜎1,𝑛
𝐰= ⋮ 𝚺= ⋮ ⋱ ⋮
𝑤𝑛 𝜎𝑛,1 ⋯ 𝜎𝑛,𝑛
MINI-QUIZ #4
NORMAL DISTRIBUTION
𝑋~𝑁 𝜇, 𝜎 2
Linear combination of independent normal variables is also normal
Excel: Norm.Dist(…) and Norm.Inv(…)
OTHER DISTRIBUTIONS
Bernoulli
Beta
Binomial
Chi-squared
Exponential
F-distribution
Poisson
Student’s t
Uniform