Geometric Distribution

DESCRIPTION:
Functions for the density, cumulative distribution, quantiles and random generation of the Geometric distribution. The distribution models the number of failures before the first success in a sequence of Bernoulli trials.

USAGE:
dgeom(x, prob)
pgeom(q, prob)
qgeom(p, prob)
rgeom(n, prob)

REQUIRED ARGUMENTS:
x:
vector of (positive) quantiles. Missing values (NAs) are allowed.
q:
vector of (positive) quantiles. Missing values (NAs) are allowed.
p:
vector of probabilities. Missing values (NAs) are allowed.
n:
sample size. If length(n) is larger than 1, then length(n) random values are returned; otherwise n random values are returned.
prob:
vector of probability parameters between 0 and 1.

VALUE:
density (dgeom), probability (pgeom), quantile (qgeom), or random sample (rgeom) for the Geometric distribution with parameter prob. The quantile is defined as the smallest value q such that Pr(Geometric random variate <= x) >= p.

SIDE EFFECTS:
rgeom causes the creation of the dataset .Random.seed if it does not already exist, otherwise its value is updated.

DETAILS:
Elements of q or p that are missing will cause the corresponding elements of the result to be missing.

SEE ALSO:
set.seed , NegBinomial , Binomial .

EXAMPLES:
rgeom(20, 0.6)  #sample of size 20 with parameter 0.6