<< Chapter < Page Chapter >> Page >

Mean and variance of the compound demand

E [ D ] = E [ N ] E [ Y ] and Var [ D ] = E [ N ] Var [ Y ] + Var [ N ] E 2 [ Y ]

DERIVATION

E [ D ] = E n = 0 I { N = n } X n = n = 0 P ( N = n ) E [ X n ]
= E [ Y ] n = 0 n P ( N = n ) = E [ Y ] E [ N ]
E [ D 2 ] = n = 0 P ( N = n ) E [ X n 2 ] = n = 0 P ( N = n ) { Var [ X n ] + E 2 [ X n ] }
= n = 0 P ( N = n ) { n Var [ Y ] + n 2 E 2 [ Y ] } = E [ N ] Var [ Y ] + E [ N 2 ] E 2 [ Y ]

Hence

Var [ D ] = E [ N ] Var [ Y ] + E [ N 2 ] E 2 [ Y ] - E [ N ] 2 E 2 [ Y ] = E [ N ] Var [ Y ] + Var [ N ] E 2 [ Y ]
Got questions? Get instant answers now!

Mean and variance for [link]

E [ N ] = Var [ N ] = 8 . By symmetry E [ Y ] = 1 . Var [ Y ] = 0 . 25 ( 0 + 2 + 4 ) - 1 = 0 . 5 . Hence,

E [ D ] = 8 · 1 = 8 , Var [ D ] = 8 · 0 . 5 + 8 · 1 = 12
Got questions? Get instant answers now!

Calculations for the compound demand

We have m-procedures for performing the calculations necessary to determine the distribution for a composite demand D when the counting random variable N and the individual demands Y k are simple random variables with not too many values. In some cases, such as for a Poisson counting random variable, we are able to approximate by a simple random variable.

The procedure gend

If the Y i are nonnegative, integer valued, then so is D , and there is a generating function. We examine a strategy for computation which is implemented inthe m-procedure gend . Suppose

g N ( s ) = p 0 + p 1 s + p 2 s 2 + + p n s n
g Y ( s ) = π 0 + π 1 s + π 2 s 2 + + π m s m

The coefficients of g N and g Y are the probabilities of the values of N and Y , respectively. We enter these and calculate the coefficients for powers of g Y :

g N = [ p 0 p 1 p n ] 1 × ( n + 1 ) Coefficients of g N y = [ π 0 π 1 π m ] 1 × ( m + 1 ) Coefficients of g Y y 2 = conv ( y , y ) 1 × ( 2 m + 1 ) Coefficients of g Y 2 y 3 = conv ( y , y 2 ) 1 × ( 3 m + 1 ) Coefficients of g Y 3 y n = conv ( y , y ( n - 1 ) ) 1 × ( n m + 1 ) Coefficients of g Y n

We wish to generate a matrix P whose rows contain the joint probabilities. The probabilities in the i th row consist of the coefficients for the appropriate power of g Y multiplied by the probability N has that value. To achieve this, we need a matrix, each of whose n + 1 rows has n m + 1 elements, the length of y n . We begin by “preallocating” zeros to the rows. That is, we set P = zeros ( n + 1 , n * m + 1 ) . We then replace the appropriate elements of the successive rows. The replacement probabilitiesfor the i th row are obtained by the convolution of g Y and the power of g Y for the previous row. When the matrix P is completed, we remove zero rows and columns, corresponding to missing values of N and D (i.e., values with zero probability). To orient the joint probabilities as on the plane, we rotate P ninety degrees counterclockwise. With the joint distribution, we may then calculate any desired quantities.

A compound demand

The number of customers in a major appliance store is equally likely to be 1, 2, or 3. Each customer buys 0, 1, or 2 items with respective probabilities 0.5, 0.4, 0.1.Customers buy independently, regardless of the number of customers. First we determine the matrices representing g N and g Y . The coefficients are the probabilities that eachinteger value is observed. Note that the zero coefficients for any missing powers must be included.

gN = (1/3)*[0 1 1 1];    % Note zero coefficient for missing zero powergY = 0.1*[5 4 1];        % All powers 0 thru 2 have positive coefficientsgend  Do not forget zero coefficients for missing powersEnter the gen fn COEFFICIENTS for gN gN    % Coefficient matrix named gN Enter the gen fn COEFFICIENTS for gY gY    % Coefficient matrix named gYResults are in N, PN, Y, PY, D, PD, P May use jcalc or jcalcf on N, D, PTo view distribution for D, call for gD disp(gD)                  % Optional display of complete distribution         0    0.2917     1.0000    0.3667    2.0000    0.2250     3.0000    0.0880    4.0000    0.0243     5.0000    0.0040    6.0000    0.0003 EN = N*PN'EN =   2 EY = Y*PY'EY =  0.6000 ED = D*PD'ED =  1.2000                % Agrees with theoretical EN*EY P3 = (D>=3)*PD' P3  = 0.1167                [N,D,t,u,PN,PD,PL] = jcalcf(N,D,P);EDn = sum(u.*P)./sum(P); disp([N;EDn]')     1.0000    0.6000        % Agrees with theoretical E[D|N=n] = n*EY     2.0000    1.2000    3.0000    1.8000 VD = (D.^2)*PD' - ED^2VD =  1.1200                % Agrees with theoretical EN*VY + VN*EY^2
Got questions? Get instant answers now!

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Applied probability. OpenStax CNX. Aug 31, 2009 Download for free at http://cnx.org/content/col10708/1.6
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Applied probability' conversation and receive update notifications?

Ask