Negative binomial distribution with parameters
expValNBinom(
size,
prob = (1/(1 + beta)),
beta = ((1 - prob)/prob),
nb_tries = FALSE
)varNBinom(
size,
prob = (1/(1 + beta)),
beta = ((1 - prob)/prob),
nb_tries = FALSE
)
mgfNBinom(
t,
size,
prob = (1/(1 + beta)),
beta = ((1 - prob)/prob),
nb_tries = FALSE
)
pgfNBinom(
t,
size,
prob = (1/(1 + beta)),
beta = ((1 - prob)/prob),
nb_tries = FALSE
)
Function :
expValNBinom
gives the expected value.
varNBinom
gives the variance.
mgfNBinom
gives the moment generating function (MGF).
pgfNBinom
gives the probability generating function (PGF).
Invalid parameter values will return an error detailing which parameter is problematic.
Number of successful trials.
Probability of success in each trial.
Alternative parameterization of the negative binomial distribution where beta = (1 - p) / p.
logical; if FALSE
(default) number of trials
until the r
th success, otherwise, number of failures until
the r
th success.
t.
When
When
The alternative parameterization of the negative binomial with parameter
# Where k is the number of trials for a rth success
expValNBinom(size = 2, prob = .4)
# Where k is the number of failures before a rth success
expValNBinom(size = 2, prob = .4, nb_tries = TRUE)
# With alternative parameterization where k is the number of trials
expValNBinom(size = 2, beta = 1.5)
# Where k is the number of trials for a rth success
varNBinom(size = 2, prob = .4)
# Where k is the number of failures before a rth success
varNBinom(size = 2, prob = .4, nb_tries = TRUE)
# With alternative parameterization where k is the number of trials
varNBinom(size = 2, beta = 1.5)
mgfNBinom(t = 1, size = 4, prob = 0.5)
pgfNBinom(t = 5, size = 3, prob = 0.3)
Run the code above in your browser using DataLab