?=================================================================== ? Program to compute and plot Poisson and negative binomial = ? probabilities. User sets ALPHAI and LAMBDAI then executes. = ?=================================================================== PROCEDURE SAMPLE ; 1 - 36$ CREATE ; i = trn(0,1)$ CALC ; thetai = 1/alphai$ SAMPLE ; 1$ CREATE ; logpp = -lambdai ; logpn = thetai*log(thetai/(thetai+lambdai))$ SAMPLE ; 2 - 51$ CREATE ; logpp = log(lambdai)-log(i)+logpp[-1] ; logpn = log(lambdai/(thetai+lambdai)) +log(thetai+i-1)-log(i)+logpn[-1]$ SAMPLE ; 1 - 36$ CREATE ; pp = exp(logpp) ; pn = exp(logpn)$ PLOT ; lhs=i;rhs=pp,pn;fill$ ENDPROC ? ? Set desired values of lambda and alpha. ? CALC ; lambdai = 10 ; alphai = .2 EXECUTE