statics CH5
statics CH5
第五章 連續型隨機變數
(Continuous Random Variables)
授課教師:唐麗英教授
國立交通大學 工業工程與管理學系
聯絡電話:(03)5731896
e-mail:[email protected]
2013
☆ 本講義未經同意請勿自行翻印 ☆
本課程內容參考書目
• 教科書
– Mendenhall, W., & Sincich, T. (2007). Statistics for engineering and the sciences, 5th Edition. Prentice Hall.
• 參考書目
– Berenson, M. L., Levine, D. M., & Krehbiel, T. C. (2009). Basic business statistics: Concepts and applications,
11th Edition. Upper Saddle River, N.J: Pearson Prentice Hall.
– Larson, H. J. (1982). Introduction to probability theory and statistical inference, 3rd Edition. New York: Wiley.
– Miller, I., Freund, J. E., & Johnson, R. A. (2000). Miller and Freund's Probability and statistics for engineers,
6th Edition. Upper Saddle River, NJ: Prentice Hall.
– Montgomery, D. C., & Runger, G. C. (2011). Applied statistics and probability for engineers, 5th Edition.
Hoboken, NJ: Wiley.
– Watson, C. J. (1997). Statistics for management and economics, 5th Edition. Englewood Cliffs, N.J: Prentice Hall.
– 林惠玲、陳正倉(2009),「統計學:方法與應用」,第四版,雙葉書廊有限公司。
– 唐麗英、王春和(2013),「從範例學MINITAB統計分析與應用」,博碩文化公司。
– 唐麗英、王春和(2008),「SPSS 統計分析 14.0 中文版」,儒林圖書公司。
– 唐麗英、王春和(2007),「Excel 2007統計分析」,第二版,儒林圖書公司。
– 唐麗英、王春和(2005),「STATISTICA6.0與基礎統計分析」,儒林圖書公司。
– 陳順宇(2004),「統計學」,第四版,華泰書局。
– 彭昭英、唐麗英(2010),「SAS123」,第七版,儒林圖書公司。
統計學(一)唐麗英老師上課講義 2
隨機變數的兩種型式
統計學(一)唐麗英老師上課講義 3
隨機變數的兩種型式
𝐹𝑋 𝑡 = 𝑃 𝑋 ≤ 𝑡 𝑓𝑜𝑟 −∞≤𝑡 ≤∞
Remark:
– If X is a discrete R.V., then 𝐹𝑋 𝑡 = 𝑥≤𝑡 𝑃(𝑋 = 𝑡)
(i.e. 𝐹𝑋 𝑡 是一累積機率函數)
統計學(一)唐麗英老師上課講義 5
Example
(Cumulative) Distribution Function (c.d.f.)
• 例2 :
– Suppose a hat contains four slips of paper; each slip bears the
number 1, 2, 3 and 4. One slip is drawn from the hat without
looking. Let X be the number on the slip that is drawn.
統計學(一)唐麗英老師上課講義 7
(Cumulative) Distribution Function (c.d.f.)
2) 𝑙𝑖𝑚 𝐹𝑋 𝑡 = 0
𝑡→−∞
3) 𝑙𝑖𝑚 𝐹𝑋 𝑡 = 1
𝑡→∞
4) 𝐹𝑋 𝑡 is a right continuous function. (右連續函數)
(i.e., 𝑙𝑖𝑚 𝐹 𝑡 + ℎ = 𝐹 𝑡 𝑓𝑜𝑟 𝑎𝑛𝑦 𝑡 𝑎𝑛𝑑 ℎ > 0)
ℎ→0
• Note:
If X is a discrete R.V., then 𝑃 𝑋 ≤ 𝑏 ≠ 𝑃 𝑋 < 𝑏 . Why ?
統計學(一)唐麗英老師上課講義 9
(Cumulative) Distribution Function (c.d.f.)
• 例5 : Verify that
0 t 2
1 / 3 2 t 1
Fy (t ) 7 / 12 1 t 5
11 / 12 5 t 11
1 11 t
統計學(一)唐麗英老師上課講義 10
The Density Function for a
Continuous Random Variable
統計學(一)唐麗英老師上課講義 11
Continuous Random Variable
統計學(一)唐麗英老師上課講義 12
The Density Function for a Continuous R.V.
𝑑𝐹(𝑥)
f(x) = = 𝐹′(𝑥)
𝑑𝑥
統計學(一)唐麗英老師上課講義 13
Example
The Density Function for a Continuous R.V.
• Remark:
– If X is a continuous R.V. with a density function f(x), then
for any a < b the probability that X falls in the interval (a, b)
is the area under the density function between a and b:
𝑏
𝑃 𝑎≤𝑋≤𝑏 = 𝑎
𝑓 𝑥 𝑑𝑥
統計學(一)唐麗英老師上課講義 15
The Density Function for a Continuous R.V.
• Remark:
– If X is a continuous R.V., then the probability that X takes on
any particular value is 0:
𝑃 𝑋=𝑡 =0
統計學(一)唐麗英老師上課講義 16
The Density Function for a Continuous R.V.
• Remark:
– The c.d.f. can also be defined as
𝑡
𝐹𝑋 𝑡 = 𝑃 𝑋 ≤ 𝑡 = −∞
𝑓 𝑥 𝑑𝑥.
𝑏 𝑎
𝑃 𝑎 ≤ 𝑋 ≤ 𝑏 = 𝐹𝑋 𝑏 − 𝐹𝑋 𝑎 = 𝑓 𝑥 𝑑𝑥 − 𝑓 𝑥 𝑑𝑥
−∞ −∞
統計學(一)唐麗英老師上課講義 17
The Density Function for a Continuous R.V.
0 , 𝑡<0
𝐹𝑋 𝑡 = 𝑡 , 0≤𝑡≤1
1 , 𝑡>1
統計學(一)唐麗英老師上課講義 18
The Density Function for a Continuous R.V.
• 例7 :
derive FY(t).
統計學(一)唐麗英老師上課講義 19
Expected Values and Summary
Measures
統計學(一)唐麗英老師上課講義 20
Expected Value
𝐸 𝑋 = 𝜇𝑋 = 𝑥‧𝑝(𝑥)
𝑎𝑙𝑙 𝑥
統計學(一)唐麗英老師上課講義 21
Expected Value
• Remark :
– E(X) is a weighted average of all possible value of X with
each value weighted by it associated probability.
統計學(一)唐麗英老師上課講義 22
Variability of a Probability Function
St. D.(X) = σ = σ2
統計學(一)唐麗英老師上課講義 23
Definition and Theorem
• Def : Let X be a continuous R.V. with the density function f(x), and
let g(X) be any function of X. Then the expected value of g(X) is
∞
E g(X) = g(X) ‧f x dx
−∞
統計學(一)唐麗英老師上課講義 24
Definition and Theorem
σ2 =E[(X − μ)2 ]= E X 2 − μ2
a) μY = aμX + b
b) σ2Y =a2 σ2X
c) σY = a ‧σX
統計學(一)唐麗英老師上課講義 25
Expected Values and Summary Measures for
Continuous R.V.
統計學(一)唐麗英老師上課講義 26
Expected Values and Summary Measures for
Continuous R.V.
• Example 2:
– Suppose you agree to meet a friend (who is generally late) at
a specified time. Assume that you arrive on time and let the
random variable T be the length of time you must wait for
you friend. If the density function for T is assume to be
1
f t = , t ≧ 1 (minute)
t2
統計學(一)唐麗英老師上課講義 27
Expected Values and Summary Measures for
Continuous R.V.
• Example 3:
– Let X be a continuous R.V. with the density function
f(x) = 2x, 0 < x <1
Find
a) E(X)
b) E(X2), Var(X), St.D.(X)
統計學(一)唐麗英老師上課講義 28
Expected Values and Summary Measures for
Continuous R.V.
• Example 4:
– If T is a continuous R.V. with c.d.f.
FT (t) = 0 t<0
= t 0 ≦ t ≦1
=1 t>1
Find
a) mean, E(T)
b) Var(T) and St.D.(T)
統計學(一)唐麗英老師上課講義 29
課本例 Example 5.5
e y / 2
if 0 y
f ( y) 2
0 elsewhere
統計學(一)唐麗英老師上課講義 30
課本例 Example 5.5
Solution :
ye y / 2
E (Y ) yf ( y )dy dy
0 2
ay
e
ye ay dy 2 (ay 1)
a
1
By substituti ng a , we obtain
2
ye y / 2 1
dy (4) 2
0 2 2
統計學(一)唐麗英老師上課講義 31
課本例 Example 5.5
To find σ 2 , we will first find E(Y 2 ) by making use of the general formula
m ay
y e m m 1 ay
y e dy
m ay
y e dy
a a
1
Then with a and m 2, we ca write
2
y 2e y / 2 1
E (Y 2 ) y 2 f ( y )dy dy (16) 8
0 2 2
σ 2 E(Y 2 ) 2 8 2 2 4
σ σ2 4 2
統計學(一)唐麗英老師上課講義 32
課本例 Example 5.6
P(μ 2σ Y μ 2σ)
6 6e y / 2
f ( y )dy dy
0 0 2
e
y/2 6
0 1 e 3
1 0.049787 0.950213
統計學(一)唐麗英老師上課講義 33
連續型機率分佈
統計學(一)唐麗英老師上課講義 34
連續型機率分佈
• 常用的連續型機率分佈
1) 常態分佈(Normal Distribution)
2) 對數常態分佈(Lognormal Distribution)
3) 齊一分佈(Uniform Distribution)
4) 珈瑪分佈(Gamma Distribution)
5) 指數分佈(Exponential Distribution)
6) 韋伯分佈(Weibull Distribution)
7) 貝塔分佈(Beta Distribution)
統計學(一)唐麗英老師上課講義 35
常態分佈
(Normal Distribution)
統計學(一)唐麗英老師上課講義 36
常態分佈(Normal Distribution)
• 何謂常態分佈?
自然界所觀察到的許多連續型隨機變數常呈鐘形分佈,如
下圖所示。此鐘形分佈又稱為常態分佈(或高斯分佈)。
Source : http://en.wikipedia.org/wiki/Carl_Friedrich_Gauss
統計學(一)唐麗英老師上課講義 37
常態分佈(Normal Distribution)
• 常態機率分佈
1 ( x ) 2 / 2 2
f ( x) e , x
2
其中
• π = Mathematical constant approximated by 3.1416
• e = Mathematical constant approximated by 2.718
• μ = Population mean or the true mean
• σ2 = Population variance
It is denoted by N ( , )
統計學(一)唐麗英老師上課講義 38
常態分佈(Normal Distribution)
• 常態曲線
– 原始資料之 μ 與 σ 值不同時,其常態曲線之變化亦不同。
統計學(一)唐麗英老師上課講義 39
常態分佈(Normal Distribution)
• N(μ,σ) 的特性
1) 對稱於 μ。
2) 隨機變數 x 之值可由 -∞ 至 +∞ 。
3) 鐘形分佈。
4) 曲線下之面積為 1 。
5) 集中趨勢的三個量數(平均數、中位數及眾數)是一致的。
平均數=中位數=眾數
統計學(一)唐麗英老師上課講義 40
常態分佈(Normal Distribution)
• μ 與 σ 如何影響常態曲線
1) 下圖是三條有相同平均數μ但不同標準差 (σ1,σ2,σ3,
σ1<σ2<σ3) 之常態曲線
由此圖中你觀察到什麼?
統計學(一)唐麗英老師上課講義 41
常態分佈(Normal Distribution)
2) 下圖是三條有相同標準差σ但不同平均數 (μ1,μ2,μ3,
μ1<μ2<μ3) 之常態曲線
由此圖中你觀察到什麼?
由1)與2)可知: - 位置參數(Location parameter)
- 變異參數(Dispersion parameter)
統計學(一)唐麗英老師上課講義 42
如何使用常態機率表
• 何謂標準常態分佈?
– 平均數為0、標準差為1之常態分佈稱為標準常態分佈,
以 N(0,1) 表之。
– 例:令Z為 N(0,1) 之隨機變數,亦即Z~N(0,1),其常態曲線如下圖。
則,P(2≦Z≦3) = 曲線下介於 與 之間的面積=陰影部份
之面積
統計學(一)唐麗英老師上課講義 43
常態分佈(Normal Distribution)
• 如何利用表查出標準常態之機率
– 下頁表為標準常態分佈 N(0, 1) 之機率表。
– 設 Z~N(0, 1),請利用表找出下列之機率:
1) P(0≦Z≦1.96)=
2) P(-1.81≦Z≦1.81)=
3) P(0.53≦Z≦2.42)=
4) P(Z≧-0.36)=
統計學(一)唐麗英老師上課講義 44
利用表求
P(0≦Z≦1.96) =
利用表求
P(-1.81≦Z≦1.81)=
利用表求
P(0.53≦Z≦2.42)=
利用表求
P(Z≧-0.36)=
常態分佈(Normal Distribution)
– 設 Z~N(0, 1),請利用表 C 值:
1) P(Z < C) = 0.95
2) P(Z > C) = 0.7019
3) P(Z > C) = 0.1379
4) P(Z < C) = 0.0110
統計學(一)唐麗英老師上課講義 50
利用表求 C
P(Z < C) = 0.95
利用表求 C
P(Z > C) = 0.7019
利用表求 C
P(Z > C) = 0.1379
利用表求 C
P(Z < C) = 0.0110
常態分佈(Normal Distribution)
• 如何求出一般常態變數之機率
– 作法:先將其標準化(Standardize),轉換成標準
常態變數後,再求其機率。標準化之公式如下:
X
Z ,其中 Z~N( 0 ,1 )
統計學(一)唐麗英老師上課講義 55
X~N(10,2),利用右表
求 P(11≦X≦13.6) = ?
P (11 X 13.6)
11 10 13.6 10
P( Z )
2 2
P (0.5 Z 1.8)
X~N(10,2),利用右表
求 P(X > 12) = ?
P ( X 12)
12 10
P( Z )
2
P ( Z 1)
1 P ( Z 1)
常態分佈(Normal Distribution)
• 例:
– 假設某產品之長度資料呈常態分佈,其平均數為38.5公
分,標準差為2.5公分。若此產品之規格界限為38±2,請
問此產品之不良率為何?
統計學(一)唐麗英老師上課講義 58
規格界限為38±2
長度 X~N(38.5,2.5),
良率 P(36≦X≦40) = ?
P (36 X 40)
36 38.5 40 38.5
P( Z )
2 .5 2 .5
P (1 Z 0.6)
0.3413 0.2257
0.567
不良率= 1-良率
= 1-0.567
= 0.433
檢查數據是否呈常態分佈
統計學(一)唐麗英老師上課講義 60
檢查數據是否呈常態分佈
1) 利用直方圖
– 只要出現鐘形分佈圖形,即判定數據呈常態分佈
2) 利用常態機率圖
– 只要圖形呈直線,即判定數據呈常態分佈
3) 利用統計檢定
– 只要顯著度 p-value > 0.05,即判定數據呈常態分佈
a. 卡方適配度檢定(Chi-Square Goodness-of-fit Test)
b. K-S檢定(Kolmogorov-Smirnov test)
c. A-D檢定(Anderson-Darling Test)
統計學(一)唐麗英老師上課講義 61
檢查數據是否呈常態分佈
• 下列 75 筆數據為某模具上的孔徑尺寸值(mm),請檢查數據
是否呈常態分佈?
0.88 0.87 1.09 1.10 1.20
0.95 0.69 1.15 1.12 0.77
0.72 0.89 1.00 0.94 0.79
1.39 0.96 0.93 1.15 1.10
0.81 1.15 1.32 1.34 1.28
0.88 1.26 1.24 0.98 1.13
0.94 1.18 1.07 0.74 1.06
1.12 0.85 1.03 1.28 0.83
0.69 0.87 0.89 1.16 0.76
0.95 0.76 1.09 0.99 0.67
0.98 0.95 1.04 1.40 1.10
1.29 0.64 0.95 0.95 1.42
1.54 1.01 0.72 1.06 0.88
0.87 0.95 1.21 0.96 1.04
1.09 0.96 1.02 0.99 0.97
統計學(一)唐麗英老師上課講義 62
繪製直方圖
Histogram of SPI
Normal
20 Mean 1.013
StDev 0.1941
N 75
15
Frequency
10
0
0.6 0.8 1.0 1.2 1.4
SPI
統計學(一)唐麗英老師上課講義 63
繪製常態機率圖
60
50
40
30
20
10
5
0.1
0.50 0.75 1.00 1.25 1.50 1.75
SPI
統計學(一)唐麗英老師上課講義 64
連續型機率分佈
• 常用的連續型機率分佈
1) 常態分佈(Normal Distribution)
2) 對數常態分佈(Lognormal Distribution)
3) 齊一分佈(Uniform Distribution)
4) 珈瑪分佈(Gamma Distribution)
5) 指數分佈(Exponential Distribution)
6) 韋伯分佈(Weibull Distribution)
7) 貝塔分佈(Beta Distribution)
統計學(一)唐麗英老師上課講義 65
對數常態分佈
(Lognormal Distribution)
統計學(一)唐麗英老師上課講義 66
對數常態分佈 (Lognormal Distribution)
1 (ln x ) 2
1 2 2
x 0, 0
f ( x) 2 x e
0 otherwise
統計學(一)唐麗英老師上課講義 67
對數常態分佈 (Lognormal Distribution)
α = 0 ,β = 1
統計學(一)唐麗英老師上課講義 68
對數常態分佈 (Lognormal Distribution)
• 例1
The current gain of certain transistors is measured in units
which make it equal to the logarithm of 𝐈𝟎 /𝐈𝐢 , the ratio of the
output to the input current. If it is normally distributed with
μ = 2 and σ2 = 0.01, find
1) The probability that 𝐈𝟎 /𝐈𝐢 will take on a value between 6.1
and 8.2.
2) The mean and the variance of the distribution of 𝐈𝟎 /𝐈𝐢 .
統計學(一)唐麗英老師上課講義 69
齊一分佈
(Uniform Distribution)
統計學(一)唐麗英老師上課講義 70
齊一分佈 (Uniform Distribution)
統計學(一)唐麗英老師上課講義 71
齊一分佈 (Uniform Distribution)
• 例2
If X is uniformly distributed over (0, 10), calculate the
probability that
a) X < 3
b) X > 6
c) 3 < X < 8
統計學(一)唐麗英老師上課講義 72
齊一分佈 (Uniform Distribution)
• 例3
Buses arrive at a specified stop at 15-minute intervals starting
at 7, 7:15, 7:30, 7:45, and so on. If a passenger arrives at the
stop at a time that is uniformly distributed between 7 and 7:30,
find the probability that he waits
統計學(一)唐麗英老師上課講義 73
課本例 Example 5.7
a) Calculate the mean and standard deviation of Y, the thickness of the sheets
produced by this machine. Then graph the probability distribution, and show
the mean on the horizontal axis. Also show 1 and 2 standard deviation
intervals around the mean.
b) Calculate the fraction of steel sheets produced by this machine that have to
be scrapped.
統計學(一)唐麗英老師上課講義 74
課本例 Example 5.7
Solution :
a) 150 200
175 (mm)
2 2
( ) 2 200 150
14.43 (mm)
12 12 12
1 1 1
f ( y)
200 150 50
統計學(一)唐麗英老師上課講義 75
課本例 Example 5.7
Solution :
1 1
b) P (Y 160) (160 150) ( )
50 5
That is, 20% of all the sheets made by this machine must be scrapped.
統計學(一)唐麗英老師上課講義 76
珈瑪分佈
(Gamma Distribution)
統計學(一)唐麗英老師上課講義 77
珈瑪分佈 (Gamma Distribution)
1
x
x 1
e x 0, 0, 0
f ( x) ( )
0 otherwise
• Gamma function
( ) x 1e x dx where 0
0
統計學(一)唐麗英老師上課講義 78
珈瑪分佈 (Gamma Distribution)
α=3,β=1
α=5,β=1
統計學(一)唐麗英老師上課講義 79
珈瑪分佈 (Gamma Distribution)
f ( x) c( x) ( / 2 ) 1 e x / 2 (0 x 2 )
1
where c / 2
2 ( / 2)
統計學(一)唐麗英老師上課講義 80
課本例 Example 5.12
統計學(一)唐麗英老師上課講義 81
課本例 Example 5.12
• Solution
(2)(4) 8
2 2 (2)(4) 2 32
5 .7
Since Y=15 month lies barely more than 1 standard deviation
beyond the mean (μ+σ = 8 + 5.7 = 13.7 months), we would not
regard 15 months as an unusually large vale of Y. Consequently,
we would conclude that there is insufficient evidence to
indicate that the company’s new quality control program has
been effective in increasing the mean time between complaints.
統計學(一)唐麗英老師上課講義 82
指數分佈
(Exponential Distribution)
統計學(一)唐麗英老師上課講義 83
指數分佈 (Exponential Distribution)
1 x
x 0 and 0
f ( x) e
0
otherwise
統計學(一)唐麗英老師上課講義 84
指數分佈 (Exponential Distribution)
• 例5
– A nuclear engineer observing a reaction measures the time
intervals between the emissions of beta particles.
0.894 0.991 0.061 0.186 0.311 0.817 2.267 0.091 0.139 0.083
0.235 0.424 0.216 0.579 0.429 0.612 0.143 0.055 0.752 0.188
0.071 0.159 0.082 1.653 2.010 0.158 0.527 1.033 2.863 0.365
0.459 0.431 0.092 0.830 1.718 0.099 0.162 0.076 0.107 0.278
0.100 0.919 0.900 0.093 0.041 0.712 0.994 0.149 0.866 0.054
統計學(一)唐麗英老師上課講義 85
指數分佈 (Exponential Distribution)
1.5
Density
1.0
0.5
0.0
0.0 0.5 1.0 1.5 2.0 2.5 3.0
Milliseconds
統計學(一)唐麗英老師上課講義 86
指數分佈 (Exponential Distribution)
• Remark:
– It can be shown that in connection with Poisson processes
the waiting time between successive arrivals has an
exponential distribution.
統計學(一)唐麗英老師上課講義 87
指數分佈 (Exponential Distribution)
• 例6
– If on the average three trucks arrived per hour to be unloaded
at a warehouse, what are the probabilities that the time
between the arrival of successive trucks will be
a) Less than 5 minutes
b) At least 45 minutes
c) What is the expected waiting time between successive
arrivals?
統計學(一)唐麗英老師上課講義 88
本單元結束
統計學(一)唐麗英老師上課講義 89