程式設計與統計軟體報告 伽瑪分配 (the gamma probability distribution) 金融二...

17
程程程程程程程程 程程 程程程程 (The Gamma Probability Distribution) 金金金 金金金 金金金 金金金

Upload: shona-flowers

Post on 24-Dec-2015

269 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: 程式設計與統計軟體報告 伽瑪分配 (The Gamma Probability Distribution) 金融二 徐以軒 金融二 楊士鴻

程式設計與統計軟體報告伽瑪分配(The Gamma Probability Distribution)

金融二 徐以軒金融二 楊士鴻

Page 2: 程式設計與統計軟體報告 伽瑪分配 (The Gamma Probability Distribution) 金融二 徐以軒 金融二 楊士鴻

The Gamma Probability DistributionA random variable Y is said to have a gamma

distribution with parameters α>0 and β>0 if and only if the density function of Y is

Page 3: 程式設計與統計軟體報告 伽瑪分配 (The Gamma Probability Distribution) 金融二 徐以軒 金融二 楊士鴻

Gamma Function

Page 4: 程式設計與統計軟體報告 伽瑪分配 (The Gamma Probability Distribution) 金融二 徐以軒 金融二 楊士鴻

Mean and Variance

Page 5: 程式設計與統計軟體報告 伽瑪分配 (The Gamma Probability Distribution) 金融二 徐以軒 金融二 楊士鴻

Mean and Variance

shape=α表形狀參數 ;scale=s=β表尺度參數

Page 6: 程式設計與統計軟體報告 伽瑪分配 (The Gamma Probability Distribution) 金融二 徐以軒 金融二 楊士鴻

Gamma Density Functions,β=1

Page 7: 程式設計與統計軟體報告 伽瑪分配 (The Gamma Probability Distribution) 金融二 徐以軒 金融二 楊士鴻

R Commandop=par(mfrow=c(2,2))用來合併多個圖表成為一張圖

curve(dgamma(x, 1,1), 0, 10)

curve(dgamma(x, 2,1), 0, 10)

curve(dgamma(x, 3,1), 0, 10)

curve(dgamma(x, 4,1), 0, 10)

Page 8: 程式設計與統計軟體報告 伽瑪分配 (The Gamma Probability Distribution) 金融二 徐以軒 金融二 楊士鴻

Gamma Density Functions,α=1

Page 9: 程式設計與統計軟體報告 伽瑪分配 (The Gamma Probability Distribution) 金融二 徐以軒 金融二 楊士鴻

R Commandop=par(mfrow=c(2,2))

curve(dgamma(x, 1,1), 0, 10)

curve(dgamma(x, 1,2), 0, 10)

curve(dgamma(x, 1,3), 0, 10)

curve(dgamma(x, 1,4), 0, 10)

Page 10: 程式設計與統計軟體報告 伽瑪分配 (The Gamma Probability Distribution) 金融二 徐以軒 金融二 楊士鴻

Chi-Square DistributionLet v be a positive integer. A random variable Y

is said to have a chi-square distribution with v degrees of freedom if and only if Y is a gamma-distributed random variable with parameters α=v/2 and β=2

Page 11: 程式設計與統計軟體報告 伽瑪分配 (The Gamma Probability Distribution) 金融二 徐以軒 金融二 楊士鴻

Exponential DistributionA random variable Y is said to have an

exponential distribution with parameter β>0, α=1 if only if the density function of Y is

Page 12: 程式設計與統計軟體報告 伽瑪分配 (The Gamma Probability Distribution) 金融二 徐以軒 金融二 楊士鴻

In R Language

Page 13: 程式設計與統計軟體報告 伽瑪分配 (The Gamma Probability Distribution) 金融二 徐以軒 金融二 楊士鴻

In R Language

Page 14: 程式設計與統計軟體報告 伽瑪分配 (The Gamma Probability Distribution) 金融二 徐以軒 金融二 楊士鴻

ExampleThe magnitude of earthquakes recorded in a region of Norh America can be modeled as having an exponetial distribution with mean 2.4, as measured on the Richter scale. Find the probability that an earthquake striking the region will

(a) exceed 3.0 on the Richter scale

(b) fall between 2.0 and 3.0 on the Richter scale

Page 15: 程式設計與統計軟體報告 伽瑪分配 (The Gamma Probability Distribution) 金融二 徐以軒 金融二 楊士鴻

Answer for Example(a)

1-pgamma(3,1,1/2.4)

(b)

1-pgamma(2,1,1/2.4)-(1-pgamma(3,1,1/2.4))

Page 16: 程式設計與統計軟體報告 伽瑪分配 (The Gamma Probability Distribution) 金融二 徐以軒 金融二 楊士鴻

References陳景祥 (2014) 。《 R 軟體應用統計方法 》 。東華

http://en.wikipedia.org/wiki/Gamma_distribution#Characterization_using_shape_k_and_scale_.CE.B8 (Wikipedia)

http://ccckmit.wikidot.com/st:gamma ( 陳鍾誠 )

http://stat.ethz.ch/R-manual/R-patched/library/stats/html/GammaDist.html ( R Language )

Dennis D. Wacherly, William Mendehall III, Richard L. Scheaffer, Mathematical Staticstics with Applications.

Page 17: 程式設計與統計軟體報告 伽瑪分配 (The Gamma Probability Distribution) 金融二 徐以軒 金融二 楊士鴻

PracticeThe operator of a pumping station has observed that demand for water during early afternoon hours an approximately exponential distribution with mean 100 cfs(cubic feet per second).

(a) Find the probability that the demand will exceed 200 cfs during the early afternoon on a randomly selected day

(b) What water-pumping capacity should the station maintain during early afternoon so that the probability that demand will exceed capacity on a randomly selected day is only .01?