Download Lecture 5: Exponential distribution

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Plateau principle wikipedia , lookup

Information theory wikipedia , lookup

Birthday problem wikipedia , lookup

Fisherโ€“Yates shuffle wikipedia , lookup

Hardware random number generator wikipedia , lookup

Taylor's law wikipedia , lookup

Randomness wikipedia , lookup

Generalized linear model wikipedia , lookup

Transcript
Stats for Engineers Lecture 5
Summary From Last Time
Discrete Random Variables
Binomial Distribution
๐‘› ๐‘˜
๐‘ 1โˆ’๐‘
๐‘˜
๐‘ƒ ๐‘‹=๐‘˜ =
๐‘›โˆ’๐‘˜
Probability of number of ๐‘˜ success when you do ๐‘› Bernoulli trials
Mean and variance
Poisson distribution
๐œŽ 2 = ๐‘›๐‘(1 โˆ’ ๐‘)
๐œ‡ = ๐‘›๐‘
๐‘’ โˆ’๐œ† ๐œ†๐‘˜
๐‘ƒ ๐‘‹=๐‘˜ =
๐‘˜!
Probablily of ๐‘˜ randomly occurring events, given average number is ๐œ†
Mean and variance
๐œ‡=๐œ†
๐œŽ 2 = var ๐‘‹ = ๐œ†
Is approximation to Binomial when n is large and p is small
Continuous Random Variables
Probability Density Function (PDF) ๐‘“(๐‘ฅ)
Uniform distribution
๏ƒฌ 1
๏ƒฏ
๐‘“ ๐‘ฅ = ๏ƒญ๏ฑ 2 ๏€ญ ๏ฑ 1
๏ƒฏ
๏ƒฎ0
๐‘
๐‘“ ๐‘ฅ โ€ฒ ๐‘‘๐‘ฅโ€ฒ
๐‘ƒ ๐‘Žโ‰ค๐‘‹โ‰ค๐‘ =
๐‘Ž
๏ฑ1 ๏‚ฃ x ๏‚ฃ ๏ฑ 2
otherwise
Poisson or not?
Which of the following is most likely to be well modelled by a
Poisson distribution?
1.
2.
3.
4.
Number of trains arriving at Falmer
every hour
Number of lottery winners each
year that live in Brighton
Number of days between solar
eclipses
Number of days until a component
fails
54%
23%
18%
5%
1
2
3
4
Are they Poisson? Answers:
1.
Number of trains arriving at Falmer every hour
NO, (supposed to) arrive regularly on a timetable not at random
2.
Number of lottery winners each year that live in Brighton
Yes, is number of random events in fixed interval
3.
Number of days between solar eclipses
NO, solar eclipses are not random events and this is a time between random
events, not the number in some fixed interval
4.
Number of days until a component fails
NO, random events, but this is time until a random event, not the number of
random events
Time between random events / time till first random event ?
If a Poisson process has constant average rate ๐œˆ, the mean after a time ๐‘ก is ๐œ† = ๐œˆ๐‘ก.
What is the probability distribution for the time to the first event?
โ‡’ Exponential distribution
Poisson - Discrete distribution: P(number of events)
Exponential - Continuous distribution: P(time till first event)
Exponential distribution
The continuous random variable ๐‘Œ has the Exponential distribution, with constant rate
parameter ๐œˆ if:
๐‘“ ๐‘ฆ =
๐œˆ๐‘’
0,
โˆ’๐œˆ๐‘ฆ
,
๐‘ฆ>0
๐‘ฆ<0
๐‘“(๐‘ฆ)
๐œˆ=1
๐‘ฆ
Occurrence
1) Time until the failure of a part.
2) Separation between randomly happening events
- Assuming the probability of the events is constant in time: ๐œˆ = const
Relation to Poisson distribution
If a Poisson process has constant average rate ๐œˆ, the mean after a time ๐‘ก is ๐œ† = ๐œˆ๐‘ก.
The probability of no-occurrences in time ๐‘ก is
๐‘’ โˆ’๐œ† ๐œ†๐‘˜
๐‘ƒ ๐‘˜=0 =
= ๐‘’ โˆ’๐œ† = ๐‘’ โˆ’๐œˆ๐‘ก .
๐‘˜!
If ๐‘“(๐‘ก) is the pdf for the first occurrence, then the probability of no occurrences is
๐‘ƒ(no occurrence by ๐‘ก) = 1 โˆ’ ๐‘ƒ(first occurrence has happened by ๐‘ก)
๐‘ก
=1โˆ’
๐‘“ ๐‘ก ๐‘‘๐‘ก
0
๐‘ก
๐‘ก
๐‘“ ๐‘ก ๐‘‘๐‘ก = ๐‘’ โˆ’๐œˆ๐‘ก
โ‡’1โˆ’
0
๐‘“ ๐‘ก ๐‘‘๐‘ก = 1 โˆ’ ๐‘’ โˆ’๐œˆ๐‘ก
โ‡’
0
Solve by differentiating both sides respect to ๐‘ก assuming constant ๐œˆ,
๐‘‘ ๐‘ก
๐‘‘
๐‘“ ๐‘ก ๐‘‘๐‘ก =
1 โˆ’ ๐‘’ โˆ’๐œˆ๐‘ก
๐‘‘๐‘ก 0
๐‘‘๐‘ก
โ‡’ ๐‘“ ๐‘ก = ๐œˆ๐‘’ โˆ’๐œˆ๐‘ก
The time until the first occurrence (and
between subsequent occurrences) has the
Exponential distribution, parameter ๐œˆ.
Example
On average lightening kills three people each year in the
UK, ๐œ† = 3. So the rate is ๐œˆ = 3/year.
Assuming strikes occur randomly at any time during the year so
๐œˆ is constant, time from today until the next fatality has pdf
(using ๐‘ก in years)
๐‘“ ๐‘ก = ๐œˆ๐‘’ โˆ’๐œˆ๐‘ก = 3 ๐‘’ โˆ’3๐‘ก
๐‘“(๐‘ก)
E.g. Probability the time till the
next death is less than one year?
1
1
3 ๐‘’ โˆ’3๐‘ก ๐‘‘๐‘ก
๐‘“ ๐‘ก ๐‘‘๐‘ก =
0
0
3๐‘’ โˆ’3๐‘ก
=
โˆ’3
๐‘ก
1
0
= โˆ’๐‘’ โˆ’3 + 1 โ‰ˆ 0.95
Exponential distribution
Question from Derek Bruff
A certain type of component can be purchased
new or used. 50% of all new components last
more than five years, but only 30% of used
components last more than five years. Is it
possible that the lifetimes of new components
are exponentially distributed?
1. YES
2. NO
53%
48%
1
2
Exponential distribution
A certain type of component can be purchased
new or used. 50% of all new components last
more than five years, but only 30% of used
components last more than five years. Is it
possible that the lifetimes of new components
are exponentially distributed?
Exponential distribution models time between independent randomly
occurring events, where frequency of events is independent of time.
i.e. probability of failing in the first 5 years has to be same as the
probability of failing in any other period of 5 years. No memory property.
The observed lifetimes imply that instead the failure rate must increase with time
NOT exponential
Mean and variance of exponential distribution
โˆž
๐œ‡=
โˆž
๐‘ฆ๐œˆ๐‘’ โˆ’๐œˆ๐‘ฆ ๐‘‘๐‘ฆ = โˆ’๐‘ฆ๐‘’ โˆ’๐œˆ๐‘ฆ
๐‘ฆ ๐‘“ ๐‘ฆ ๐‘‘๐‘ฆ =
โˆ’โˆž
โˆž
0
โˆž
โˆž
0
+
โˆž
0
โˆ’๐œˆ๐‘ฆ
๐‘’
๐‘’ โˆ’๐œˆ๐‘ฆ ๐‘‘๐‘ฆ = โˆ’
๐œˆ
1
๐œŽ =
๐‘ฆ ๐‘“ ๐‘ฆ ๐‘‘๐‘ฆ โˆ’ ๐œ‡ =
๐‘ฆ ๐œˆ๐‘’
๐‘‘๐‘ฆ โˆ’ 2
๐œˆ
โˆ’โˆž
0
โˆž
1
๐œ‡ 1
1
2 โˆ’๐œˆ๐‘ฆ โˆž
โˆ’๐œˆ๐‘ฆ
= โˆ’๐‘ฆ ๐‘’
๐‘ฆ๐‘’
๐‘‘๐‘ฆ โˆ’ 2 = 0 + 2 โˆ’ 2 = 2
0 +2
๐œˆ
๐œˆ ๐œˆ
๐œˆ
0
2
๐œŽ
2
2
๐œŽ
๐œˆ=3
๐œ‡=
1
3
2
โˆ’๐œˆ๐‘ฆ
โˆž
=
0
1
๐œˆ
Example: Reliability
The time till failure of an electronic component has an Exponential distribution and it
is known that 10% of components have failed by 1000 hours.
(a) What is the probability that a component is still working after 5000 hours?
(b) Find the mean and standard deviation of the time till failure.
Answer
Let Y = time till failure in hours; ๐‘“ ๐‘ฆ = ๐œˆ๐‘’ โˆ’๐œˆ๐‘ฆ .
1000
(a) First we need to find ๐œˆ
๐œˆ๐‘’ โˆ’๐œˆ๐‘ฆ
๐‘ƒ ๐‘Œ โ‰ค 1000 =
0
= โˆ’๐‘’ โˆ’๐œˆ๐‘ฆ
๐‘ƒ ๐‘Œ โ‰ค 1000 = 0.1 โ‡’
1000
0
= 1 โˆ’ ๐‘’ โˆ’1000๐œˆ
1 โˆ’ ๐‘’ โˆ’1000๐œˆ = 0.1
โ‡’ ๐‘’ โˆ’1000๐œˆ = 0.9
โ‡’ โˆ’1000๐œˆ = ln 0.9 = โˆ’0.10536
โ‡’ ๐œˆ โ‰ˆ 1.05 × 10โˆ’4
If ๐‘Œ is the time till failure, the question asks for ๐‘ƒ(๐‘Œ > 5000):
โˆž
๐œˆ๐‘’ โˆ’๐œˆ๐‘ฆ ๐‘‘๐‘ฆ
๐‘ƒ ๐‘Œ > 5000 =
5000
= โˆ’๐‘’ โˆ’๐œˆ๐‘ฆ
โˆž
5000
= ๐‘’ โˆ’5000๐œˆ โ‰ˆ 0.59
(b) Find the mean and standard deviation of the time till failure.
Answer:
Mean = 1/๐œˆ = 9491 hours.
Standard deviation = Variance
=
1
๐œˆ2
= 1/๐œˆ = 9491 hours
Is it exponential?
Which of the following random variables
is best modelled by an exponential
distribution?
Question adapted from
Derek Bruff
1.
2.
3.
4.
The distance between defects in an
optical fibre
The number of days between
someone winning the National
Lottery
The number of fuses that blow in the
UK today
The hours of sunshine in Brighton
this week assuming an average of
7.2hrs/day
39%
27%
27%
17%
1
2
3
4
Is it exponential?
Which of the following random variables
is best modelled by an exponential
distribution?
1.
The distance between defects in an optical fibre
- YES: continuous distribution that is the separation between independent random
events (the location of the defects)
2.
The number of days between someone winning the National Lottery
- NO: continuous (if you allow fractional days), but draws happen regularly on a
schedule
3.
The number of fuses that blow in the UK today
- NO: this is a discrete distribution โ€“ the number of events is a Poisson distribution
(exponential is the distribution of times between events)
4.
The hours of sunshine in Brighton this week assuming an average of 7.2hrs/day
- NO: This is a continuous variable, but not the time between independent random
events
Normal distribution
The continuous random variable ๐‘‹ has the Normal distribution if
the pdf is:
1
๐‘“ ๐‘ฅ =
2๐œ‹๐œŽ 2
๐œ‡: mean
๐‘’
โˆ’ ๐‘ฅโˆ’๐œ‡ 2
2๐œŽ2
(โˆ’โˆž < ๐‘ฅ < โˆž)
๐œŽ: standard deviation
Note: The distribution is also sometimes called a Gaussian distribution
X lies between ๐œ‡- 1.96 and ๐œ‡+ 1.96 with
probability 0.95
๐œŽ
i.e. X lies within 2 standard deviations of
the mean approximately 95% of the time.
โˆž
๐‘“ ๐‘ฅ ๐‘‘๐‘ฅ = 1
โˆ’โˆž
[see notes for proof]
If ๐‘‹ has a Normal distribution with mean ฮผ and variance ๐œŽ 2 , write ๐‘‹ โˆผ ๐‘ ๐œ‡, ๐œŽ 2
Occurrence of the Normal distribution
1) Quite a few variables, e.g. distributions of sizes, measurement errors,
detector noise. (Bell-shaped histogram).
2) Sample means and totals - see later, Central Limit Theorem.
3) Approximation to several other distributions - see later.