Skip to content
mlmentorship

Probability distributions used in ML

Choose a distribution from the data type and generation process. Connect its support, parameters, mean, variance, likelihood, and common ML use.

Published · 10 min read ·Core ·Foundation

Visual quick review

Choose among Bernoulli, binomial, Poisson, and exponential models by defining what one observation records.

Learning objective

Observation units select different distributions for trial and time processes

Observation units select different distributions for trial and time processes The first panel starts with five independent visits that share conversion probability p and have outcomes one, zero, one, zero, zero. Recording one visit gives a binary value with support zero or one and a Bernoulli p model. Recording the total from all five visits gives a count with support zero through five and a binomial five comma p model. The second panel starts with a constant-rate independent event process marked by three events on a timeline. Recording the number in a ten-minute window gives a nonnegative integer and a Poisson ten lambda model. Recording the time until the next event gives a nonnegative real value and an exponential lambda model. Numbered choices, explicit supports, process assumptions, distinct box outlines, and arrows communicate the selection without relying on color. A · Trial process: independent visits, same p five visit outcomes 1 0 1 0 0 1 · Record one visit X ∈ {0, 1} Bernoulli(p) one binary outcome 2 · Total five visits S ∈ {0, 1, …, 5} Binomial(5, p) success count B · Events: independent, constant rate λ 0 min 10 min three event times 3 · Count in window K ∈ {0, 1, 2, …} Poisson(10λ) events per 10 min 4 · Wait to next event T ∈ [0, ∞) Exponential(λ) continuous duration
Read it this way: decide what one row records. One visit is Bernoulli; independent visits with the same probability give a binomial total. For independent constant-rate events, fixed-window counts are Poisson and next-event waits are exponential.
Check: Why use Poisson for event counts but Exponential for waiting until the next event?
Full explanation 10 min read
Reading depth

Summary

A probability distribution assigns probabilities to values one observation can record. Choose the observation unit and generating process before the family name.

Five hypothetical independent visits share conversion probability . Their outcomes are . What changes when one record contains one visit rather than the total from five visits?

A practical selection rule

First specify the support: the possible recorded values. Then ask whether the record is a trial, trial total, count during an exposure or waiting time. Check dependence, changing rates, tail behavior and the frequency of zeros. Correct support alone does not establish the model’s assumptions.

Learning objective

Counting events and waiting for the next event require different random variables

Count events or measure waiting timeA Poisson count has nonnegative integer outcomes. Exponential waiting time is continuous. The same process supplies two different random variables.Count marks, or measure the spacesbetween themA count: three events in thisfive-second windowCount three events in the fixedwindowA waiting time: the gap to the nexteventGap 1.42 seconds, not 1.42 events
Read it this way: A Poisson count has nonnegative integer outcomes. Exponential waiting time is continuous. The same process supplies two different random variables. Does the waiting-time ruler produce integer-valued observations?
Reference drawing

Learning objective

Counting events and waiting for the next event require different random variables

Count events or measure waiting timeA Poisson count has nonnegative integer outcomes. Exponential waiting time is continuous. The same process supplies two different random variables.Count marks, or measure the spacesbetween themA count: three events in thisfive-second windowCount three events in the fixedwindowA waiting time: the gap to the nexteventGap 1.42 seconds, not 1.42 events
Derivation
Observation units select different distributions for trial and time processes The first panel starts with five independent visits that share conversion probability p and have outcomes one, zero, one, zero, zero. Recording one visit gives a binary value with support zero or one and a Bernoulli p model. Recording the total from all five visits gives a count with support zero through five and a binomial five comma p model. The second panel starts with a constant-rate independent event process marked by three events on a timeline. Recording the number in a ten-minute window gives a nonnegative integer and a Poisson ten lambda model. Recording the time until the next event gives a nonnegative real value and an exponential lambda model. Numbered choices, explicit supports, process assumptions, distinct box outlines, and arrows communicate the selection without relying on color. A · Trial process: independent visits, same p five visit outcomes 1 0 1 0 0 1 · Record one visit X ∈ {0, 1} Bernoulli(p) one binary outcome 2 · Total five visits S ∈ {0, 1, …, 5} Binomial(5, p) success count B · Events: independent, constant rate λ 0 min 10 min three event times 3 · Count in window K ∈ {0, 1, 2, …} Poisson(10λ) events per 10 min 4 · Wait to next event T ∈ [0, ∞) Exponential(λ) continuous duration
Read it this way: decide what one row records. One visit is Bernoulli; independent visits with the same probability give a binomial total. For independent constant-rate events, fixed-window counts are Poisson and next-event waits are exponential.
Check: Why use Poisson for event counts but Exponential for waiting until the next event?
Read it this way: A Poisson count has nonnegative integer outcomes. Exponential waiting time is continuous. The same process supplies two different random variables. Does the waiting-time ruler produce integer-valued observations?

Original process-and-observation construction checked against the open OpenStax binomial, Poisson, and exponential textbook sections and the NIST Poisson reference.

Bernoulli and binomial

A single-visit outcome has a Bernoulli distribution:

Its mean is and variance is . Binary cross-entropy is its negative log-likelihood.

A total over independent visits with the same probability has a binomial distribution:

Here , so the support is . Its mean is and variance is . The observed count of two need not equal the expected count of one.

Count the possible orders

The particular ordered sequence has probability . But ten different orders contain two successes:

The binomial coefficient counts those orders. Summing the six probabilities for through gives one. The likelihood must match what the observation records.

Change what a record measures

1. Double the exposure window

New task: count independent constant-rate events for twenty minutes instead of ten.

Picture and change: keep rate events per minute. For exposure minutes, . The count mean changes from to . The next-event wait remains .

Check: the twenty-minute count has mean and variance . Its zero-event probability is . The mean next-event wait remains minutes.

Use when: exposure changes without changing the process rate.

2. Allow different underlying count rates

New task: describe a hypothetical count population with mean and variance .

Picture and change: Poisson’s equal mean and variance cannot match both moments. Use a negative-binomial parameterization with variance , where dispersion parameter .

Check: , giving variance . Matching two moments does not establish the whole distribution’s fit.

Use when: overdispersion remains after accounting for exposure and relevant groups.

Dependence can invalidate the count model

Suppose all five visits repeat one shared Bernoulli outcome instead of being independent. Then is either zero or five, with mean one and variance . Now . The support bound and mean stayed compatible with binomial assumptions; independence did not.

Try a different record

One record contains class counts from five exclusive three-class trials. Is that record categorical, multinomial or multi-label?

Check your answer

It is multinomial: the counts sum to five. One trial would be categorical. Multi-label outcomes allow several labels within one trial and need a different model.

Categorical and multinomial

A categorical variable selects one of classes with nonnegative probabilities summing to one. Softmax cross-entropy is the negative categorical log-likelihood.

A multinomial variable counts how often each class appears across categorical trials. The counts sum to .

Use categorical models for one label and multinomial models for a vector of class counts. A multi-label problem is different because several labels can be true at once.

Gaussian and Laplace

A Gaussian variable has real-valued support, location and variance :

Gaussian residuals with fixed variance give squared-error loss, up to positive scaling and an additive constant. The mean-variance parameters need not describe bounded or strongly skewed residuals well.

A Laplace residual has location , scale and variance . Its tails decay more slowly than Gaussian tails. Fixed-scale Laplace negative log-likelihood gives absolute-error loss. If scale is learned, retain its likelihood terms, including the log-scale term.

This connection turns loss selection into a noise-model choice:

Residual modelTraining lossMain behavior
Gaussiansquared errorlarge errors receive strong weight
Laplaceabsolute errorless sensitive to large errors

Inspect residuals instead of assuming either model from habit.

Poisson and negative binomial

A Poisson count with dimensionless expected count has

Its mean and variance both equal . A log link keeps a predicted rate positive.

Real counts often have variance above the mean. This is overdispersion. A negative-binomial model adds dispersion and is often a better fit for clicks, incidents, or purchases with heterogeneous rates.

Always include exposure. Ten failures in one hour and ten failures in one month do not imply the same rate.

Exponential and Gamma

An exponential wait has nonnegative real support and rate in events per unit time. Its mean is and variance is . It is memoryless:

Use it when a constant hazard is defensible. It fails when risk changes with elapsed time.

A Gamma variable with shape and rate has mean and variance . Scale is the reciprocal of rate. Shape one gives an exponential distribution. Integer shape gives the wait until event in a constant-rate Poisson process. General shapes also model positive right-skewed values. Censoring needs its own likelihood contribution.

Beta and Dirichlet

A Beta distribution has support on and two positive shape parameters. It is a convenient prior for a Bernoulli probability:

After observing successes and failures, the posterior is

The Dirichlet distribution generalizes this idea to a vector of class probabilities. It is conjugate to the categorical and multinomial likelihoods.

Conjugacy keeps the posterior in the prior’s family. It simplifies updating; it does not validate the prior or observation model. Beta and Dirichlet distributions describe unknown probability parameters, not individual observed class labels.

Worked example

A product records 20 conversions among 500 independent visits sharing probability . With a prior, the posterior is

If visits come from repeated users with correlated behavior, the independent-trial assumption fails. The uncertainty must account for user groups.

In an interview

For any proposed distribution, state:

  1. Its support.
  2. What one observation represents.
  3. Its parameters and mean-variance relation.
  4. The likelihood or loss it implies.
  5. The assumption most likely to fail.
  6. A diagnostic or alternative model.

State the model’s generating assumptions after defining its observation unit.

Common mistakes

  • Using Bernoulli and binomial interchangeably.
  • Using Poisson without checking overdispersion or exposure.
  • Treating softmax as a multi-label model.
  • Using a Gaussian for strongly positive, right-skewed data without checking residuals.
  • Calling conjugacy evidence that a model is true.
  • Ignoring dependence among observations.

Practice next

Connect distribution choice to maximum likelihood estimation, the exponential family, and loss-function selection.