King 5
King 5
Statistical Models
•
∑𝑎≤𝑦≤𝑏 P(𝑦)𝑑𝑦 discrete
Pr(𝑎 ≤ 𝑌 ≤ 𝑏) = { 𝑏
∫𝑎 P(𝑦)𝑑𝑦 continuous
•
P(𝑦) discrete
Pr(𝑌 = 𝑦) = {
0 continuous
• Quiz: why?
Pr(y)
0 1
y
• Expected value:
𝐸(𝑌 ) = ∑ 𝑦P(𝑦)
all 𝑦
= 0 Pr(0) + 1 Pr(1)
=𝜋
• Variance:
𝐸[𝑔(𝑌 )] = ∑ 𝑔(𝑦)P(𝑦)
all 𝑦
or
∞
𝐸[𝑔(𝑌 )] = ∫ 𝑔(𝑦)P(𝑦)𝑑𝑦
−∞
For example,
𝐸(𝑌 2 ) = ∑ 𝑦 2 P(𝑦)
all 𝑦
= 02 Pr(0) + 12 Pr(1)
=𝜋
Explanation:
• (𝑁 ) because (1 0 1) and (1 1 0) are both 𝑦 = 2.
𝑦
• 𝜋 𝑦 because 𝑦 successes with 𝜋 probability each (product
taken due to independence)
• (1 − 𝜋)𝑁 −𝑦 because 𝑁 − 𝑦 failures with 1 − 𝜋 probability each
• Moments: Mean 𝐸(𝑌 ) = 𝑁 𝜋; Variance 𝑉 (𝑌 ) = 𝜋(1 − 𝜋)/𝑁
Probability as a Model of the Data Generation Process 41 / 51 .
How to simulate from the Binomial distribution
−(𝑦𝑖 − 𝜇𝑖 )2
𝑁 (𝑦𝑖 |𝜇𝑖 , 𝜎 2) = (2𝜋𝜎 2 )−1/2 exp ( )
2𝜎 2
−(𝑦𝑖 − 𝜇𝑖 )2
𝑓𝑠𝑡𝑛 (𝑦|𝜇𝑖 ) = (2𝜋)−1/2 exp ( )
2
−𝑦𝑖2
𝑓𝑠𝑛 (𝑦𝑖 ) = (2𝜋)−1/2 exp ( )
2
• Standard version
𝑌𝑖 = 𝑥 𝑖 𝛽 + 𝜖 𝑖 = systematic + stochastic
𝜖𝑖 ∼ 𝑓 𝑁 (0, 𝜎 2 )
• Alternative version
𝑌𝑖 ∼ 𝑓𝑁 (𝜇𝑖 , 𝜎 2 ) stochastic
𝜇𝑖 = 𝑥𝑖 𝛽 systematic
• Generalized version
𝑌𝑖 ∼ 𝑓 (𝜃𝑖 , 𝛼) stochastic
𝜃𝑖 = 𝑔(𝑥𝑖 , 𝛽) systematic
𝑌𝑖 ∼ 𝑁 (𝑦𝑖 |𝜇𝑖 , Σ)
𝜇 𝜎 2 𝜎12
𝜇𝑖 = ( 1𝑖 ) Σ=( 1 )
𝜇2𝑖 𝜎12 𝜎22
• Mathematical form:
1
𝑁 (𝑦𝑖 |𝜇𝑖 , Σ) = (2𝜋)−𝑘/2 |Σ|−1/2 exp [− (𝑦𝑖 − 𝜇𝑖 )′ Σ−1 (𝑦𝑖 − 𝜇𝑖 )]
2
• Moments:
• 𝐸(𝑌 ) = 𝜇𝑖
• 𝑉 (𝑌 ) = Σ
• Cov(𝑌1 , 𝑌2 ) = 𝜎12 = 𝜎21
• Correlation (standardized covariance):
𝜎12
Corr(𝑌1 , 𝑌2 ) =
𝜎1 𝜎2
• Marginals:
∞ ∞
𝑁 (𝑌1 |𝜇1 , 𝜎12 ) = ∫ ⋯∫ 𝑁 (𝑦𝑖 |𝜇𝑖 , Σ)𝑑𝑦2 𝑑𝑦3 ⋯ 𝑑𝑦𝑘
−∞ −∞
6
4
4
2
2
0
0
1 1
0.8 0.8
0.6 1 1 1
0.6
0.8 0.8 0.8
0.4 0.4
0.6 0.6 1
βwi βwi
0.6
0.2 0.4 0.2 0.4 0.8
0
0.2 βbi 0
0.2 βbi βwi
0.4 0.6
0 0.2 0.4
βbi
0
0.2
0 0
(a) 0.5 0.5 0.15 0.15 0 (b) 0.1 0.9 0.15 0.15 0 (c) 0.8 0.8 0.6 0.6 0.5