plotNegBinom {LearningStats} | R Documentation |
Probability Mass and/or Distribution Function Representations associated with a Negative Binomial Distribution
Description
plotNegBinom
represents the probability mass and/or the distribution function associated with a Negative Binomial
distribution with certain parameters n
and p
.
Usage
plotNegBinom(n, p, type = "b", col = "grey")
Arguments
n |
the number of successful Bernoulli trials. |
p |
the probability of success associated with the Bernoulli trial. |
type |
a character string giving the type of desired plot. The following values are possible: "b" (default) for probability mass function and distribution function representations together, "d" for distribution function representation and "p" for probability mass function representation. |
col |
a single colour associated with the probability mass function representation; default to "grey". |
Details
Note that if n=1
, the Negative Binomial distribution is also known as Geometric distribution.
Value
A matrix containing the probability mass and the distribution function associated with each point
of the support of a Negative Binomial distribution with parameters n
and p
.
Examples
n=3;p=0.3
plotNegBinom(n,p,type="d")
plotNegBinom(n,p,type="p",col="pink")
plotNegBinom(n,p)