Lecture 6. Statistics
Lecture 6. Statistics
03. Skewness
04. Summary
Expectation/mean
𝐸 𝑋 =1∙𝑝+0∙ 1−𝑝 =𝑝
1 1 1 𝑎+𝑏
𝐸 𝑋 =𝑎∙ + (𝑎 + 1) ∙ +…+ 𝑏∙ =
𝑏−𝑎+1 𝑏−𝑎+1 𝑏−𝑎+1 2
Examples
𝐸 𝑋 =𝜇
Expectation/mean
2 2
• Fine the mean, median and mode of 𝑓𝑋 𝑥 = − 𝑥
3 9
3
• Mean 2 2 fX (x) • Mode?
𝐸 𝑋 = න 𝑥( − 𝑥 ) 𝑑𝑥
0 3 9
1 2 2 3 3 2
= 𝑥 − 𝑥 | =1 3
3 27 0
• Median 3
2 2
න ( − 𝑥 ) 𝑑𝑥 = 0.5
𝑥𝑚 3 9
2 1 2
1− 𝑥𝑚 − 𝑥𝑚 = 0.5
3 9 x
0 1 3
• Solve for 𝑥𝑚 and take the root that lies between 0 and 3
Properties of expectation
• If 𝑋 ≥ 0, then E[𝑋] ≥ 0
• If 𝑎 ≤ 𝑋 ≤ 𝑏, then 𝑎 ≤ E 𝑋 ≤ 𝑏
• If c is a constant, E 𝑐 = c
Expected value rule
Example
2
1 2000 3 2
𝐸 𝑝𝑒𝑛𝑎𝑙𝑡𝑦 = න 2000𝑥 2 × 1 𝑑𝑥 = 𝑥 | = $4667
1 2−1 3 1
Example
𝑬 𝒈(𝒙) ≠ 𝒈 𝑬 𝒙
Properties of expectation
• If 𝑋 ≥ 0, then E[𝑋] ≥ 0
• If 𝑎 ≤ 𝑋 ≤ 𝑏, then 𝑎 ≤ E 𝑋 ≤ 𝑏
• If c is a constant, E 𝑐 = c
• 𝑬 𝒈(𝒙) ≠ 𝒈 𝑬 𝒙
• E 𝑎𝑋 + 𝑏 = 𝑎E 𝑋 + 𝑏
• Proof: based on the expected value rule
01. Mean, or expectation
03. Skewness
04. Summary
Variance
• var 𝑎𝑋 + b = 𝑎2 var 𝑋
• Review: E 𝑎𝑋 + b = 𝑎E 𝑋 + 𝑏
• var 𝑋 = E 𝑋 2 − (E[𝑋])2
Examples
var 𝑋 = E 𝑋 2 − E 𝑋 2
= 𝑝 − 𝑝2
var 𝑋 = E 𝑋 2 − E 𝑋 2
1
= (𝑏 − 𝑎)(𝑏 − 𝑎 + 2)
12
Other measures of spread
• Standard deviation, 𝜎𝑋
• Has the same unit of 𝑋
σ𝑋 = var 𝑋
• X is a r.v. about the total load acting on a roof, with a PDF as follows
24 fX (x)
𝑓𝑋 = ቐ 𝑥 3 3≤𝑥≤6
0 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒
3 6 x
• Calculate the mean, variance, standard deviation, and c.o.v.
• Mean
6
24 −24 6
𝜇𝑋 = න 𝑥 3 𝑑𝑥 = | =𝟒
3 𝑥 𝑥 3
Example
• X is a r.v. about the total load acting on a roof, with a PDF as follows
24 fX (x)
𝑓𝑋 = ቐ 𝑥 3 3≤𝑥≤6
0 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒
6 3 6 x
• Variance 24
𝑉𝑎𝑟 𝑋 = න (𝑥 − 4)2 × 3
𝑑𝑥 = 𝟎. 𝟔𝟒
3 𝑥
• Standard deviation
𝜎𝑋 = 𝑉𝑎𝑟(𝑋) = 𝟎. 𝟖
• Coefficient of variance
𝜎𝑋 0.8
𝛿𝑋 = = = 𝟐𝟎%
𝜇𝑋 4
01. Mean, or expectation
03. Skewness
04. Summary
Skewness
∞
𝑆𝑘 = න (𝑥 − 𝜇𝑋 )3 𝑓𝑋 (𝑥) 𝑑𝑥 For continuous X
−∞
Positive Negative
skewness skewness
01. Mean, or expectation
03. Skewness
04. Summary
Key statistics of a random variable
Scenario 1 Scenario 2:
You have the probability model, i.e., You have collected a bunch of data
you know the probability function
of the random variable, CDF, or PMF
for discrete variables/PDF for
continuous variables
σ𝑖 𝑥𝑖
𝐸 𝑋 = 𝜇𝑋 = 𝑥𝑖 𝑝𝑋 (𝑥𝑖 ) 𝐸 𝑋 =
𝑛
𝑎𝑙𝑙 𝑥𝑖
∞
𝐸 𝑋 = 𝜇𝑋 = න 𝑥𝑓𝑋 (𝑥) 𝑑𝑥
−∞
Summary