maxγ∈“0 i=1

»(y) = (7.3)

N

f (yi |γi )

maxγ∈“1 i=1

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

is the likelihood ratio of the test of the hypothesis (2), “0 = {γ0 } and “1 =

R+ \ “0 . Function FN is the exact cdf of the Wilks statistics ’2 ln » of the

LR test of the hypothesis (2) under the H0 . The following theorem giving the

formula for FN is the corollary of Theorem 4 in Stehl´ (2001).

±k

Theorem 1 The exact cdf of the Wilks statistics ’2 ln » of the LR test of the

hypothesis (2) of the gamma distribution (1) has under the H0 the form

ρ ρ

FvN (’vN W’1 (’e’1’ 2vN )) ’ FvN (’vN W0 (’e’1’ 2vN )), ρ > 0,

FN (ρ) =

ρ ¤ 0.

0,

Here Wk , k = ... ’ 1, 0, 1, ... is the k-th branch of the Lambert W function

(see Appendix The Lambert W function) and FN is the cdf of the gamma

distribution with the shape parameter N = 1, 2, ... and scale parameter 1. The

Wilks statistics ’2 ln »(y) has under the H0 asymptotically χ2 -distribution

1

(Wilks, 1967). The chipvalue is the p-value obtained from the asymptotics,

e.g. p = 1 ’ Fχ2 (’2 ln »(y)) where »(y) is de¬ned by (3) and Fχ2 is the cdf of

1 1

the χ2 -distribution.

1

7.3 Illustrative examples

7.3.1 Time processing estimation

In this section we give some idea how to analyze the time processing data

given in study Gautam (1999). Much more detailed discussion is given in

Stehl´ (2002). Gautam (1999) studied a typical small scale company which

±k

manufactures a single item on demand and according to the speci¬cations of

the user. Assume that the users can demand only a single unit of the product.

As soon as a demand for a customized item comes in, the company registers the

requirements into a database. The processing begins by scanning the database

according to a ¬rst come ¬rst served manner and selecting an item to be pro-

cessed. Once the processing is complete, the next item™s processing begins.

Table 7.2 lists the sample processing times in hours.

The following two tasks are of prime concern for the company:

7.3 Illustrative examples 129

Table 7.2: The sample processing times in hours

1.9174 1.0866 0.9324 1.7576 0.5757 1.3961 1.3726 1.1121 1.3469 1.7477

1.2796 1.5442 1.3416 1.8200 1.0853 1.4793 0.9549 0.8739 1.1211 1.9341

1.6733 1.5880 1.1860 1.3422 1.6634 1.6364 2.7820 1.3701 1.6089 1.5860

1.1534 1.3417 1.6009 1.6476 1.3069 1.4546 1.7063 1.4398 1.1611 1.1278

2.0458 1.3681 0.9886 1.9371 1.6347 1.3754 2.0093 1.2315 1.4088 1.0767

1.0636 1.8241 1.3653 1.3242 1.5804 1.3875 1.2286 1.2866 1.7617 1.4828

1.6378 0.8287 1.1559 1.1054 1.4677 1.1568 1.6271 1.3273 1.5050 1.4858

1.1695 2.3610 1.3828 2.0455 1.1538 1.0897 1.7877 1.2850 1.3557 2.1030

1.0352 1.6838 1.6230 0.8023 1.6138 1.7363 0.8154 1.1386 2.1088 1.0676

1.5356 1.7195 1.9940 1.7607 1.2447 1.4794 1.1470 1.4041 1.1489 1.7280

• Given the number of orders waiting to be processed, by what time should

the company promise to deliver the product so that company meets the

deadline with the probability p?

• Consider that a job was being processed for the past u hours when the

system breaks down. When the breakdown is ¬xed, the company would

like to estimate how much longer the processing will take.

One of the probability distributions representing time random variable with

relatively small variation is the Erlang distribution. The family of density

functions

γ(γy)k’1 ’γy

f (y|γ) = e , y > 0, k = 2, 3, ...

(k ’ 1)!

is referred to as the family of Erlang (k, γ) distributions. The length of time

interval required in order to collect k arrivals from a Poisson process is dis-

tributed according to the Erlang distribution with the shape parameter k. The

family of Erlang distributions with the known shape parameter v = k > 1

and an unknown scale parameter γ belongs to the model (1). The quantlets

cdferlang and pdferlang implemented to the XploRe computes the values of

the cdf and pdf of the Erlang distribution with called parameters.

To ¬t the processing time data as Erlang(k, γ) (Gautam, 1999) estimates the

parameters from the data and test if the estimated distribution ¬ts the data

2 2

ˆ

well. He uses the maximum likelihood estimators (MLEs) k = m2 or m2 +1

s s

m

and γ = s2 and where m and s2 denotes the sample mean and sample variance

ˆ

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

and x denotes the greatest integer less then or equal to x. The estima-

ˆ

tion from the data in Table 1 gives MLEs γ = 11.1992 and k = 16 or 17.

ˆ

Gautam (1999) use the Kolmogorov-Smirnov (KS) test to test the goodness-

of-¬t of the estimated distribution. The KS test states that the null hypoth-

esis cannot be rejected at the level 0.05 in the both Erlang(16, 11.1992) and

Erlang(17, 11.1992) cases. Consider that there are m orders to be processed

when a customer request comes in. Denote X1 , ..., Xm+1 the processing times

all according to an Erlang(k, γ). Denote Z the time for the m + 1 jobs to be

completed. We have Z = X1 + X2 + ... + Xm+1 and Z has Erlang(k(m + 1), γ)

distribution.

Promising a due date

Our problem is, what time should the company promise to deliver the product

so that it meets the deadline with the given probability p (let us say 0.99)? We

have to determine time T such that P {Z ¤ T } = 0.99. We can solve T from

the equation

k(m+1)’1 i

(γT )

’γT

1’e = 0.99. (7.4)

i!

i=0

In the case of Erlang(16, 11.1992) distributed processing times (the situation

corresponding to the dataset in the Table 1), m = 4 and p = 0.99 we obtain

T = 9.1315 hours.

Assume that the processing time in the company has Erlang distribution with

known shape parameter k = 16 and unknown scale parameter γ. The customer

wants to know the time to deliver and in the case of delay larger than one

hour the company will be penalized. To determine the uncertainty of the

penalization we want to test H0 : T = 9.1315 versus H1 : T = 9.1315 at the

level of signi¬cance ± = 0.05 having large power of this test at the point of

penalization 10.0938 of the alternative.

For γ and T the equality (4) holds, we have the correspondence γ = γ(T ) and

11.1992 = γ(9.1315) and 10.0938 = γ(10.1315) holds. Therefore the corre-

sponding scale testing problem is