<< Chapter < Page Chapter >> Page >

Compound demand

The following pattern provides a useful model in many situations. Consider

D = k = 0 N Y k

where Y 0 = 0 , and the class { Y k : 1 k } is iid, independent of the counting random variable N . One natural interpretation is to consider N to be the number of customers in a store and Y k the amount purchased by the k th customer. Then D is the total demand of the actual customers. Hence, we call D the compound demand .

gend.m Uses coefficients of the generating functions for N and Y to calculate, in the integer case, the marginal distribution for the compound demand D and the joint distribution for { N , D } .

% GEND file gend.m Marginal and joint dbn for integer compound demand % Version of 5/21/97% Calculates marginal distribution for compound demand D % and joint distribution for {N,D} in the integer case% Do not forget zero coefficients for missing powers % in the generating functions for N, Ydisp('Do not forget zero coefficients for missing powers') gn = input('Enter gen fn COEFFICIENTS for gN ');gy = input('Enter gen fn COEFFICIENTS for gY '); n = length(gn) - 1; % Highest power in gNm = length(gy) - 1; % Highest power in gY P = zeros(n + 1,n*m + 1); % Base for generating Py = 1; % Initialization P(1,1) = gn(1); % First row of P (P(N=0) in the first position)for i = 1:n % Row by row determination of P y = conv(y,gy); % Successive powers of gyP(i+1,1:i*m+1) = y*gn(i+1); % Successive rows of P endPD = sum(P); % Probability for each possible value of D a = find(gn); % Location of nonzero N probabilitiesb = find(PD); % Location of nonzero D probabilities P = P(a,b); % Removal of zero rows and columnsP = rot90(P); % Orientation as on the plane N = 0:n;N = N(a); % N values with positive probabilites PN = gn(a); % Positive N probabilitiesY = 0:m; % All possible values of Y Y = Y(find(gy)); % Y values with positive probabilitiesPY = gy(find(gy)); % Positive Y proabilities D = 0:n*m; % All possible values of DPD = PD(b); % Positive D probabilities D = D(b); % D values with positive probabilitiesgD = [D; PD]'; % Display combinationdisp('Results are in N, PN, Y, PY, D, PD, P') disp('May use jcalc or jcalcf on N, D, P')disp('To view distribution for D, call for gD')
Got questions? Get instant answers now!

gendf.m function [d,pd] = gendf(gn,gy) is a function version of gend , which allows arbitrary naming of the variables. Calculates the distribution for D , but not the joint distribution for { N , D } .

function [d,pd] = gendf(gn,gy)% GENDF [d,pd] = gendf(gN,gY) Function version of gend.m% Calculates marginal for D in the integer case % Version of 5/21/97% Do not forget zero coefficients for missing powers % in the generating functions for N, Yn = length(gn) - 1; % Highest power in gN m = length(gy) - 1; % Highest power in gYP = zeros(n + 1,n*m + 1); % Base for generating P y = 1; % InitializationP(1,1) = gn(1); % First row of P (P(N=0) in the first position) for i = 1:n % Row by row determination of Py = conv(y,gy); % Successive powers of gy P(i+1,1:i*m+1) = y*gn(i+1); % Successive rows of Pend PD = sum(P); % Probability for each possible value of DD = 0:n*m; % All possible values of D b = find(PD); % Location of nonzero D probabilitiesd = D(b); % D values with positive probabilities pd = PD(b); % Positive D probabilities
Got questions? Get instant answers now!

Questions & Answers

what is mutation
Janga Reply
what is a cell
Sifune Reply
how is urine form
Sifune
what is antagonism?
mahase Reply
classification of plants, gymnosperm features.
Linsy Reply
what is the features of gymnosperm
Linsy
how many types of solid did we have
Samuel Reply
what is an ionic bond
Samuel
What is Atoms
Daprince Reply
what is fallopian tube
Merolyn
what is bladder
Merolyn
what's bulbourethral gland
Eduek Reply
urine is formed in the nephron of the renal medulla in the kidney. It starts from filtration, then selective reabsorption and finally secretion
onuoha Reply
State the evolution relation and relevance between endoplasmic reticulum and cytoskeleton as it relates to cell.
Jeremiah
what is heart
Konadu Reply
how is urine formed in human
Konadu
how is urine formed in human
Rahma
what is the diference between a cavity and a canal
Pelagie Reply
what is the causative agent of malaria
Diamond
malaria is caused by an insect called mosquito.
Naomi
Malaria is cause by female anopheles mosquito
Isaac
Malaria is caused by plasmodium Female anopheles mosquitoe is d carrier
Olalekan
a canal is more needed in a root but a cavity is a bad effect
Commander
what are pathogens
Don Reply
In biology, a pathogen (Greek: πάθος pathos "suffering", "passion" and -γενής -genēs "producer of") in the oldest and broadest sense, is anything that can produce disease. A pathogen may also be referred to as an infectious agent, or simply a germ. The term pathogen came into use in the 1880s.[1][2
Zainab
A virus
Commander
Definition of respiration
Muhsin Reply
respiration is the process in which we breath in oxygen and breath out carbon dioxide
Achor
how are lungs work
Commander
where does digestion begins
Achiri Reply
in the mouth
EZEKIEL
what are the functions of follicle stimulating harmones?
Rashima Reply
stimulates the follicle to release the mature ovum into the oviduct
Davonte
what are the functions of Endocrine and pituitary gland
Chinaza
endocrine secrete hormone and regulate body process
Achor
while pituitary gland is an example of endocrine system and it's found in the Brain
Achor
what's biology?
Egbodo Reply
Biology is the study of living organisms, divided into many specialized field that cover their morphology, physiology,anatomy, behaviour,origin and distribution.
Lisah
biology is the study of life.
Alfreda
Biology is the study of how living organisms live and survive in a specific environment
Sifune
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

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