# Nbinom-class

0th

Percentile

##### Class "Nbinom"

The negative binomial distribution with size $= n$, by default $=1$, and prob $= p$, by default $=0.5$, has density $$d(x) = \frac{\Gamma(x+n)}{\Gamma(n) x!} p^n (1-p)^x$$ for $x = 0, 1, 2, \ldots$ This represents the number of failures which occur in a sequence of Bernoulli trials before a target number of successes is reached. C.f. rnbinom

Keywords
distribution
##### Note

Working with a computer, we use a finite interval as support which carries at least mass 1-getdistrOption("TruncQuantile").

##### Objects from the Class

Objects can be created by calls of the form Nbinom(prob, size). This object is a negative binomial distribution.

##### Extends

Class "DiscreteDistribution", directly. Class "UnivariateDistribution", by class "DiscreteDistribution". Class "Distribution", by class "DiscreteDistribution".

##### concept

• discrete distribution
• lattice distribution
• Negative Binomial distribution
• S4 parameter class
• generating function

NbinomParameter-class Geom-class DiscreteDistribution-class Naturals-class rnbinom

##### Aliases
• Nbinom-class
• Nbinom
• initialize,Nbinom-method
##### Examples
N <- Nbinom(prob = 0.5, size = 1) # N is a binomial distribution with prob=0.5 and size=1.
r(N)(1) # one random number generated from this distribution, e.g. 3
d(N)(1) # Density of this distribution is  0.25 for x=1.
p(N)(0.4) # Probability that x<0.4 is 0.5.
q(N)(.1) # x=0 is the smallest value x such that p(B)(x)>=0.1.
size(N) # size of this distribution is 1.
size(N) <- 2 # size of this distribution is now 2.
Documentation reproduced from package distr, version 2.2.3, License: LGPL-3

### Community examples

Looks like there are no examples yet.
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.46844199299812317, "perplexity": 4944.529599270293}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-05/segments/1579250606975.49/warc/CC-MAIN-20200122101729-20200122130729-00384.warc.gz"}