plotNegBinom: Probability Mass and/or Distribution Function Representations...

Description Usage Arguments Details Value Examples

View source: R/negativebinomial.R

Description

plotNegBinom represents the probability mass and/or the distribution function associated with a Negative Binomial distribution with certain parameters n and p.

Usage

1
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

1
2
3
4
n=3;p=0.3
plotNegBinom(n,p,type="d")
plotNegBinom(n,p,type="p",col="pink")
plotNegBinom(n,p)

LearningStats documentation built on April 21, 2021, 9:06 a.m.