Statistics for Beginners in Excel – Negative Binomial and Geometric Distributions

(Basic Statistics for Citizen Data Scientist)

Negative Binomial and Geometric Distributions

Negative Binomial Distribution

Definition 1: Under the same assumptions as for the binomial distribution, let x be a discrete random variable. The probability density function (pdf) for the negative binomial distribution is the probability of getting x failures before k successes where p = the probability of success on any single trial. Thus the pdf is

f(x) = C(x+k−1, x)pk(1−p)x

Excel Functions: Excel provides the following function regarding the negative binomial distribution:

NEGBINOMDIST(xkp) = the probability of getting x failures before y successes where p = the probability of success on any single trial; i.e. the pdf of the negative binomial distribution.

Excel 2010/2013 provide the following additional function: NEGBINOM.DIST(xkp, cum) where cum takes the values TRUE or FALSE. In particular, NEGBINOM.DIST(xkp, FALSE) = NEGBINOMDIST(xkp), while NEGBINOM.DIST(xkp, TRUE) = the probability of getting at most x failures before k successes, where p = the probability of success on any single trial; i.e. the cumulative probability function.

Real Statistics Function: Excel doesn’t provide a worksheet function for the inverse of the negative binomial distribution. Instead you can use the following function provided by the Real Statistics Resource Pack.

NEGBINOM_INV(p, k, pp) = smallest integer x such that NEGBINOM.DIST(xkpp, TRUE) ≥ p.

Note that the maximum value of x is 1,024,000,000. A value higher than this indicates an error. This function is only available for users of Excel 2010 or later.

Key statistical properties of the negative binomial distribution are:

  • Mean = k(1 – p) ⁄ p
  • Variance = k(1 – p) ⁄ p2
  • Skewness = (2 – p) ⁄ !sqrt{k(1-p)}
  • Kurtosis = (p2 – 6+ 6) ⁄ [k(1 – p)]

 

Geometric Distribution

The geometric distribution is a special case of the negative binomial distribution, where k = 1. The pdf is

Geometric distribution pdf

The cumulative distribution function (cdf) of the geometric distribution is

Geometric distribution function

The pdf represents the probability of getting x failures before the first success, while the cdf represents the probability of getting at most x failures before the first success.

Observation: The geometric distribution is memoryless, which means that if you intend to repeat an experiment until the first success, then, given that the first success has not yet occurred, the conditional probability distribution of the number of additional trials required until the first success does not depend on how many failures have already occurred. The die one throws or the coin one tosses does not have a “memory” of any previous successes or failures. The geometric distribution is in fact the only memoryless discrete distribution that we will study.

Other key statistical properties of the geometric distribution are:

  • Mean = (1 – p) ⁄ p
  • Mode = 0
  • Range = [0, ∞)
  • Variance = (1 – p) ⁄ p2
  • Skewness = (2 – p) ⁄ !sqrt{1-p}
  • Kurtosis = 6 + p2 ⁄ (1 – p)

 

Statistics for Beginners in Excel – Binomial Distribution

Statistics for Beginners in Excel – Negative Binomial and Geometric Distributions

Personal Career & Learning Guide for Data Analyst, Data Engineer and Data Scientist

Applied Machine Learning & Data Science Projects and Coding Recipes for Beginners

A list of FREE programming examples together with eTutorials & eBooks @ SETScholars

95% Discount on “Projects & Recipes, tutorials, ebooks”

Projects and Coding Recipes, eTutorials and eBooks: The best All-in-One resources for Data Analyst, Data Scientist, Machine Learning Engineer and Software Developer

Topics included: Classification, Clustering, Regression, Forecasting, Algorithms, Data Structures, Data Analytics & Data Science, Deep Learning, Machine Learning, Programming Languages and Software Tools & Packages.
(Discount is valid for limited time only)

Disclaimer: The information and code presented within this recipe/tutorial is only for educational and coaching purposes for beginners and developers. Anyone can practice and apply the recipe/tutorial presented here, but the reader is taking full responsibility for his/her actions. The author (content curator) of this recipe (code / program) has made every effort to ensure the accuracy of the information was correct at time of publication. The author (content curator) does not assume and hereby disclaims any liability to any party for any loss, damage, or disruption caused by errors or omissions, whether such errors or omissions result from accident, negligence, or any other cause. The information presented here could also be found in public knowledge domains.

Learn by Coding: v-Tutorials on Applied Machine Learning and Data Science for Beginners

Please do not waste your valuable time by watching videos, rather use end-to-end (Python and R) recipes from Professional Data Scientists to practice coding, and land the most demandable jobs in the fields of Predictive analytics & AI (Machine Learning and Data Science).

The objective is to guide the developers & analysts to “Learn how to Code” for Applied AI using end-to-end coding solutions, and unlock the world of opportunities!