0, VOL. 25, NO. 4, NOVEMBER 1983

A Two-Sample Test of Equal Gamma Distribution Scale Parameters With Unknown Common Shape Parameter

Wei-Kei Shiue Lee J. Bain

Dept. of Mathematics and Computer Science Dept. of Mathematics and University of Nebraska-Omaha University of Missouri-Rolla Omaha, NE 68182-0243 Rolla, MO 65401

An approximate F-test for the equality of two gamma distribution scale parameters, given equal but unknown shape parameters, is proposed and investigated. The test is obtained by replacing the shape parameter by its maximum likelihood estimate. Monte Carlo and asymp- totic results show that in many cases this substitution does not seriously affect the nominal test size. Additionally, these results can be used to modify the test to more closely achieve the desired size. An example from a cloud seeding experiment is given.

KEY WORDS: Gamma distribution; Two-sample tests; Tests of equal scale parameters; Approximate tests; Maximum likelihood.

1. INTRODUCTION distribution has been suggested,for example, as the failure time model for a system under continuous The gamma distribution is well known, dating back maintenance, where the reliability may experience at least to Laplace (1836),and it is Type III of Pear- some degradation (or growth) initially but then son’s system of distributions. Early applications were reachesa stable state as time goeson. involved more with its use as a derived distribution The gamma distribution has also receivedconsider- and its relationship to the chi-squared distribution, able attention in the area of weather analysis, and an but it has become increasingly important as a popu- example in this area is discussedlater. lation model, particularly now that its statistical Statistical techniques have been somewhat difficult properties are being developed. to develop for the gamma distribution, partly because Johnson and Kotz (1970) give a good general the parameters are not of the convenient location- review of the gamma distribution, including several scale type. Supposethat G(x; 0, IC)denotes a gamma referencesto applications in diverse fields. The gamma distribution with density model is consideredfrequently in the area of reliability 1 and life testing. This may be partly due to its relation- g(x; 8, K) =- x K-1,-x/s x >o; K, e > 0. ship to the Poisson process,since the waiting time to r(ti)eK ’ kth occurrenceof a Poisson processfollows a gamma distribution. More importantly, however, it is a gener- (1) alization of the exponential distribution, and it pro- The mean is p = E(X) = 14. The parameters K and 0 vides a rather flexible skewed density defined over the are referred to as shape and scale parameters,respec- positive range. Its hazard function may be increasing tively. Optimum tests for 8 with K as an unknown or decreasing, but it approaches a constant as time nuisance parameter are derived by Engelhardt and approaches infinity. This represents a useful alter- Bain (1977),based on the conditional distribution of native to the Weibull distribution whose hazard func- X given 2, in which X and 1 denote the arithmetic and tion approaches either infinity or zero. The gamma geometric sample means,respectively. Tests for K with

377 378 WEI-KEI SHIUE AND LEE J. BAIN

0 unknown may be based on rl or, equivalently, on the true significancelevels S = In (X/g). Bain and Engelhardt (1975)provide ap- P(K, a) = Pr [X/p < &2n12)/2nCJ, proximate distributional results for S in the form (6) and show that the dependenceon K is small, although 2?lKCS i- x2(v), (2) the true level may be somewhat different from the where c and v are functions of n and K and x’(v) nominal level for small n. They provide information denotesa chi-squared random variable with v degrees for adjusting the test so that the approximate level will of freedom. For K 2 2, be near the prescribed nominal level. Almost identical procedurescan be applied to the two-sample case. 2nKS i, X*(n - 1). (3) Few other exact inferenceprocedures have beendevel- 3. TWO-SAMPLE TEST oped for the gamma distribution when both param- SupposeX denotesthe mean of a random sampleof eters are assumed to be unknown. Grice and Bain size n, from G(x; 0i, K) and y is the mean of an (1980)provide approximate tests or confidence limits independent random sample of size n2 from G(y; eZ, for the mean of a gamma distribution when both K). If K is known, a size a test of H,: 8, = e2 against parameters are assumed to be unknown. Their ap- H,: 0i < 8, is to reject H, if proach is extended in this article to the problem of testing the equality of means(or scale parameters)for x -zr < F,(2rllK, 2n, K), (7) two independent gamma populations with the shape Y parametersassumed unknown but equal. Crow (1977) where F&vi, v2) denotes the lower a percentile of Sne- discussesthis problem for the log-normal and gamma decor’s F distribution. This follows becausewhen H, models for the shapeparameter known case,and con- is true, then siders an application to cloud seeding experiments. Barker (1981) discusses the optimum allocation of ---rvx R/K8, XZ{2rllK)/2rllK (8) samplesizes for the sameproblem. P - VKo, X2(2n, K)/2rl,K' In the area of life testing, the limiting hazard rate is l/O, so that testing equal scale parameters is equiva- As for the one-samplecase, one expectsgood results lent to testing the equality of limiting hazard rates. if K is replaced by I? in (7), where Iz now denotes the Note that under the assumption of equal shape pa- MLE based on the combined sample data xi, . . . , x,,, rameters,the test of equal scale parametersis actually y,, ..., yn2. Crow (1977) uses this approach also in a test to determine whether the populations are identi- computing confidencelimits in a cloud seedingexperi- cal. Also, the assumption of equal shape parameters ment. The actual size of the approximate test is given may not always be appropriate and should not be by -- made automatically. For larger K values, the Equation P(K, a) = Pr [X/Y< F,(2n,rZ, 2n, <)I. (9) (3) approximation can easily be used to obtain an F This probability does not depend on 0 since the joint test ofH,: ICY= K~. - -. density of B and X/YIS free of 8, and it dependslittle on K. 2. ONE-SAMPLE TEST Values of P(K, &) have been estimated by Monte The approximate method studied by Grice and Carlo simulation for various values of K, ~1,nl, and n2. Bain (1980) for testing the mean in the one-sample Table 1 presentsthese for values of n, and n2 of 10 and case is briefly described first. Then, the method is 20. Limiting valuesof extendedto the two-sample case. P(0, a) = lim P(K, a) and P(co, CI)= lim P(K, a) It is well known that K-O K+cc are derived in Section 6 and included in Table 1. The 2nX/9 - X2(2nK), (4) values are helpful for verifying the Monte Carlo re- where x2(v) denotes a chi-squared distribution with v sults and for interpolation purposesoutside the range degrees of freedom. When K is known, a uniformly of the Monte Carlo study. Similar results were ob- most powerful size c( test of H,: p 2 p0 against H,: tained for other combinations of n, and n2 and other c( p < p0 is to reject H, if levels. - Table 1 indicates that for fixed ~1,n,, and n2, the 2 < X;(2nK)/2nK. (5) P(K, a) are nearly constant except for small K and small n, and they are close to the limiting value P(co, It is natural to consider replacing K by R in (5) for c().Thus, (7) with K replaced by Izprovides an approxi- the K unknown case,where r?is the maximum likeli- mate test, particularly for moderate sample sizes,with hood estimator of K. Grice and Bain (1980)compute the true level being slightly above the prescribed level.

TECHNOMETRICS $2, VOL. 25, NO. 4, NOVEMBER 1983 A TEST OF GAMMA SCALE PARAMETERS 379

Table 1. Values of P(Ic, a) 4. NUMERICAL EXAMPLE Crow (1977)considers hail data from a cloud seed- a ing experiment with n, = 16 and X = 13.366for non- n1 4 K .Ol .05 .lO seededdays and n2 = 17 and jj = 13.249for seeded days. Crow comments that the effect (if any) of seeding 10 10 0 ,017 ,063 .1 15 is expected to be an increase in the scale parameter. .l ,015 ,057 ,107 .2 ,014 ,057 ,107 He also computes the estimates R, = .382 and R, = .5 ,016 ,060 ,111 .466 with asymptotic standard errors of .109 and .131, 1 .o ,016 ,060 .llO respectively. Finding no significant difference he com- 2.0 ,017 ,062 ,113 co .018 ,063 ,113 putes the pooled estimate 12= .4211and computes the approximate 90% confidence interval for p = p2/p1 20 20 0 ,013 ,056 ,107 .l ,012 ,053 ,103 given by .2 ,012 ,053 ,102 ,. .5 .013 ,055 ,106 f F.,,(2n,k, 2n, 12) < p < f F,,,(2n,R, 2n, 2) 1.0 ,013 ,055 ,105 [- 2.0 ,014 ,056 ,107 1 cc ,014 ,056 .107 = (.39, 2.45). (11) 10 20 0 ,015 .060 ,113 .l ,013 ,055 ,105 Crow points out that the interval would presum- .2 ,013 ,055 ,105 ably be even longer if the uncertainty due to esti- .5 ,014 ,058 ,108 mating K were taken into account. We can now see 1 .o ,014 ,057 ,107 2.0 ,015 ,058 ,109 from Table 1 that the true confidence level is close to r*, ,015 ,058 ,109 1 - 2(.055)= .89 (using the (20, 20) entry for both tails). In this case n, + n2 = 33, and interpolating be- 20 10 0 ,014 ,056 ,106 .l ,012 ,053 .103 tween 20 and 40 in Table 2 shows a more exact 90% .2 ,012 ,053 ,103 confidence interval for p would be obtained by using .5 ,014 ,056 .107 ercentiles of the F distribution. 1.0 ,014 ,056 ,106 the F.,,, and F.958 P 2.0 .014 ,058 ,108 Even though K may be fairly small in this example and a, ,015 ,058 ,109 n1 and n, are also small, the unmodified procedure or use of Table 2 basedon limiting values still appearsto give good results. In life-testing applications it is usual As Grice and Bain (1980) discuss, one may wish to to have K > 1, becausethis correspondsto an increas- modify the test for small sample sizes so that the ing failure-rate model. actual level is closer to the prescribed nominal level. Since P(K, /I) G P(co, /3), for small n, and n, an ap- 5. MONTE CARLO METHOD proximate size a test of H,: 8, = 8, against H,: 8, < -- -- e2 is to reject H, if Because X/Y and Iz are independent and XJYw F(2n,K, 2n, K), we may write, analogously, to Grice x = < F,(2n,l, 2n, I?), (10) and Bain (1980) Y m - where fi is the value such that P(co, p) = a. WG 8) = Pr $ < F&2n,a; 2n, a)) Iz = a &(a) da For the one-sample case, Grice and Bain (1980, s0 [ 1 Table 2) tabulate the required values of /I for the = E,{F(FD(2n112, 2n, 12); 2n,tc, 2n, K)}, (12) commonly selected values of a. As Section 6 shows, the limiting value P(cc, /I) for the two-sample case is where F(x; 2n,K-, 2n, K) denotes the cumulative Sne- identical to P,(co, /I) for the one-sample case if n is decor’sdistribution. replaced by n1 + n2. For convenience Table 2 pro- We used the subroutine GGAMR from IMSL vides the values of /I that should be selectedin order to obtain a more nearly prescribed size a test. For exam- ple, if n1 + n2 = 20, a test with approximate level Table 2. Values of /Ifor which PI ( CO, p) = a a = .05 is obtained by choosing /I = .038. Again, for many practical purposes, this amount of difference a may not be enough to require any adjustment as long as the general magnitude of the difference involved is n1 +n2 ,005 .Ol ,025 ,050 ,075 ,100 ,250

known. 10 .0003 .0015 .0086 .0267 .0486 .0724 .2294 Note also that for the alternative H,: d1 > fl,, the 20 .0017 .0046 .0159 .0380 .0619 .0866 .2403 actual significance level may be obtained by inter- 40 .0030 .0070 .0203 .0440 .0685 .0934 .2453 cc .0050 .OlOO .0250 .0500 .0750 .lOOO .2500 changing n, and n2.

TECHNOMETRICS 0, VOL. 25, NO. 4, NOVEMBER 1983 380 WEI-KEI SHIUE AND LEE J. BAIN

(1982)to generaterandom samplesof gamma variates. by application of the Berry-Esseen and Helly-Bray For fixed K and ,& we used 19,800-20,000 gamma theorems. variates for different combinations of n, and n, . Cu- For the two-sample case, V is the same as before mulative probabilities were evaluated by subroutine with n replaced by n, + n2, since Iz is based on --the MDFI, also from IMSL. The rational approximation combined sample. For the two-sample case T = X/Y derived by Greenwood and Durand (1960) was used h- F(2n,K, 2n, K) rather than gamma, but according to compute rZ. to Ahuja and Nash (1967) the distribution of [nln2 K/h + ndl ‘j2 In T converges to a standard normal 6. ASYMPTOTIC RESULTS distribution. Thus, for the two-sample case The asymptotic results for the two-sample case are similar to the results for the one-samplecase, and the PUG P) = mF(F&2n,u, 2% a); 2n,rc, 2n, K)&(U) da, limiting expressionsobtained for the probabilities are s0 given in (13)and (14).As ~--t co, we have (17) m and analogously to the one-samplecase as K+ co, the PC% P) = @[zauiiz/(nl + n,)1’2] s0 limiting value of P(co, B) is given by (13), which is identical with the one-sampleresult with n replacedby x du; 2, h + n2 - 1)/2) do, (13) n, + n,. andasic-+O, As K-+ 0 we now have

P(0, /?) = -+ 1 - -J- w = (n:y1;;)1,2 ln T 1 2 4 + n2 converging to the double exponential distribution rather than the exponential distribution, where

4w(w) = (4 + W2 D-=----n2 exp (w(n: + n:)“‘/n,), 4 + n2 4 + n2 - co---n, + nz’ case with n = n, + n,. Thus, the limiting results for the two-sample case can be obtained along the same where O(z) denotes the standard normal cdf and lines followed for the one-samplecase, with the double Q(q?)= P. exponential distribution playing the role of the ex- A sketch of the modifications neededfor the two- ponential. Equation (14) gives the results after con- sample case will be given. For the one-sample case, siderablemanipulation. Grice and Bain (1980)consider V = 2nK[ln r?- $(a)], and T = n&jp, where T - G(t; 1, nfc) and -nlc In T 7. CONCLUSIONS converges to a standard exponential distribution as Testing the equality of two gamma distribution K-+ 0. Also V convergesto a chi-squared distribution scale parameters,given equal unknown shapeparam- with n - 1 degrees of freedom as K+ cc and to a eters,can be accomplishedwith an approximate F test chi-squared distribution with 2(n - 1) degreesof free- obtained by replacing the shapeparameter by its max- dom as K+ 0. Also, imum likelihood estimate. Our results show that the Pl(~, p) = Pr [T < (~/l?)G,(l, nt?)] approximation error is negligible in many cases.In other casesour results can be used to modify the F = mGC(W~p(l, 4; 1, nKlW) do, test and reducethe approximation error. s 0 and (15) [Received June 1982. Reuised January 1983.]

Pl(P 4 = mcD[z,(u/n)1~2]g(u; 2, (n - 1)/2) du, REFERENCES s 0 AHUJA, J. C., and NASH, STANLEY W. (1967), “The Generalized (16) Gompertz-Verhulst Family of Distributions,” Sankhya, Ser. A,

TECHNOMETRICS 0, VOL. 25, NO. 4, NOVEMBER 1983 A TEST OF GAMMA SCALE PARAMETERS 381

29,141l156. GREENWOOD, J. A. and DURAND, D. (1960), “Aids for Fitting BAIN, LEE J., and ENGELHARDT, MAX (1975). “A Two- the Gamma Distribution by Maximum Likelihood,” Techno- Moment Chi-Square Approximation for the Statistic Log (X/z).” metrics, 2, 55-65. Journal of the American Statistical Association, 70,94%950. GRICE, JOHN V., and BAIN, LEE J. (1980) “Inferences Con- BARKER, L. (1981) “Allocating Observations in a Test for Ratio cerning the Mean of the Gamma Distribution,” Journal of the of Scales of Independent Gamma Variates,” Communications in Americun Statistid Association, 75,929-933. Statistics, AlO, 2469-2473. INTERNATIONAL MATHEMATICAL AND STATISTICAL CROW, E. L. (1977), “Minimum Variance Unbiased Estimators of LIBRARIES, INC. (1982), IMSL Subroutines (9th ed.), available the Ratio of Two Lognormal Variates and Two Gamma Vari- from Customer Relations, 6th floor, NBC Building, 7500 Bellaire ates,” Communications in Statistics, A6,967-975. Boulevard, Houston, Texas, 77036-5085. ENGELHARDT, MAX., and BAIN, LEE J. (1977), “Uniformly JOHNSON, N. L., and KOTZ, S. (1970), Continuous Distributions- Most Powerful Unbiased Tests on the Scale Parameter of a I, Boston: Houghton-MifIlin, distributed by John Wiley. Gamma Distribution with a Nuisance Shape Parameter,” Tech- LAPLACE, P. S. (1836), “ThPorie Analytique des Probabilities,” nometrics, 19, 77-81. (Supplement to 3rd ed.).

TECHNOMETRICS 0, VOL. 25, NO. 4, NOVEMBER 1983