<< Chapter < Page | Chapter >> Page > |
The m-procedures mgd and jmgd
The next example shows a fundamental limitation of the gend procedure. The values for the individual demands are not limited to integers, and there are considerablegaps between the values. In this case, we need to implement the moment generating function M D rather than the generating function g D .
In the generating function case, it is as easy to develop the joint distribution for as to develop the marginal distribution for D . For the moment generating function, the joint distribution requires considerably more computation.As a consequence, we find it convenient to have two m-procedures: mgd for the marginal distribution and jmgd for the joint distribution.
Instead of the convolution procedure used in gend to determine the distribution for the sums of the individual demands, the m-procedure mgd utilizes them-function mgsum to obtain these distributions. The distributions for the various sums are concatenated into two row vectors, to which csort is applied to obtain the distributionfor the compound demand. The procedure requires as input the generating function for N and the actual distribution, Y and , for the individual demands. For , it is necessary to treat the coefficients as in gend. However, the actual values and probabilitiesin the distribution for Y are put into a pair of row matrices. If Y is integer valued, there are no zeros in the probability matrix for missing values.
A service shop has three standard charges for a certain class of warranty services it performs: $10, $12.50, and $15. The number of jobs received in a normal workday can be considered a random variable N which takes on values 0, 1, 2, 3, 4 with equal probabilities 0.2. The job types for arrivals may be represented by an iidclass , independent of the arrival process. The Y i take on values 10, 12.5, 15 with respective probabilities 0.5, 0.3, 0.2. Let C be the total amount of services rendered in a day. Determine the distribution for C .
SOLUTION
gN = 0.2*[1 1 1 1 1]; % Enter dataY = [10 12.5 15];PY = 0.1*[5 3 2];mgd % Call for procedure
Enter gen fn COEFFICIENTS for gN gNEnter VALUES for Y Y
Enter PROBABILITIES for Y PYValues are in row matrix D; probabilities are in PD.
To view the distribution, call for mD.disp(mD) % Optional display of distribution
0 0.2000 10.0000 0.1000
12.5000 0.0600 15.0000 0.0400
20.0000 0.0500 22.5000 0.0600
25.0000 0.0580 27.5000 0.0240
30.0000 0.0330 32.5000 0.0450
35.0000 0.0570 37.5000 0.0414
40.0000 0.0353 42.5000 0.0372
45.0000 0.0486 47.5000 0.0468
50.0000 0.0352 52.5000 0.0187
55.0000 0.0075 57.5000 0.0019
60.0000 0.0003
We next recalculate [link] , above, using mgd rather than gend.
In [link] , we have
This means that the distribution for Y is and .
We use the same expression for as in [link] .
gN = 0.2*ones(1,5);
Y = 1:3;PY = 0.1*[5 3 2];mgd
Enter gen fn COEFFICIENTS for gN gNEnter VALUES for Y Y
Enter PROBABILITIES for Y PYValues are in row matrix D; probabilities are in PD.
To view the distribution, call for mD.disp(mD)
0 0.2000 1.0000 0.1000
2.0000 0.1100 3.0000 0.1250
4.0000 0.1155 5.0000 0.1110
6.0000 0.0964 7.0000 0.0696
8.0000 0.0424 9.0000 0.0203
10.0000 0.0075 11.0000 0.0019
12.0000 0.0003P3 = (D==3)*PD'
P3 = 0.1250ED = D*PD'
ED = 3.4000P_4_12 = ((D>=4)&(D<=12))*PD'
P_4_12 = 0.4650P7 = (D>=7)*PD'
P7 = 0.1421
As expected, the results are the same as those obtained with gend.
If it is desired to obtain the joint distribution for , we use a modification of mgd called jmgd . The complications come in placing the probabilities in the P matrix in the desired positions. This requires some calculations to determine the appropriate size of the matrices used as well as a procedure to put each probability in theposition corresponding to its D value. Actual operation is quite similar to the operation of mgd, and requires the same data format.
A principle use of the joint distribution is to demonstrate features of the model, such as , etc. This, of course, is utilized in obtaining the expressions for in terms of and . This result guides the development of the computational procedures, but these do notdepend upon this result. However, it is usually helpful to demonstrate the validity of the assumptions in typical examples.
Remark . In general, if the use of gend is appropriate, it is faster and more efficient than mgd (or jmgd). And it will handle somewhat larger problems. But both m-procedures workquite well for problems of moderate size, and are convenient tools for solving various “compound demand” type problems.
Notification Switch
Would you like to follow the 'Applied probability' conversation and receive update notifications?