DiscreteDistribution-class is the mother-class of the classes
Poisson. Further discrete distributions can be defined either by
declaration of own random number generator, density and cumulative distribution and quantile functions, or as result of a
convolution of two discrete distributions or by application of a mathematical operator to a discrete distribution. An
additional way is, to specify only the random number generator. The function
RtoDPQ.d then approximates the three
q by random sampling.
Working with a computer, we use a finite interval as support which carries at least mass $1-TruncQuantile$.
Objects from the Class
Objects can be created by calls of the form
new("DiscreteDistribution", r, d, p, q).
The result of this call is a discrete distribution.
"Distribution", by class
B = Binom(prob=0.1,size=10) # B is a Binomial distribution with prob=0.1 and size=10. P = Pois(lambda=1) # P is a Poisson distribution with lambda=1. D1 = B+1 # a new discrete distributions with exact slots d, p, q D2 = D1*3 # a new discrete distributions with exact slots d, p, q D3 = B+P # a new discrete distributions with approximated slots d, p, q D4 = D1+P # a new discrete distributions with approximated slots d, p, q support(D4) # the (approximated) support of this distribution is 1, 2, ..., 21 r(D4)(1) # one random number generated from this distribution, e.g. 4 d(D4)(1) # The (approximated) density for x=1 is 0.1282716. p(D4)(1) # The (approximated) probability that x<=1 is 0.1282716. q(D4)(.5) # The (approximated) 50 percent quantile is 3.