Lecture 3
Lecture 3
• Random Variables
• Discrete Probability Distributions
• Continuous Probability Distributions
• Bayesian Analysis
0.16
INCREASE THESE
FREQUENCIES
REDUCE 0.14
THESE 0.12
FREQUENCIES
0.10
0.08
0.06
0.04
0.02
0.00
-300 -200 -100 0 100 200 300 400 500 600 700 800
Profit ξ
OR
BOTH!!!!
3
Random Variables and Probability Density Functions
A random variable is a quantity whose value is not known exactly but its probability distribution is known.
The value of the random variable will vary from trial to trial as the experiment is repeated. The variable’s
probability density function (PDF) describes how these values are distributed (i.e. it gives the probability that
the variable value falls within a particular interval).
Continuous PDFs
f(t) f(t)
All values between 0
and 1 are equally likely Smallest values
are most likely
0 1 0 t
t
Uniform distribution Exponential distribution
(e.g. soil texture) (e.g. event rainfall)
0.3
f (t)
Expected Returns
State Probability C T
• Standard deviation measures how far apart numbers are in a data set.
Variance, on the other hand, gives an actual value to how much the
numbers in a data set vary from the mean.
n
2 2
σ = ∑ pi ( Ri − E ( R))
i =1
8
•
9
• Stock C
▪ σ2 = .3(.15-.099)2 + .5(.1-.099)2 + .2(.02-.099)2 = .002029
▪ σ = .045
• Stock T
▪ σ2 = .3(.25-.177)2 + .5(.2-.177)2 + .2(.01-.177)2 = .007441
▪ σ = .0863
10
Another Example
• Consider the following information:
State Probability ABC, Inc.
Boom .25 .15
Normal .50 .08
Slowdown .15 .04
Recession .10 -.03
Binomial Distribution
In many Geographic studies, we often face a situation where we deal with a random
variable that only takes two values, zero-one, yes-no, presence-absence, over a given
period of time. Since there are only two possible outcomes, knowing the probability of one
knows the probability of the other.
P(1)=p
P(0)=1-p
If the random experiment is conducted n times, then the probability for the event to
happen t times follow binomial distribution:
⎛n⎞ t n −t n!
P(t ) = ⎜ ⎟ p (1 − p ) = p t (1 − p )n −t
⎝t⎠ x !(n − t )!
P(1)=4/25=0.16, so P(0)=1-0.16=0.84.
5!
P(3) = 0.163 × 0.845−3 = 0.029
3!(5 − 3)!
15
5!
P(1) = 0.161 × 0.845−1 = 0.398
1!(5 − 1)!
5!
P ( 2) = 0.16 2 × 0.845− 2 = 0.152
2!(5 − 2)!
5!
P(3) = 0.163 × 0.845−3 = 0.029
3!(5 − 3)!
5!
P ( 4) = 0.16 4 × 0.845− 4 = 0.003
4!(5 − 4)!
5!
P(5) = 0.165 × 0.845−5 = 0.000
5!(5 − 5)!
16
5!
P(1) = 0.161 × 0.845−1 = 0.398 The probability of profitable agriculture
1!(5 − 1)!
is summation of probabilities of no
5! drought and one drought in five years,
P ( 2) = 0.16 2 × 0.845− 2 = 0.152
2!(5 − 2)! i.e. 0.418+0.398=0.816
5!
P(3) = 0.163 × 0.845−3 = 0.029
3!(5 − 3)!
5!
P ( 4) = 0.16 4 × 0.845− 4 = 0.003
4!(5 − 4)!
5!
P(5) = 0.165 × 0.845−5 = 0.000
5!(5 − 5)!
17
5!
P(1) = 0.161 × 0.845−1 = 0.398 The probability of profitable agriculture
1!(5 − 1)!
is summation of probabilities of no
5! drought and one drought in five years,
P ( 2) = 0.16 2 × 0.845− 2 = 0.152
2!(5 − 2)! i.e. 0.418+0.398=0.816
5!
P(3) = 0.163 × 0.845−3 = 0.029 This the risk is 18.4% in five years.
3!(5 − 3)!
5!
P ( 4) = 0.16 4 × 0.845− 4 = 0.003
4!(5 − 4)!
5!
P(5) = 0.165 × 0.845−5 = 0.000
5!(5 − 5)!
Poisson Probability Distribution 18
e −1.21.20 e −1.21.21
P(0) = = 0.301 P(1) = = 0.361
0! 1!
e1.21.2 2 e1.21.23
P(2) = = 0.217 P(3) = = 0.087
2! 3!
e1.21.2 4
P ( 4) = = 0.026
4!
20
Normal Probability Distribution
• The normal probability distribution is the The normal distribution is
most important distribution for describing 1 −
( t − µ )2
2σ 2
f (t ) = e −∞<t <∞
a continuous random variable. σ 2π
• It has been used in a wide variety of with mean µ and variance σ 2
applications:
The normal distribution is: T ~ N ( µ , σ 2 )
▪ Heights and weights of people
▪ Test scores The visual appearance of the normal
▪ Scientific measurements distribution is a symmetric, unimodal or
▪ Amounts of rainfall bell-shaped curve as shown in the figure.
• It is widely used in statistical inference
We can use the following function to convert any normal random variable to a
standard normal random variable…
X −µ
Z=
0 σ
X −µ
Z=
0 σ
Examples:
Φ (0.76) = 0.776373
Φ (1.3) = ?
Φ (−3) = 1 − Φ (3) = ?
Φ (3.86) = ?
24
Lognormal Distribution – Probability Density Function
, for x >0
f(t)
0 t
25
Lognormal Distribution - Probability Distribution Function
If T ~ LN(µ,σ),
⎛ ln t − µ ⎞
F (t ) = P(T ≤ t ) = Φ ⎜ ⎟
⎝ σ ⎠
where Φ(z) is the cumulative probability distribution function of N(0,1)
26
Lognormal Distribution
Try to remember how to reach this equations !!
➢Standard Deviation of T
1
2
⎡ 2µ + σ 2 ⎛ σ 2 ⎞⎤
σT = ⎢e ⎜e
⎜ − 1 ⎟⎥
⎟
⎢⎣ ⎝ ⎠⎥⎦
27
Lognormal Distribution - Example
A theoretical justification based on a certain material failure mechanism
underlies the assumption that ductile strength T of a material has a
lognormal distribution.
If the parameters are µ=5 and σ=0.1 (location and scale)
Find:
(a)µT and σT
(b)P(T >120)
(c)P(110 ≤ T ≤ 130)
(d)The median ductile strength
(e)The minimum acceptable strength, If the smallest 5% of strength values
were unacceptable.
Lognormal Distribution –Example Solution 28
σ2
(a) µ+
µT = E (T ) = e 2
5.005
=e
= 149.16
2 µ +σ 2 σ2
σT = e (e − 1)
= 223
= 14.933
Lognormal Distribution –Example Solution 29
(b)
P(T > 120) = 1 − P(T ≤ 120)
ln 120 − 5.0
= 1 − P( Z ≤ )
0.1
= 1 − Φ( −2.13)
= 1 − 0.0166
= 0.9834
Lognormal Distribution –Example Solution 30
(C)
ln 110 − 5.0 ln 130 − 5.0
P(110 ≤ T ≤ 130) = P( ≤Z≤ )
0.1 0.1
= P( −2.99 ≤ Z ≤ −1.32)
= Φ( −1.32) − Φ( −2.99)
= 0.0934 − 0.0014
= 0.092
(d)
5
t0.5 = median = e = e = 148.41 µ
Lognormal Distribution –Example Solution 31
(e) Let Y=number of items tested that have strength of at least 120
y=0,1,2,…,10
(e) The value of t, say tms, for which P(T < tms ) = 0.05 is
determined as follows:
P(10 ≤ T ≤ 15)
35
E
xponential Distribution: Example
➢Definition
For , the Gamma Function is defined by
∞
α −1 − x
Γ(α ) = ∫ x e dx
0
➢Properties of the gamma function:
(3)
Gamma Density Functions 38
1
f (t ; α , β ) α = 2, β = 0.5
0.8
0.6 α = 1, β = 1
0.4 α = 2, β = 2
α = 2, β = 1
0.2
0 x
0 2 4 6 8
39
Risk Assessment
• Bayesian Analysis
Risk Assessment
Risk Assessment
Population at risk
Individual Risk
Individual risk is the risk of fatality or injury to any identifiable (named)
individual who lives within the zone impacted by a hazard, or follows a
particular pattern of life, that might subject him or her to the consequences of a
hazard.
Societal Risk
Societal risk is the risk of multiple fatalities or injuries in the society as a whole,
and where society would have to carry the burden of a hazard causing a number
of deaths, injury, financial, environmental, and other losses.
43
Individual risk
• Individual risk can be calculated as the total risk divided by the population at
risk.
• For example, if a region with a population of one million people
experiences on average 5 deaths from flooding per year, the individual risk
of being killed by a flood in that region is 5/1,000,000, usually expressed in
orders of magnitude as 5×10−6.
44
Suppose:
•h = “the athlete is taking steroids”
•e = “test result is positive”
And:
•P(h) = 0.01 (one in 100 people)
•P(e|h) = 0.8 (true positive rate)
•P(e|not h) = 0.1 (false positive rate)
What is P(h|e)?
48
Bayes’ Formula
▪ To deal with multiple probabilities mathematically we need to refer to Bayes
theorem. This type of modelling has become increasingly popular in areas such
as modelling for operational risk where there are a large number of variables to
consider.
▪ Bayes theorem says that if there are n disjoint events (events that have no
elements in common) that cover the sample space, then:
P(A | B i )P(B i )
P(B i | A) =
P(A | B 1 )P(B 1 ) + P(A | B 2 )P(B 2 ) + ⋅ ⋅ ⋅ + P(A | B k )P(B k )
where:
Bi = ith event of k mutually exclusive
and collectively exhaustive events
A = new event that might impact P(Bi)
49
Probability And Risk - A Bayes Theorem Example
▪ Two branches of a retail bank, C and D, have each reported eight
transactions to risk management for review.
▪ The question, which we shall answer, is given that an error has been
identified by senior management as requiring special attention, what is
the probability that this originated from branch C?
50
Probability And Risk - A Bayes Theorem Example
▪ Two branches of a retail bank, C and D, have each reported eight
transactions to risk management for review.
▪ The question, which we shall answer, is given that an error has been
identified by senior management as requiring special attention, what is
the probability that this originated from branch C?
It is known that:
Prob (error|C) = 4/8 = 0.5
Prob (error|D) = 6/8 = 0.75
Prob (C) = Prob (D) = ½ (since each branch is equally likely, having each
reported eight transactions)
51
Probability And Risk - A Bayes Theorem Example
P(A | B i )P(B i )
P(B i | A) =
P(A | B 1 )P(B 1 ) + P(A | B 2 )P(B 2 ) + ⋅ ⋅ ⋅ + P(A | B k )P(B k )
P rob(C )P rob(error | C )
P rob(C | error) =
P rob(C )P rob(error | C ) + P rob( D)P rob(error | D)
0.5 × 0.5
=
0.5 × 0.5 + 0.5 × 0.75
= 0.4
M1 M2 M3
Percentage supplied 60 30 10
Probability transaction .95 .8 .65
not resulting in a loss
Percentage supplied 60 30 10
Probability transaction .95 .8 .65
not resulting in a loss
So the revised probability of success, given that this well has been
scheduled for a detailed test, is 0.667