程式設計與統計軟體報告 伽瑪分配 (The Gamma Probability Distribution) 金融二 徐以軒 金融二 楊士鴻 The Gamma Probability Distribution A 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 Gamma Function Mean and Variance Mean and Variance shape=α表形狀參數;scale=s=β表尺度參數 Gamma Density Functions, β=1 R Command op=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) Gamma Density Functions, α=1 R Command op=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) Chi-Square Distribution Let 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 Exponential Distribution A random variable Y is said to have an exponential distribution with parameter β>0, α=1 if only if the density function of Y is In R Language In R Language Example The 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 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)) References 陳景祥(2014) 。《R軟體應用統計方法 》 。東華 http://en.wikipedia.org/wiki/Gamma_distribution#Char acterization_using_shape_k_and_scale_.CE.B8 (Wikipedia) http://ccckmit.wikidot.com/st:gamma (陳鍾誠) http://stat.ethz.ch/R-manual/Rpatched/library/stats/html/GammaDist.html （R Language） Dennis D. Wacherly, William Mendehall III, Richard L. Scheaffer, Mathematical Staticstics with Applications. Practice The 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?