0% found this document useful (0 votes)
9 views

Lecture 3

Uploaded by

ssrkr96
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Lecture 3

Uploaded by

ssrkr96
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 56

1

INSE 6320 -- Week 3


Risk Analysis for Information and Systems Engineering

• Random Variables
• Discrete Probability Distributions
• Continuous Probability Distributions
• Bayesian Analysis

Dr. M. AMAYRI Concordia University


2

What does Risk Management mean?

One wants to modify the profit distribution in order to satisfy the


preferences of the decision maker
Probability
0.20
OR…
0.18

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)

0.2 0.25 Probability that t = 2


A Discrete PDF 0.15
0.1 Only discrete
values (integers)
are possible
0 1 2 3 4 t
Discrete distribution
(e.g. number of severe storms)
4
Mean and Variance of a Discrete Random Variable
5

Expected Returns

• Expected returns are based on the probabilities of possible outcomes


n
E ( R ) = ∑ pi Ri
i =1

• In this context, “expected” means average if the process is repeated


many times
• The “expected” return does not even have to be a possible return
6

Example: Expected Returns


• Suppose you have predicted the following returns for stocks C and T in
three possible states of nature. What are the expected returns?

State Probability C T

Boom 0.3 0.15 0.25


Normal 0.5 0.10 0.20
Recession 0.2 0.02 0.01

• RC = .3(.15) + .5(.10) + .2(.02) = .099 = 9.99%


• RT = .3(.25) + .5(.20) + .2(.01) = .177 = 17.7%
7

Variance and Standard Deviation


• Variance and standard deviation still measure the volatility of returns, it
means how numbers in a data set are spread

• Using unequal probabilities for the entire range of possibilities

• Standard deviation as a risk measurement metric only shows how the


annual returns of an investment are spread out, and it does not necessarily
mean that the outcomes will be consistent in the future.

• 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

Example: Variance and Standard Deviation


• Consider the previous example. What are the variance and standard
deviation for each stock?


9

Example: Variance and Standard Deviation


• Consider the previous example. What are the variance and standard
deviation for each stock?

• 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 to be solved


• Consider the following information:

State Probability ABC, Inc.

Boom .25 .15


Normal .50 .08
Slowdown .15 .04
Recession .10 -.03

• What is the expected return?


• What is the variance?
• What is the standard deviation?
11

Another Example
• Consider the following information:
State Probability ABC, Inc.
Boom .25 .15
Normal .50 .08
Slowdown .15 .04
Recession .10 -.03

• What is the expected return?


▪E(R) = .25(.15) + .5(.08) + .15(.04) + .1(-.03) = .0805
• What is the variance?
▪Variance = .25(.15-.0805)2 + .5(.08-.0805)2 + .15(.04-.0805)2 + .1(-.03-.0805)2 = .00267475

• What is the standard deviation?


▪Standard Deviation = .051717985
12

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 )!

Where n! the factorial of n. e.g. 5!=5*4*3*2*1=120.


13
Binomial Distribution Example

For example, the presence-absence of drought in a year directly influences


the profit of agriculture due to irrigation costs added in a dry year. Suppose a
geographer is hired to do risk analysis for an Ag. Company whether a piece
of land is profitable for agriculture. Past experience shows that irrigation can
be afforded only one year in five. According to weather records, 4 out of the
last 25 years suffered from drought in the area.

Let 1 denote drought presence, and 0 denote drought absence, then

P(1)=4/25=0.16, so P(0)=1-0.16=0.84.

For 5 years, there are six possibilities of drought occurrence: 0, 1, 2, 3, 4, 5.

What is the probability of profitable agriculture?


What is the Risk in 5 years?
14

Drought occurrence probability in 5 years


⎛n⎞ n!
5! P(t ) = ⎜ ⎟ p t (1 − p )n −t = p t (1 − p )n −t
P(0) = 0.160 × 0.845−0 = 0.418 ⎝t⎠ x !(n − t )!
0!(5 − 0)!
5!
P(1) = 0.161 × 0.845−1 = 0.398 The probability of profitable agriculture
1!(5 − 1)!

5! The risk in five years?


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)!
15

Drought occurrence probability in 5 years


5! ⎛n⎞ n!
P(0) = 0.160 × 0.845−0 = 0.418 P(t ) = ⎜ ⎟ p t (1 − p )n −t = p t (1 − p )n −t
0!(5 − 0)! ⎝t⎠ x !(n − t )!

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

Drought occurrence probability in 5 years


5! ⎛n⎞ n!
P(0) = 0.160 × 0.845−0 = 0.418 P(t ) = ⎜ ⎟ p t (1 − p )n −t = p t (1 − p )n −t
0!(5 − 0)! ⎝t⎠ x !(n − t )!

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

Drought occurrence probability in 5 years


5! ⎛n⎞ n!
P(0) = 0.160 × 0.845−0 = 0.418 P(t ) = ⎜ ⎟ p t (1 − p )n −t = p t (1 − p )n −t
0!(5 − 0)! ⎝t⎠ x !(n − t )!

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

The Poisson distribution is


e−λ λ t
f (t ) = t = 0,1, 2,...
t!
Where the parameter λ>0 is the mean number of successes in the interval.
The mean and variance of the Poisson distribution are
µ =λ and σ2 =λ
19

Poisson Distribution: Example


Suppose a geographer is assessing the risk of summer wheat yields to ruined
hailstorms in a particular geographic location. Weather records show that in the
past 35 years show that 10 years with no hailstorm, 13 years with one hailstorm, 8
years with 2 hailstorms, 3 years with 3 hailstorms, and 1 year with 4 hailstorm.
Assume the occurrence of hailstorm is independent of past or future occurrences
and can be considered random. Then the number of hailstorms happening in any
given year follows Poisson distribution. t
e λ
−λ

The mean number of hailstorms in a year is 1.2, then f (t ) =


t!
t = 0,1, 2,...

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

▪ The mean value tells us where the


value x is concentrated most.
▪ The variance tell us how the value is
spread. The larger the variance, the
more the value spreads over a large
range. Is this good or bad?
21
Calculating Normal Probabilities

We can use the following function to convert any normal random variable to a
standard normal random variable…

X −µ
Z=
0 σ

Some advice: always


draw a picture!
22
Calculating Normal Probabilities
P(45 < T < 60) ?
…mean of 50 minutes and a
standard deviation of 10 minutes…

X −µ
Z=
0 σ

P(45 < T < 60) =


⎛ 45 − 50 T − µ 60 − 50 ⎞
P⎜ < < ⎟=
⎝ 10 σ 10 ⎠
P( −0.5 < Z < 1)
23
cumulative table

Examples:

Φ (0.76) = 0.776373
Φ (1.3) = ?
Φ (−3) = 1 − Φ (3) = ?
Φ (3.86) = ?
24
Lognormal Distribution – Probability Density Function

A random variable x is said to have the Lognormal Distribution with


parameters µ and σ, where µ > 0 and σ > 0, if the probability density
function of x is:

, for x >0

f(t)

0 t
25
Lognormal Distribution - Probability Distribution Function

A random variable x is said to have the Lognormal Distribution

If T ~ LN(µ,σ),

then Y= ln (T) ~ N(µ,σ)

⎛ 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 !!

➢Mean or Expected Value of T


1 2
µ+ σ
µT = E (T ) = e 2
➢Median of T
median = e µ

➢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

p = P(T > 120)


= 1 − P(T ≤ 120)
ln 120 − 5.0
= 1 − P( Z ≤ )
0. 1
= 1 − Φ( −2.12)
= 1 − 0.0170
= 0.983
Lognormal Distribution –Example Solution 32
The minimum acceptable strength, If the smallest 5% of strength values were
unacceptable.

(e) The value of t, say tms, for which P(T < tms ) = 0.05 is
determined as follows:

and ln tms − 5.0 ,


P( Z < ) = 0.05
0.1 ,
so that P( Z < −1.64) = 0.05
ln tms − 5.0 ,
= −1.64
therefore 0.1
xms = 125.964
33
Exponential Distribution
A random variable T is defined to be exponential random variable (or
say T is exponentially distributed) with positive parameter λ if its
probability density function is given by:
⎧λ e − λ t if t ≥ 0, λ > 0
f (t ) = ⎨
⎩0 if t < 0
∞ ∞
− λt − λt ∞
Note: ∫ f (t ) dt = ∫ λ e dt = − e =1
−∞ 0 0

Thus, f(x) is a probability density function.

The cumulative distribution function:


t
F (t ) = P(T ≤ t ) = ∫ f (τ ) dτ = 0
−∞
0
For t < 0, F (t ) = ∫ 0 dτ = 0
−∞
t
− λτ t
For t ≥ 0, F (t ) = ∫ λ e − λτ
dτ = −e = 1 − e − λt
0 0
− λt
⎧1 − e if t ≥ 0
F (t ) = ⎨
⎩0 if t < 0
E
34
xponential Distribution: Example

• The lifetime of a battery (measured in hours) is exponentially distributed with λ=


0.05. Find the probability a battery will last between 10 & 15 hours…
⎧1 − e − λt if t ≥ 0
F (t ) = ⎨
⎩0 if t < 0

P(10 ≤ T ≤ 15)
35

E
xponential Distribution: Example

• The lifetime of an alkaline battery (measured in hours) is exponentially distributed


with λ = 0.05. Find the probability a battery will last between 10 & 15 hours…
⎧1 − e − λt if t ≥ 0
F (t ) = ⎨
⎩0 if t < 0
P(10 ≤ T ≤ 15)
= F (15) − F (10)
P(10 ≤ T ≤ 15) = e − (0.05)(10) − e − (0.05)(15)
= e −0.5 − e −0.75
= 0.1341

“There is about a 13%


chance a battery will only last
10 to 15 hours”
Gamma Distribution 36

➢A continuous random variable T is said to have a Gamma Distribution, if


the probability density function of T is
t
1 α −1

β
α t e for t ≥ 0,
β Γ( α )
f (t ; α , β ) =
0 Otherwise

➢The Standard Gamma Distribution has = 1


➢The parameter is called the scale parameter because values other than
1 either stretch or compress the probability density function.
➢Important applications in waiting time and reliability analysis. Special cases
include exponential and chi-square distributions
Gamma Function 37

➢Definition
For , the Gamma Function is defined by

α −1 − x
Γ(α ) = ∫ x e dx
0
➢Properties of the gamma function:

(1) For any

(2) For any positive integer,

(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

Dr. M. AMAYRI Concordia University


40

Risk Assessment

• Hazard: potential source or situation which create damage, harm.


• A hazard analysis is a process used to assess risk.
• The results of a hazard analysis is the identification of unacceptable
risks and the selection of means of controlling or eliminating them.

• Probability is a way to predict stochastic events

• Risk: the likelihood of a specific effect within a specified period


41

Risk Assessment

• Probabilistic risk assessment (PRA) is characterized by two quantities:

▪ the magnitude (severity) of the possible adverse consequences, and


▪ the likelihood (probability) of occurrence of each consequence.
42

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

Cause Probability / year Cause Probability / year


All causes (illness) 1.19E-02 Rock climbing 8.00E-03
Cancer 2.80E-03 Canoeing 2.00E-03
Road accidents 1.00E-04 Hang-gliding 1.50E-03
Accidents at home 9.30E-05 Motor cycling 2.40E-04
Fire 1.50E-05 Mining 9.00E-04
Drowning 6.00E-06 Fire fighting 8.00E-04
Excessive cold 8.00E-06 Police 2.00E-04
Lightning 1.00E-07 Accidents at offices 4.50E-06

• 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

Example to express risk?


45

How to express risk?


46

The Bayesian approach


• Represent uncertainty by
probabilities
• Use Bayes’ theorem:
h = hypothesis
e = evidence
Starting
belief=‘prior’
P(h|e) = P(e|h) × P(h)
New belief P(e)
The Rev. Thomas Bayes
1702?-1761
Bayes’ theorem tells us – we start off with a belief in a hypothesis H, we get some information (e), we can
compute a new conditional probability, which becomes our new belief given that evidence
Bayes’ Theorem for Estimating Risk 47

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.

▪ Of these, four of the transactions reported by branch C have actually


been found to represent errors, whereas six of the transactions
reported by branch D were errors.

▪ 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.

▪ Of these, four of the transactions reported by branch C have actually


been found to represent errors, whereas six of the transactions
reported by branch D were errors.

▪ 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

This provides the required result, however we have only so far


considered how to combine the results of two branches. The same
approach could have been taken for any number of branches, say 70,
just by using a greater number of clauses.
52
Probability And Risk - A Bayes Theorem Example
Transactions are reported to risk management from three departments (M1, M2, M3)
according to the following table

M1 M2 M3

Percentage supplied 60 30 10
Probability transaction .95 .8 .65
not resulting in a loss

▪ If a transaction is found to actually resulting in a loss, what is the probability that


department M1 supplied it?
From the table the probabilities of actual losses are 0.05, 0.20 and 0.35 respectively.
Now using Bayes Theorem,
53
Probability And Risk - A Bayes Theorem Example
Transactions are reported to risk management from three departments (M1, M2, M3)
according to the following table
M1 M2 M3

Percentage supplied 60 30 10
Probability transaction .95 .8 .65
not resulting in a loss

▪ If a transaction is found to actually resulting in a loss, what is the probability that


department M1 supplied it?
▪ From the table the probabilities of actual losses are 0.05, 0.20 and 0.35 respectively.
Now using Bayes Theorem,
Prob(s | M 1 )Prob(M 1 )
Prob(M 1 | s ) =
Prob(s | M 1 )Prob(M 1 )+ Prob(s | M 2 )Prob(M 2 )+ Prob(s | M 3 )Prob(M 3 )
0.60 × 0.05
= = 0.24
0.05 × 0.60 + 0.20 × 0.30 + 0.35 × 0.10
It is therefore unlikely that branch M1 will have caused the loss, even though they represent 60% of the
population of transactions, since there is a 0.76 probability that the loss was caused by another branch.
54

Bayes’ Formula Example


• A drilling company has estimated a 40% chance of striking oil for their new
well.
• A detailed test has been scheduled for more information. Historically, 60%
of successful wells have had detailed tests, and 20% of unsuccessful wells
have had detailed tests.
• Given that this well has been scheduled for a detailed test, what is the
probability that the well will be successful?
55
Bayes’ Forumula Example
(continued)

• Let S = successful well


U = unsuccessful well
• P(S) = 0.4 , P(U) = 0.6 (prior probabilities)
• Define the detailed test event as D
• Conditional probabilities:
P(D|S) = 0.6 P(D|U) = 0.2
• Goal is to find P(S|D)
56

Bayes’ Formula Example


(continued)

Apply Bayes’ Formula:


P( D | S ) P( S )
P( S | D) =
P( D | S ) P( S ) + P( D | U ) P(U )
(0.6)(0.4)
=
(0.6)(0.4) + (0.2)(0.6)
0.24
= = 0.667
0.24 + 0.12

So the revised probability of success, given that this well has been
scheduled for a detailed test, is 0.667

You might also like