Marginal Distributions
Suppose you know the full joint behavior of a pair of random variables. For example, how tall a person is and how much they weigh, jointly. Can you recover the distribution of height alone, forgetting weight ever existed? This is the question a marginal distribution answers. It strips a joint law down to the behavior of one coordinate. This is done by summing or integrating the others away. The name itself comes from a bookkeeping habit. In old tables of joint frequencies, the row and column totals were written in the margins of the page. Those margin totals are exactly the marginal distributions. The idea matters because almost no interesting random experiment involves just one quantity in isolation. We measure many things at once. Examples include a stock's return and its volatility, a patient's blood pressure and cholesterol, or the outcomes of several dice. The joint distribution is the complete description of how they behave together. But often we only need the behavior of one variable. Sometimes we need it as a stepping stone toward more refined questions. One such question is how one variable behaves given information about another. Marginalization is the precise operation that lets us move from the "whole picture" (the joint law) to a "partial picture" (the law of a single coordinate). It is the single most-used operation in multivariate probability after specifying the joint law itself. The big picture is a conservation law. Probability mass or density lives on a two- (or higher-) dimensional space. It gets collapsed onto one axis by adding up all the mass that projects onto each point of that axis. In the discrete case this is literal summation over rows or columns of a joint probability table. In the continuous case it is an integral that "integrates out" the unwanted variable. The same idea extends without change of philosophy to any number of variables. It also extends to mixed discrete/continuous situations, though the technical bookkeeping differs. This article gives the formal definition of a marginal distribution and marginal density/mass function. It proves that marginals recovered from a valid joint distribution are themselves valid distributions. It works two fully asymmetric numerical examples. It shows precisely why each hypothesis (countable support, or a genuine joint density) is needed. It ends by pointing toward Conditional Distributions and Covariance and Correlation. Both of these are built on top of the marginal machinery developed here.
- A marginal distribution is the distribution of one coordinate of a random vector, obtained by "integrating out" the others.
- Discrete case: sum the joint pmf over all values of the unwanted variable(s).
- Continuous case: integrate the joint density over all values of the unwanted variable(s).
- Marginals are always determined by the joint distribution, but the converse fails — the joint is not determined by its marginals alone.
- The marginal pmf/density is automatically a valid probability distribution: it is nonnegative and sums/integrates to 1.
- Key idea: marginalizing is projecting a joint probability distribution onto one axis by summing or integrating away the other coordinates.
Where this lives today
Marginal distributions are the quiet workhorse behind nearly every multivariate calculation. In Bayesian statistics, the marginal likelihood (or "evidence") is obtained by integrating a joint density over the parameter, and is central to model comparison and Bayes factors. In machine learning, marginalizing over latent variables — as in mixture models, hidden Markov models, and variational autoencoders — is exactly the summation/integration described here, often approximated numerically when exact integration is intractable. In statistical mechanics, the marginal distribution of a single particle's velocity, obtained by integrating a joint many-particle density over all other particles' coordinates, recovers the Maxwell–Boltzmann distribution from the full phase-space density. In actuarial science and risk management, marginal distributions of individual loss types are extracted from joint models of correlated risks to price insurance products, even when the joint dependence structure (often modeled via copulas) is much more intricate than either marginal alone. In signal processing and information theory, marginal entropies computed from marginal distributions feed directly into mutual information, which measures the gap between the true joint and the independence baseline built from the marginals — a direct descendant of the counterexample above.
Ask the tutor: How do I find the marginal density of when and have a joint density, and how does that relate to marginalizing a transformed joint distribution?
Let be a pair of random variables on a probability space with joint distribution function
Marginal CDF. The marginal distribution function of is
and symmetrically .
Discrete case. If takes values in a countable set with joint probability mass function
the marginal pmf of is
summing over all for which has positive probability (equivalently, over all in the range of ).
Continuous case. If has a joint probability density function , meaning
for all (Borel) sets , the marginal density of is
and symmetrically . The definitions extend verbatim to variables with joint pmf/density or : the marginal of any sub-collection of the coordinates is obtained by summing/integrating the joint pmf/density over all the remaining coordinates, each ranging over its entire support.
Intuition
Picture the joint distribution of as a landscape of probability mass sitting over the plane: a bar chart of heights in the discrete case, or a continuous "hill" of density in the continuous case. To find the marginal distribution of , imagine standing at a fixed value and looking along the entire -direction — collecting all the mass that sits above the line , regardless of its -coordinate. Summing (or integrating) that mass gives a single number, or : it is exactly as if you flattened the landscape by pushing all of it down onto the -axis, like sunlight casting a shadow of the hill straight onto a wall. This "shadow" picture immediately explains why the marginal loses information: two very different joint hills can cast the same shadow, because the shadow only records the total mass at each , not how that mass was distributed across . This is precisely why marginals cannot be inverted back into a joint law without further assumptions such as independence — a fact made precise in the counterexample below.
Let have joint pmf (discrete case) or joint density (continuous case).
(a) Discrete case. The marginal pmf satisfies
so is a valid pmf, and it equals the pmf of the random variable in the sense that for every .
(b) Continuous case. Assume additionally that is integrable with , and that for a.e. the slice is integrable (guaranteed by Tonelli's theorem, see proof). Then the marginal density satisfies
so is a valid probability density, and it is a density for : for all .
Technique. Part (a) uses countable additivity of directly; part (b) uses Tonelli's theorem for nonnegative measurable functions (which permits interchanging the order of integration without any integrability hypothesis beyond nonnegativity) followed by the Fubini–Tonelli theorem to justify the iterated integral computing the actual measure of a rectangle.
(a) Discrete case. Nonnegativity. Each term since probabilities are nonnegative, so the sum is a sum of nonnegative terms, hence . Agreement with . Fix in the range of . Let range over all values in the range of , and note the events
are pairwise disjoint (they differ in the value of ) and their union is exactly the event , because on the event , must take some value in its range, and it takes exactly one such value. Since the range of is countable, countable additivity of gives
This proves exactly, not merely up to normalization. Normalization. By the same disjoint-union argument applied over all in the range of simultaneously, the events over all pairs in the (countable) joint range partition the whole sample space (up to a null set — every outcome gives some value in its countable range with probability 1). Hence by countable additivity,
where the double sum of nonnegative terms may be computed in any order or grouping (Tonelli's theorem for series, i.e. nonnegative double series sum unambiguously regardless of order). This completes part (a).
(b) Continuous case. Nonnegativity. Since everywhere (this is part of what it means to be a joint density), for every fixed the integrand is nonnegative, so its integral is nonnegative (it may equal on a null set of 's, but is finite and well-defined for a.e. by Tonelli's theorem below). Well-definedness via Tonelli. Tonelli's theorem states: if is (jointly) measurable, then
with all three quantities equal in , no integrability hypothesis needed beyond nonnegativity and measurability. Apply this with , measurable since it is a density. The middle expression equals by definition of , and the left side equals since is a probability density on . Hence
which in particular forces the inner integral to be finite for Lebesgue-almost every (an integral of an a.e.-finite nonnegative function over can only be finite if the function itself is finite a.e.). This proves normalization and simultaneously the a.e. finiteness (well-definedness) of . Agreement with the CDF of . Fix . By definition of the joint distribution function and the fact that is a joint density,
Apply the Fubini part of the Fubini–Tonelli theorem (justified since and the double integral over the whole plane is finite, namely , so is absolutely integrable) to write this iterated integral in the order then :
using the definition of in the inner integral. This shows is indeed a density whose antiderivative recovers the true marginal CDF of , completing part (b).
∎For any joint pmf or joint density on variables, marginalizing over any nonempty proper subset of the coordinates via summation/integration always produces a well-defined pmf (exactly) or density (up to redefinition on a Lebesgue-null set) for the remaining coordinates. This follows by applying the two-variable argument above with replaced by the vector of all coordinates being integrated out, since Tonelli's theorem places no restriction on the dimension of the variable being integrated over.
Worked examples
Example 1 (discrete, asymmetric joint pmf). Let (number of defective units found by inspector A) and (whether a shipment is flagged, meaning "flagged"), with joint pmf given by the table
Step 1: check validity. All nine listed entries are nonnegative, and their sum is
so this is a legitimate joint pmf on the six pairs shown (this matches the table pictured in the intuition figure, transposed).
Step 2: marginal of . Sum down each column:
Check: ✓, confirming Theorem: Marginals are valid probability distributions (part a) holds numerically.
Step 3: marginal of . Sum across each row:
Check: ✓.
Step 4: a genuine use of the marginal. Suppose we only care about the overall probability a shipment gets flagged, ignoring which inspector-count triggered it. The answer is exactly — read directly off the marginal, without needing to know how that decomposes across . Notice also this joint table is not a product of its marginals: but , so and are dependent even though each marginal alone is perfectly well defined — a fact marginals alone can never detect (elaborated in the counterexample).
Example 2 (continuous, asymmetric joint density on a triangular region). Let have joint density
and otherwise. This support is the triangle below the line and above , for — asymmetric in and , since the range of depends on but not vice versa.
Step 1: find . We need :
Setting gives .
Step 2: marginal density of . For , integrate out over its range :
So for and otherwise. Check normalization:
Step 3: marginal density of . Here care is needed because the range of given is (since we need ), which is the more delicate direction of this asymmetric region. For :
Simplify inside the parentheses:
Hence
Check normalization:
Convert to quarters: . ✓ This example shows the mechanics in a genuinely asymmetric region: the two marginals ( versus a quadratic-in- with three terms) look nothing alike, correctly reflecting the asymmetric shape of the support triangle, and both integrate correctly to exactly as Theorem: Marginals are valid probability distributions guarantees.
The theorem shows a joint pmf/density always produces valid marginals. It says nothing about the converse — and the converse is false: infinitely many different joint distributions can share the same pair of marginals. This shows why "knowing both marginals" is not a hypothesis that can be added to reconstruct the joint law; genuinely more information (such as independence, or the full joint density) is required.
Construction. Let and each be Bernoulli-type variables taking values in with the same marginal distribution and . Joint law A (independence). Take independent, so
Joint law B (perfect agreement). Take always, so
Both have the stated marginals. For law A: , and similarly all four marginal checks pass by symmetry. For law B: , and again symmetric checks confirm exactly as in law A.
But the joint laws are different, and detectably so. Under law A, ; under law B, . These joint probabilities differ, so laws A and B are genuinely different probability distributions on — yet marginalizing either one produces the identical pair of marginal pmfs.
Diagnosis. The hypothesis that fails here is not one of the theorem's hypotheses (both A and B are perfectly valid joint pmfs, so the forward direction — joint gives valid marginals — holds for both, exactly as proved). What fails is an implicit assumption a careless reader might smuggle in: that specifying the marginals is enough to pin down the joint. The theorem never claims this, and this example shows explicitly why it cannot: the "shadow" operation of marginalizing is many-to-one, discarding the dependence structure between and . Recovering that structure is exactly the job of Conditional Distributions and, in summary form, of the covariance between and .
Scope, edge cases & common traps
| Situation | What to do | Common mistake |
|---|---|---|
| Discrete joint pmf | Sum over in the range of for fixed | Summing over a fixed range instead of the actual support, missing or double-counting values |
| Continuous joint density, rectangular support | Integrate over the fixed interval for | Using constant limits when the support is not a rectangle |
| Continuous joint density, non-rectangular support (e.g. triangle) | Integrate over -limits that depend on (or vice versa) | Forgetting the limits of integration depend on the other variable, integrating over the wrong region |
| Mixed discrete/continuous vector | Sum over discrete coordinates, integrate over continuous ones | Treating a discrete coordinate as continuous (or vice versa) and misapplying vs. |
| Wanting to reconstruct joint from marginals | Not possible in general — need joint pmf/density or an independence assumption | Assuming marginals plus "reasonable" combination rules recover the joint (see counterexample) |
| Checking your answer | Verify the marginal sums/integrates to exactly | Skipping the normalization check, missing an arithmetic slip in the joint density's normalizing constant |
The mathematician behind it
Origins · 1 minAndrey Nikolaevich Kolmogorov and how this was discovered
Kolmogorov's 1933 monograph Grundbegriffe der Wahrscheinlichkeitsrechnung placed probability on a rigorous measure-theoretic foundation, defining random variables as measurable functions and joint distributions as measures on product spaces. This framework is exactly what makes statements like "the marginal is obtained by integrating out the other variable" precise and provable via Tonelli/Fubini-type theorems, rather than merely a computational recipe. The terminology "marginal," however, predates Kolmogorov by decades and traces to the practical habit — common among actuaries and early statisticians tabulating joint frequency counts — of writing row and column sums in the margins of two-way tables.
Why is it called a "marginal" distribution?
The name is historical, not mathematical. Early statisticians tabulating two-way frequency data (for example, counts of people cross-classified by height and weight categories) would write the row totals and column totals in the margins of the printed table. Each such margin total, divided by the overall sample size, approximates exactly the distribution of one variable alone — literally the number written in the margin of the page. The term stuck even after probability theory became fully rigorous and the operation was reinterpreted as an integral or sum rather than a literal tally in a table's border.
Can I get the marginal of without knowing the full joint distribution?
No — in general the marginal of is a genuine consequence of the joint distribution, and there is no shortcut that bypasses it unless you already know something extra, such as independence. If and are independent, then trivially can be computed by treating in isolation, ignoring entirely, since the joint pmf factors as and marginalizing recovers automatically. But if you are not told independence holds, you must have (or compute) the actual joint pmf/density and sum/integrate it, exactly as in the definition.
Does marginalizing always work, or are there joint distributions with no valid marginal?
For any legitimate joint pmf (nonnegative, summing to 1 over a countable support) or joint density (nonnegative, integrating to 1 over the plane), the marginal always exists and is itself a valid pmf or density — this is exactly the content of the theorem proved above, using countable additivity in the discrete case and Tonelli's theorem in the continuous case. The only subtlety in the continuous case is that the marginal density is only guaranteed to be finite for almost every , not literally every , though this technicality almost never causes trouble in standard examples with continuous, well-behaved joint densities.
If I know the marginal of and the marginal of , can I recover the joint distribution?
Not in general — this is exactly the point of the counterexample above, where two very different joint pmfs (independent versus perfectly dependent) share identical marginals for and for . The only case where the marginals suffice is if you are additionally told and are independent, in which case the joint pmf/density is forced to be the product of the marginals: . Without an independence assumption (or the full joint law itself), the marginals alone leave the dependence structure between and completely unconstrained.
How does marginalizing extend to three or more variables?
Exactly the same way: to find the marginal distribution of a sub-collection of coordinates from a joint pmf or density on variables, sum (discrete) or integrate (continuous) the joint pmf/density over every coordinate not in that sub-collection, letting each summed-out coordinate range over its entire support. For instance from a joint density , the marginal density of the pair is , and you can then further marginalize this bivariate density down to by integrating out as well. Tonelli's theorem, which underlies the proof, places no restriction on dimension, so the same justification carries over unchanged.
What is the connection between marginal distributions and conditional distributions?
Marginal and conditional distributions are the two natural "views" you can take of a joint distribution: the marginal ignores the other variable entirely, while the conditional distribution restricts attention to a specific value (or event) of the other variable and renormalizes. Formally, the conditional pmf is , which requires the marginal in the denominator to even be defined — so marginals are a logical prerequisite for Conditional Distributions, not a competing concept. Averaging the conditional distribution of given over the marginal distribution of recovers the marginal distribution of , a fact known as the law of total probability in distributional form.
Why do we need Tonelli's or Fubini's theorem at all — isn't integrating out a variable "obviously" fine?
It feels obvious, but interchanging an infinite sum or an integral with another integral is a genuinely delicate operation in general — there exist non-negative or signed functions of two variables where iterated integrals in different orders give different answers, or where one order diverges while the other converges. Tonelli's theorem is precisely what guarantees that for nonnegative functions (which joint pmfs and densities always are), no such pathology can occur, and any order of summation/integration gives the same, correctly-defined marginal. Without invoking it explicitly, "obviously" is doing hidden work that the proof makes rigorous.