a

S. and Hlavka, Z. XploRe Application Guide, (eds.), Springer-Verlag, Hei-

delberg,Germany

Nelson, C. R. andPlosser, C. I. (1982). Trends and Random Walks in Macroe-

conomic Time Series, Journal of Monetary Economics 10: 139“162.

Orden, D. and Fisher, L. A. (1993). Financial Deregulation and the Dynamics

of Money, Prices and Output in New Zealand and Australia, Journal of

Money, Credit and Banking 25: 273“292.

Perron, P. (1989). The Great Crash, the Oil Price Shock, and the Unit Root

Hypothesis, Econometrica 57: 1361“1401.

124 Bibliography

Price, S. and Insukindro (1994). The demand for Indonesian narrow money:

long-run equilibrium, error correction and forward-looking behaviour, The

Journal of International Trade and Economic Development 3(2): 147“163.

Ruspini, E. H. (1969). A New Approach to Clustering, Information Control

15: 22“32.

Sriram, S. S. (1999). Demand for M2 in an Emerging-Market Economy: An

Error- Correction Model for Malaysia, IMF Working paper WP/99/173.

Takagi, T. and Sugeno, M. (1985). Fuzzy identi¬cation of systems and its

application to modelling and control, IEEE Trans. Systems, Man and

Cybernatics 15(1): 116“132.

Tseng, W. (1994). Economic Reform in China: A New Phase, IMF Occasional

Paper 114.

Walsh, C. E. (1998). Monetary Theory and Policy, MIT Press, Cambridge.

Wolkenhauer, O. (2001). Data Engineering, Fuzzy Mathematics in system the-

ory and data analysis, Wiley-Interscience.

7 The exact LR test of the scale in

the gamma family

Milan Stehl´

±k

7.1 Introduction

An arbitrary speed asymptotics oversize or undersize the test what may not be

acceptable in some ¬ne studies, especially in medicine, ¬nance and physics. In

these areas small samples occurs frequently and testing based on asymptotics

can be misleading. The high e¬ciency is typical requirement of testing and

exact tests can be asymptotically optimal in the sense of Bahadur, Hodges-

Lehman and Pittman. The class of such statistics is apparently narrow, though

it contains under certain conditions the likelihood ratio (LR) statistics. Now

we are in better situation as statisticians have been in 40s when the one of the

main reasons of asymptotics was the fact that the computation of the quantiles

of exact tests had the unreal time complexity. Nowadays, the implementation

of the special functions to computational environments and symbolic languages

became the common phenomenon. The computational and time complexity of

procedures of the exact and asymptotical is comparable.

Our setup considers univariate random variables y1 , y2 , . . . , yN distributed ac-

cording to the gamma densities

±

v’1

yi

e’γi yi , for yi > 0,

v

γi

f (yi |γi ) = (7.1)

“(v)

for yi ¤ 0.

0,

Here γi > 0, i = 1, ..., N are unknown scale parameters, which are the param-

eters of interest and v > 0 is known shape parameter.

126 7 The exact LR test of the scale in the gamma family

Such model has been applied in many disciplines, including queueing systems,

reliability models, and quality control studies.

We consider the exact LR tests of the scale hypothesis

H0 : γ = γ0 versus H1 : γ = γ0 (7.2)

in the scale-homogeneous gamma family (i.e. γ1 = ... = γN := γ). Details

can be found in Stehl´ (2000), Stehl´ (2001) and Stehl´ (2002). The general

±k ±k ±k

LR test of the hypothesis (2) is implemented to the XploRe in the quant-

let etgammaexacttest. Because the two special cases of the gamma process,

Poisson and Erlang processes are frequently used, they are implemented in

self-contained quantlets etexpexacttest and eterlangexacttest. The ad-

vantages of the exact tests of the scale in the gamma family are exact levels

of signi¬cance (the asymptotical tests are oversized) and exact power. Fur-

thermore, the exact LR tests of the scale in the gamma family are unbiased,

uniformly most powerful (UUMP) tests. The theoretical justi¬cation of the

exact LR testing is its asymptotical optimality. For example, the exact LR

test of the scale of the exponential distribution is asymptotically optimal in

the sense of the Bahadur exact slopes.

The chapter is organized as follows. In subchapter Computation the exact tests

in the XploRe we provide the examples of exact testing of the scale parameter.

In subchapter Illustrative examples we discuss and analyze data set from time

processing and ¬eld reliability data with missing failure times. To maintain the

continuity of the explanation, some theoretical aspects of the exact LR testing

are included into the Appendices.

The short discussion on the implementation can be found in Appendix Imple-

mentation to the XploRe. The discussion on the asymptotical optimality in the

case of exponentially distributed observations is given in Appendix Asymptot-

ical optimality. Appendix Information and exact testing in the gamma family

brie¬‚y explains the informative aspects of the exact LR testing in the gamma

family based on the concept of the ”I-divergence distance” between the obser-

vation and the canonical parameter γ as presented in P´zman (1993).

a

Oversizing of the asymptotics provides the Table of oversizing of the asymptot-

ical test. Some useful properties of the Lambert W function, which is crucial

function for the implementation of the exact tests is given in Appendix The

Lambert W function.

7.2 Computation the exact tests in the XploRe 127

7.2 Computation the exact tests in the XploRe

The quantlets etgammaexacttest, etexpexacttest and eterlangexacttest

are implemented to the XploRe. The input of the general quantlet etgamma

exacttest consists of the parameters sample, level, nullpar and shapepar. The

parameter sample inputs the n — 1 data vector x, level inputs the size (level of

signi¬cance) of the exact test, nullpar is the input of the value γ0 of the null

hypothesis H0 : γ = γ0 and shapepar inputs the shape parameter of the gamma

distribution. The output consists of the parameters pvalue, testresult, chipvalue

and oversizing. The parameter pvalue outputs the exact p-value of the test,

the test result outputs the statement about the rejection or acceptation of the

null hypothesis. E.g. in the case of rejection this statement has form “H0 is

rejected on the level alpha“. The parameter chipvalue contains the p-value of

the χ2 -Wilks asymptotical test and the oversizing contains the oversizing of

the χ2 -asymptotics, i.e. the di¬erence of the pvalue and chipvalue.

The following session illustrate the application of the quantlet etgammaexacttest

for exact LR testing of the hypothesis H0 : γ = 0.4 versus H1 : γ = 0.4 at

the level of signi¬cance ± = 0.1 for the data set x = {0.5458, 2.4016, 1.0647,

2.8082, 0.45669, 0.79987, 0.59494} in the model (1) with the shape parameter

equal to 2.3. The libraries stats and nummath must be loaded before the

running of the exact tests.

The result is displayed in Table 7.1.

Table 7.1: Exact LR test H0 : γ = 0.4 vs. H1 : γ = 0.4 with ± = 0.1

p. value = 1.0002e-06

test result = H0 is rejected on the level alpha

chip value = 8.8401e-07

oversizing = 1.1623e-07

The null hypothesis is rejected on the level ± = 0.1, the exact p-value is 1.0002e-

06 and the asymptotical p-value is 8.8401e-07. The exact p-value is computed

from the formula p = 1 ’ FN (’2 ln »(y)) where

N