Joint probability mass function Created 2026-10-14 Updated 2026-10-20
For discrete random variables , their joint probability mass function assigns a probability to each possible ordered pair. Its entries are nonnegative and sum to one. Marginalization gives the probability mass functions and . In a table with rows indexed by and columns by , these are the row and column totals. The joint probability distribution records how the coordinates occur together, while the marginal distributions describe each separately.
Kullback-Leibler divergence Created 2026-09-24 Updated 2026-10-14
The Kullback-Leibler divergence, also called relative entropy, compares two probability distributions in a specified order. In , observations follow and the comparison probability distribution is : the first argument supplies the averaging weights. For probability mass functions on a finite alphabet,
Here is a random variable with probability distribution . For probability density functions relative to the same measure , replace the sum by . These formulas use natural logarithms unless stated otherwise. The expected value is under , even though appears in the denominator. [ref]
Take and on two outcomes. Direct calculation gives
The second outcome contributes negatively to the first sum: assigning it more probability than does makes its individual contribution negative. Nevertheless, relative entropy nonnegativity guarantees a nonnegative total. Reversing the arguments changes both the likelihood ratio and the averaging probabilities; taking an absolute value inside the logarithm would define a different quantity.
Figure 1.
Direction changes the averaging weights; a missing outcome can make relative entropy infinite
. Details.
The units depend on the logarithm: natural logarithms give nats, whereas base-two logarithms give bits. Divide a value in nats by to obtain bits; the forward example is approximately bits. Changing the base rescales every Kullback-Leibler divergence by the same positive factor. Since the two calculated directions differ, Kullback-Leibler divergence is asymmetric and cannot be a metric. It also need not satisfy the triangle inequality. [ref]
The operational meaning is an expected penalty for using the wrong probability distribution. A prediction incurs log-loss when outcome occurs, the negative of the logarithmic scoring rule. Under , its expected value is the cross-entropy . Predicting with itself incurs information entropy , so
Thus Kullback-Leibler divergence is exactly excess expected log-loss, whenever these separate quantities are finite. [ref]
For lossless source coding, ideal codeword lengths similarly give excess expected length in bits per symbol. Actual prefix codes require integer codeword lengths; Shannon's source coding theorem explains how long blocks approach ideal per-symbol lengths. The interpretation concerns an average, not a fractional physical bit attached to every outcome. In our example, ideal coding with costs one bit per symbol, while bits; the difference is exactly the computed bits. [ref]
Zeros require explicit conventions. An outcome with contributes zero, including when ; the convention agrees with the relevant limit. If but , the Kullback-Leibler divergence is infinite: the predictor has declared impossible an outcome that can occur. On a finite alphabet, the probability support of must therefore be contained in the probability support of for a finite answer. For example, and give , but . For general probability measures, failure of absolute continuity of measures likewise gives infinity. Even does not guarantee a finite integral. [ref]
To see how confidently wrong predictions are punished, hold the true Bernoulli distribution parameter at and vary the predicted parameter . Its binary relative entropy is
It vanishes at , equals approximately nats at , and equals nats at . Both endpoints give infinity because both outcomes remain possible under . Predicting almost no successes is especially costly because successes actually occur three quarters of the time. The reversed binary relative entropy stays finite at the endpoints: its averaging probability distribution concentrates on just one outcome, and assigns positive probability to both.
Figure 2.
Bernoulli relative entropy with true success probability 0.75 and varying predicted probability
. Details.
For model selection, minimizing expected log-loss ranks candidate statistical models by , since is common to them. The true probability distribution is usually unknown, so one estimates predictive performance using fresh observations or cross-validation. Fitting and assessing on the same data can reward overfitting; a small fitted Kullback-Leibler divergence alone does not establish useful prediction.
In variational inference, a tractable trial probability distribution commonly minimizes against a target posterior distribution . Maximizing the evidence lower bound accomplishes this without evaluating the target's normalization constant. The averaging now follows : placing trial probability where the posterior distribution assigns almost none is strongly penalized. The chosen direction and trial family therefore matter. [ref]
These comparisons do not by themselves establish causal inference. Two statistical models can reproduce the same observed probability distribution while predicting different responses to an intervention. Choosing the smaller Kullback-Leibler divergence therefore needs additional assumptions or experimental evidence before supporting a causal claim. [ref]
The original reference is S. Kullback and R. A. Leibler's 1951 paper [ref], published in The Annals of Mathematical Statistics 22(1), pages 79–86. Its title connects this comparison with sufficient statistics: the historical setting was statistical information, before today's widespread applications in prediction and variational inference.
Law of the unconscious statistician Created 2026-10-14 Updated 2026-10-25
The law of the unconscious statistician computes the expected value of a measurable function of a random variable directly from the original probability distribution. If is an integrable random variable, then
Use for a probability mass function, or for a probability density function. There is no need to derive the probability distribution of first. The identity is the integration rule for a pushforward measure, and also holds with an infinite value when is nonnegative. [ref].
For taking with probabilities , choosing gives . Its variance is therefore . Squaring the expected value would instead give , because squaring does not commute with averaging.
Likelihood function Created 2026-09-24 Updated 2026-10-14
For a fixed observed sample , a likelihood function is
where is the probability mass function or probability density function of the observations under the statistical parameter . All densities must be defined relative to the same parameter-independent dominating measure. The sample is fixed; the parameter is the function's argument. With independent and identically distributed random variables, the joint mass or density factors as . This definition and the distinction between sampling probability and parameter uncertainty are explained in MIT 18.05, Reading 10b, sections 3 and 3.2.
For an observed ordered sequence of ten independent Bernoulli trials containing eight successes and two failures, each success contributes and each failure contributes , giving
If the observation is instead only the total count , its binomial distribution probability mass function sums over the possible ordered sequences:
The raw heights differ: at they are approximately and . Their maximum-likelihood estimates are identical. More generally, multiplication by any finite positive constant independent of leaves the maximizing parameter values and all likelihood ratios unchanged. Multiplication by a parameter-dependent factor can change the MLE; dropping such a factor is not justified. Relative likelihood height sets the peak to one, without making the area under the curve one.
Normalization of is over possible data values for each fixed parameter. It imposes no requirement that . For example, the ordered Bernoulli trials likelihood above has
Its integral is not one, and its values are not posterior probabilities for . When the Bayesian posterior is defined, Bayes' theorem multiplies the likelihood by a prior density and normalizes that product. Choosing to normalize a likelihood function alone is an additional choice, such as using a uniform prior in those parameter coordinates, rather than part of the definition of likelihood.
For observations with a probability density function, the probability of an exact sample point is zero. If a scalar density is continuous at the observed value , then
Thus the density compares probabilities of small, equal observation intervals at different parameter values; it is not itself the probability of that exact real number. The equal-width factor is independent of the parameter. This gives visual intuition for density likelihoods, as in MIT 18.05, Reading 10b, section 4. The normal distribution example in maximum-likelihood estimator makes the comparison explicit. If only rounded intervals are recorded, their integrated probabilities give the exact observation likelihood; using midpoint densities is an approximation.
Here is an explicit example even within simple point processes. Let be a positive integer with probability mass function . The telescoping series sums to one, is finite almost surely, but . Conditional on , sample independent points with the uniform distribution on . The resulting point process has finitely many distinct points almost surely, while . Thus finite counts in each realization and finite mean counts are separate requirements; local finiteness of the intensity measure is an integrability assumption.
A probability mass function obtained by summing a joint probability mass function over the unretained coordinates. Nonnegative summands ensure that iterated sums are well defined.
Maximum likelihood estimation Created 2026-09-24 Updated 2026-10-14
Maximum likelihood estimation is a method of statistical estimation: within a specified statistical model, choose the statistical parameter values that maximize the likelihood function of the observed data. For a parameter set and observations , its exact requirement is
The equality requires an attained, finite maximum; a supremum approached only at an excluded boundary is not enough. The resulting rule is a maximum-likelihood estimator. The likelihood function uses a probability mass function for discrete data and a probability density function for continuous data. See MIT 18.05, Reading 10b, sections 3 and 3.2.
The direction of the comparison is the interesting part: hold the observations fixed and vary the statistical parameter. Ten independent Bernoulli trials with eight successes and two failures give the maximum-likelihood estimate , as derived in log-likelihood. This chooses the member of the statistical model that assigns the greatest mass to that outcome. It does not assert an posterior probability that this parameter value is true. Bayesian statistics combines the same likelihood function with a prior distribution to obtain a posterior distribution; maximum a posteriori estimation maximizes that posterior mass or density instead.
The method turns many fitting tasks into one maximization problem. In the normal distribution model with known variance, it recovers the sample mean and ordinary least squares, while binomial regression and Poisson regression use different sampling assumptions to build their own likelihood functions. The log-likelihood turns independent contributions into a sum, exposing score equations and observed information. A peak's location gives an estimate; its shape records how much the observed data distinguish nearby parameter values.
Existence, uniqueness, bias, and statistical consistency are separate questions. Normal mean and variance maximum-likelihood estimators include a variance estimate with bias, likelihood supremum at an excluded boundary gives nonexistence, and the Neyman-Scott incidental parameter problem gives inconsistency. The usual asymptotic normality of a maximum likelihood estimator requires assumptions: a consistent estimator at an interior true parameter in a fixed finite-dimensional model with identifiability, sufficient smoothness and control of log-likelihood derivatives, and finite nonsingular Fisher information. A common parameter-independent support of a probability distribution is part of a standard sufficient framework; see Rigollet, MIT 18.650, Maximum Likelihood Estimation, slides 22-23. This is a description of the regular setting, not a complete theorem's hypotheses. The exact endpoint limit for a shifted exponential distribution shows why changing support can produce a different rate and a nonnormal limit. These properties do not follow just from maximizing a function.
In his 1922 paper in the Royal Society's Philosophical Transactions A, R. A. Fisher explicitly distinguished likelihood from probability and described choosing the parameter values with greatest likelihood. Section 6 also discusses comparing likelihoods after giving the maximum value one, the convention used in the figures here. See Fisher, On the Mathematical Foundations of Theoretical Statistics, section 6, pp. 326-328, DOI 10.1098/rsta.1922.0009.
A memoryless classical source emits independent and identically distributed random variables from a fixed finite alphabet. Its block probability mass function factors as shown, and its information per symbol is the Shannon entropy . Zero-probability symbols never occur and contribute zero to the entropy. The typical sequence theorem describes the size and probability of the high-probability block set used for reliable compression.
Memorylessness of the geometric distribution Created 2026-10-14 Updated 2026-10-20
For the positive-integer geometric distribution with success probability , the displayed identity holds for nonnegative integers whenever the conditioning event has positive probability. The first attempts have failed; future independent attempts use the same success probability. Equivalently, divide the tail by . For a zero-based failures count , use . Constant success probability and independence are essential: accumulated wear or learning would require a different model.
The full remaining-count law is unchanged, not only one tail probability. With , after failures set on the event . For , its probability mass function under this conditional probability is
Here independence makes the future trials unaffected by the observed failures, and the unchanged success probability makes their law identical to the original one. Consequently , while . For the constructed mechanism, five failures leave a mean of more attempts, making the conditional mean total ; the five already spent are still counted.
Figure 1.
Conditioning on five failures, renormalizing, and resetting the count gives the original geometric law
. Details.
The same mechanism has constant discrete hazard:
Thus each reached attempt has the same chance of success. This differs from the decreasing unconditional probability : later success requires surviving earlier attempts. At , only conditioning on an event of positive probability is allowed: permits only , and only .
Among proper laws on the positive integers, memorylessness of the geometric distribution also characterizes the geometric distribution. Write . The identity gives ; if , both sides vanish anyway. Since , induction yields . Properness excludes , so setting recovers the geometric distribution, including .[ref]
The retry example stipulates independent Bernoulli trials with a known constant ; it is not evidence that a real retry system behaves this way. Shared changing conditions or adapting attempts can alter the next success probability. Even constant individual success probabilities alone do not imply independence.
For an original contrasting model, uniformly shuffle one success card and three failure cards, then draw by sampling without replacement. Its success position has the discrete uniform distribution on . Initially the success probability is ; after one failure it is . In particular,
This shows concretely why sampling without replacement need not be independent and why the remaining wait can change. Every draw still has unconditional success probability when all four positions are considered; the relevant discrete hazard changes after failures.
Method of types Created 2026-09-24 Updated 2026-10-14
The method of types combines two facts: there are few possible empirical distributions, and strings within each type class are equiprobable under an independent and identically distributed source. Information entropy determines how many strings share a frequency profile; relative entropy determines how unlikely that profile is under a specified source law. The connection is useful both for lossless source coding and for understanding rare observations.
The following formulas use natural logarithms, so information entropy and relative entropy are measured in nats. Define
Here is the source probability mass function and is an attainable empirical distribution. Use ; first assume every . Base-two logarithms give the equivalent formulas with and .
Min-entropy Created 2026-09-28 Updated 2026-10-14
For a discrete random variable with a finite or countable alphabet and probability mass function , define . Its min-entropy, using base-two logarithms, is
The unit is the bit. This is the smallest information content of any possible outcome: it records the easiest outcome to predict, whereas Shannon entropy averages information content over all outcomes. A normalized countable probability mass function has an attained positive maximum, so is finite even when Shannon entropy is infinite. Outcomes of zero probability cannot minimize the surprise and are omitted from the minimum; including extra impossible symbols changes neither quantity.[ref]
Suppose someone knows the probability mass function but receives no observation correlated with , and must name exactly one outcome. Naming succeeds with probability , so naming a most likely outcome is optimal:
Tied maxima give equally good guesses. Randomizing independently among guesses cannot improve success: if the guess has probability mass function , its success probability is . This is the simplest instance of maximum a posteriori decoding. The identity gives min-entropy an operational meaning: bits means every single guess succeeds with probability at most , under these information assumptions.[ref]
For an exact analytical example on symbols , compare the two probability mass functions
Under , each possible outcome has information content bits; under , has information content bit and each other outcome has bits. Consequently their Shannon entropies agree exactly,
but and bits. A best single guess therefore succeeds with probability under and under . The same average surprise can hide a factor of two in immediate predictability. The zero entry in contributes zero to Shannon entropy, using .
Figure 1.
Two exact probability models have the same average surprise but different best single guesses
. Details.
For the discrete uniform distribution on possible outcomes, bits and the best single guess succeeds with probability . A certain outcome has and success probability one. Thus min-entropy is useful when a common outcome could defeat an attempt to make outputs unpredictable, even if rare alternatives raise Shannon entropy.
For cryptography, this unconditional calculation alone does not certify security: an observer might know already. If a report reveals a uniform four-outcome source, its unconditional min-entropy remains bits but guessing after the report succeeds with probability one. For finite classical reports, the appropriate success calculation uses conditional probabilities and maximum a posteriori decoding:
The conditional entropy instead averages remaining surprise. A security argument must specify the observer's information and the protocol's required guarantee; neither unconditional min-entropy nor Shannon entropy supplies those assumptions.
For independent and identically distributed random variables with probability mass function on a finite alphabet, evaluate their realized strings under a fixed product model . If is positive on the probability support of , the strong law of large numbers gives
almost surely, using cross-entropy equals entropy plus relative entropy. If vanishes at an outcome of positive probability, that outcome eventually appears almost surely, making all subsequent product likelihoods zero and the limit . This matches infinite cross-entropy.
Suppose a binary prefix code has integer codeword lengths . Under a source with probability mass function , its average codeword length is exactly cross-entropy, . The Kraft inequality is satisfied because . This exact interpretation requires suitable dyadic rational probabilities; a general is not an integer codeword length. For positive , a prefix code with lengths exists by the Kraft inequality and has average length between and . The ceiling function causes the one-symbol rounding overhead. The cross-entropy term describes mismatch overhead; those are distinct costs.
A mixture of Poisson distributions over a nonnegative random intensity. With exposure and prior density , its probability mass function is . A gamma mixing distribution gives a negative binomial distribution. Counts sharing the same latent intensity are conditionally independent, but generally dependent after mixing.
Mixed probability distribution Created 2026-10-14 Updated 2026-10-18
A mixed probability distribution combines a discrete probability distribution with a continuous probability distribution. For example, put probability at zero and probability into a uniform distribution on . Its cumulative distribution function is for , for , and for . The jump at zero and the continuous increase both contribute; neither an ordinary probability density function alone nor a probability mass function alone describes the whole law.
Mixture model Created 2026-09-24 Updated 2026-10-14
A mixture model represents a population probability distribution by choosing one mixture component at random and then drawing from its probability distribution. For a finite mixture model whose mixture components have probability density functions , the resulting mixture distribution has probability density function
The mixture weights ensure and . For discrete random variables the same formula uses probability mass functions; without either kind of density, write for component distributions . A zero mixture weight makes that mixture component inactive.[ref]
The mixture components need not occupy disjoint bins of . Two normal distributions both have positive probability density functions everywhere, so the same value can plausibly come from either mixture component. The Two-Gaussian mixture example makes this overlap visible, and its mixture responsibilities quantify the remaining uncertainty about the latent variable. This is useful when a single normal distribution cannot represent the population's shape, but a fitted mixture model alone does not establish that its mixture components are real biological or social groups.
Mode (statistics) Created 2026-10-14 Updated 2026-10-24
A mode is a value at which a probability mass function or specified probability density function attains its largest value. There may be more than one. For the normal distribution the unique mode equals the mean; the Maxwell speed distribution has mode and a larger mean speed. For a continuous probability distribution, a mode maximizes density rather than the probability of an exact value, which is zero. Density modes can change under a nonlinear change of variables, as the distinction between Maxwell-Boltzmann velocity distribution and Maxwell speed distribution illustrates.
For with , insert its probability mass function into the expected value:
The exponential series shows finiteness for every real . Differentiating this moment-generating function gives mean and variance both . Taking the logarithm gives the cumulant-generating function , so every positive-order cumulant is also .
For independent and identically distributed observations from a probability mass function on a finite alphabet, expected relative entropy of the empirical distribution from is nonincreasing in sample size. The leave-one-out identity for empirical distributions and convexity of relative entropy in its first argument give
Every deletion sample has the law of observations from . Taking expected values proves the assertion without requiring independence between deletion samples. Zero-probability symbols are absent almost surely. Since , the identity also shows that expected empirical information entropy increases towards the source information entropy. Convergence follows from the strong law of large numbers for empirical frequencies and boundedness and continuity of information entropy on a finite probability simplex.
Multinomial aggregation 2026-10-14
If has a multinomial distribution with trials, group its categories into disjoint nonempty sets covering all categories. The grouped counts in the displayed equation have the multinomial distribution
Each original trial belongs to exactly one group, its group probability is the sum of its category probabilities, and grouping preserves independence between trials. This gives the rule without summing the original probability mass function over every possible internal count pattern.
For the four-trial example with probabilities , merge the last two categories. Their total has the binomial distribution , so and . The same variance follows from the variance of a sum:
Ignoring the negative covariance would give , although the two counts share a fixed total. Multinomial aggregation lets the resolution of category labels change while retaining a consistent model for the counts.