Estimate quantiles of a negative binomial distribution.
vector of non-negative integers indicating the number of trials that took place
vector of positive integers indicating the number of “successes” that
must be observed before the trials are stopped. Missing (
numeric vector of probabilities for which quantiles will be estimated.
All values of
character string specifying the method of estimating the probability parameter.
Possible values are
an integer indicating the number of decimal places to round to when printing out
the value of
eqnbinom returns estimated quantiles as well as
estimates of the
Quantiles are estimated by 1) estimating the prob parameter by
enbinom, and then 2) calling the function
qnbinom and using the estimated value for
x is a numeric vector,
eqnbinom returns a
list of class
"estimate" containing the estimated quantile(s) and other
estimate.object for details.
x is the result of calling an estimation function,
returns a list whose class is the same as
x. The list
contains the same components as
x, as well as components called
The negative binomial distribution has its roots in a gambling game where participants would bet on the number of tosses of a coin necessary to achieve a fixed number of heads. The negative binomial distribution has been applied in a wide variety of fields, including accident statistics, birth-and-death processes, and modeling spatial distributions of biological organisms.
The geometric distribution with parameter
is a special case of the negative binomial distribution with parameters
Steven P. Millard (EnvStats@ProbStatInfo.com)
Forbes, C., M. Evans, N. Hastings, and B. Peacock. (2011). Statistical Distributions. Fourth Edition. John Wiley and Sons, Hoboken, NJ.
Johnson, N. L., S. Kotz, and A. Kemp. (1992). Univariate Discrete Distributions. Second Edition. John Wiley and Sons, New York, Chapter 5.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
# Generate an observation from a negative binomial distribution with # parameters size=2 and prob=0.2, then estimate the parameter prob # and the 90th percentile. # Note: the call to set.seed simply allows you to reproduce this example. # Also, the only parameter that is estimated is prob; the parameter # size is supplied in the call to enbinom. The parameter size is printed in # order to show all of the parameters associated with the distribution. set.seed(250) dat <- rnbinom(1, size = 2, prob = 0.2) dat # 5 eqnbinom(dat, size = 2, p = 0.9) #Results of Distribution Parameter Estimation #-------------------------------------------- # #Assumed Distribution: Negative Binomial # #Estimated Parameter(s): size = 2.0000000 # prob = 0.2857143 # #Estimation Method: mle/mme for 'prob' # #Estimated Quantile(s): 90'th %ile = 11 # #Quantile Estimation Method: Quantile(s) Based on # mle/mme for 'prob' Estimators # #Data: dat, 2 # #Sample Size: 1 #---------- # Clean up rm(dat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.