0% found this document useful (0 votes)
12 views28 pages

Lecture 6. Statistics

The document discusses key statistics of random variables (R.V.), focusing on expectation (mean), variance, and skewness, which describe their probabilistic properties. It explains how these statistics can be calculated using either a known probability model or collected data. The document emphasizes the importance of these measures in practical applications and provides examples for better understanding.

Uploaded by

tszhonchan5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views28 pages

Lecture 6. Statistics

The document discusses key statistics of random variables (R.V.), focusing on expectation (mean), variance, and skewness, which describe their probabilistic properties. It explains how these statistics can be calculated using either a known probability model or collected data. The document emphasizes the importance of these measures in practical applications and provides examples for better understanding.

Uploaded by

tszhonchan5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

CIVL2160

Modelling Systems with


Uncertainties
Lecture 6

Key statistics of a R.V.


Zhe (Walter) Wang
Department of Civil & Environmental Engineering
Motivation: describing a random variable

• The probabilistic properties of a R.V. would be completely described by


its distribution function, in terms of CDF or PDF/PMF and its associated
parameters, are specified.
• Sometimes,
• Distribution functions are unknown: you only have data but no model
• Humans prefer to use a scalar, rather than a function, to describe the
(probabilistic) behavior
• E.g., accuracy of a model, total score of the exam, …
• Main descriptors give useful information on the numerical properties
of the R.V.s that are of first importance in many practical applications.
• Mean/expectation – a measure of central tendency
• Standard derivation – a measure of dispersion
• Skewness – a measure of skewness
01. Mean, or expectation

Agenda 02. Variance

03. Skewness

04. Summary
Expectation/mean

• Play a game 1000 times.


• Random gain at each play described by:
• “Average” gain?

• Expectation: the expected value in a large number of independent


repetitions of the experiment
Discrete random variable Continuous random variable

𝐸 𝑋 = 𝜇𝑋 = ෍ 𝑥𝑖 𝑝𝑋 (𝑥𝑖 ) 𝐸 𝑋 = 𝜇𝑋 = න 𝑥𝑓𝑋 (𝑥) 𝑑𝑥
−∞
𝑎𝑙𝑙 𝑥𝑖
Examples

• Expected value of a Bernoulli r.v.

𝐸 𝑋 =1∙𝑝+0∙ 1−𝑝 =𝑝

• Expected value of a uniform r.v. (uniform on a, a+1, … b)

1 1 1 𝑎+𝑏
𝐸 𝑋 =𝑎∙ + (𝑎 + 1) ∙ +…+ 𝑏∙ =
𝑏−𝑎+1 𝑏−𝑎+1 𝑏−𝑎+1 2
Examples

• Expected value of a uniform continuous r.v. (uniform between a and b)


∞ 𝑏
1 𝑎+𝑏
𝐸 𝑋 = න 𝑥𝑓𝑋 (𝑥) 𝑑𝑥 = න 𝑥 𝑑𝑥 =
−∞ 𝑎 𝑏−𝑎 2

• Expected value of a normal r.v.

𝐸 𝑋 =𝜇
Expectation/mean

• Expectation/mean is a measure of central tendency of a random variable


• There are other measures of central tendency
• Median: the mid-value of the given set of data when arranged in a particular order
• Mode: the most frequent number occurring in the data set
Example

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

• Suppose X is a r.v. about weeks of fX(x)


delay, and has a simple PDF as:
• The penalty of delay is directly 1
proportional to the no. of weeks,
following: 1 2 x weeks
𝑃𝑒𝑛𝑎𝑙𝑡𝑦 = 𝑔(𝑥) = 2000𝑥 2 (𝑖𝑛 $)

• Question: What is the expected penalty?

2
1 2000 3 2
𝐸 𝑝𝑒𝑛𝑎𝑙𝑡𝑦 = න 2000𝑥 2 × 1 𝑑𝑥 = 𝑥 | = $4667
1 2−1 3 1
Example

• Suppose X is a r.v. about weeks of fX(x)


delay, and has a simple PDF as:
• The penalty of delay is directly 1
proportional to the no, of weeks,
following: 1 2 x weeks
𝑃𝑒𝑛𝑎𝑙𝑡𝑦 = 𝑔(𝑥) = 2000𝑥 2 (𝑖𝑛 $)
2
1 2000 3 2
𝐸 𝑔(𝑥) = න 2000𝑥 2 × 1 𝑑𝑥 = 𝑥 | = $4667
1 2−1 3 1

• Let’s try another approach 𝑔 𝐸𝑥 = 2000[1.5]2 = 4500(≠ 4667)

𝑬 𝒈(𝒙) ≠ 𝒈 𝑬 𝒙
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

Agenda 02. Variance

03. Skewness

04. Summary
Variance

• Variance: a measure of the spread of the random variable

• Random variable 𝑋, with the mean 𝜇 = 𝐸[𝑋]


• Distance from the mean: 𝑋- 𝜇
• Average distance from the mean?
𝐸 𝑋−𝜇 =𝐸 𝑋 −𝜇 =𝜇−𝜇 =0
• Define:
var 𝑋 = E[(𝑋− 𝜇 )2 ]
Examples

• Variance of a Bernoulli r.v.

var(𝑋) = ෍ 𝑥 − E 𝑋 2 𝑝 (𝑥) = 𝑝(1 − 𝑝)


𝑋
𝑥
Properties of the variance

• var 𝑎𝑋 + b = 𝑎2 var 𝑋
• Review: E 𝑎𝑋 + b = 𝑎E 𝑋 + 𝑏

• var 𝑋 = E 𝑋 2 − (E[𝑋])2
Examples

• Variance of a Bernoulli r.v. var(𝑋) = ෍ 𝑥 − E 𝑋 2


𝑝𝑋 (𝑥) = 𝑝(1 − 𝑝)
𝑥

var 𝑋 = E 𝑋 2 − E 𝑋 2
= 𝑝 − 𝑝2

• Expected value of a uniform r.v. (uniform on a, a+1, … b)

var 𝑋 = E 𝑋 2 − E 𝑋 2
1
= (𝑏 − 𝑎)(𝑏 − 𝑎 + 2)
12
Other measures of spread

• Standard deviation, 𝜎𝑋
• Has the same unit of 𝑋

σ𝑋 = var 𝑋

• Coefficient of variance (c.o.v.), 𝛿𝑋


• A measure of dispersion relative to the central value
• Dimensionless, expressed in %
𝜎𝑋
𝛿𝑋 =
𝜇𝑋
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 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒

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

Agenda 02. Variance

03. Skewness

04. Summary
Skewness

• Skewness is a measure of the symmetry of PMF/PDF


• Skewness, 𝑆𝑘

𝑆𝑘 = ෍ (𝑥𝑖 − 𝜇𝑋 )3 𝑝𝑋 (𝑥𝑖 ) For discrete X


𝑎𝑙𝑙 𝑥𝑖


𝑆𝑘 = න (𝑥 − 𝜇𝑋 )3 𝑓𝑋 (𝑥) 𝑑𝑥 For continuous X
−∞

• Skewness coefficient (dimensionless) 𝑆𝑘


𝜃= 3
𝜎
Skewness

• Sign of 𝑆𝑘 has a physical meaning


• 𝑆𝑘 = 0: Zero skewness, or symmetrical
• 𝑆𝑘 > 0: Positive skewness, right skew
• 𝑆𝑘 < 0: Negative skewness, left skew

Positive Negative
skewness skewness
01. Mean, or expectation

Agenda 02. Variance

03. Skewness

04. Summary
Key statistics of a random variable

Definition Other Implication Other measures


names

Expectation First moment Central • Median
/mean 𝐸 𝑋 = න 𝑥𝑓𝑋 (𝑥) 𝑑𝑥 of inertia tendency • Mode
−∞

Variance var 𝑋 = E[(𝑋−𝜇𝑋 )𝟐 ] Second Spread • Standard deviation


= moment of • Coefficient of

‫׬‬−∞(𝑥 − 𝜇𝑋 )2 𝑓𝑋 (𝑥) 𝑑𝑥 inertia variance
(dimensionless)
Skew 𝑆𝑘 = E[(𝑋−𝜇𝑋 )𝟑 ] = Third Skewness • Skewness coefficient

3
moment of (dimensionless)
න (𝑥 − 𝜇𝑋 ) 𝑓𝑋 (𝑥) 𝑑𝑥 inertia
−∞
Summary

• Two scenarios to calculate the statistics

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

• Key statistics is not


adequate

You might also like