Search the atlas

Joint, marginal and conditional distributions

Build distributions for pairs of random variables, obtain marginals and conditional laws, and integrate over a triangular support without assuming independence.

Joint, Marginal and Conditional Distributions

A joint distribution describes a pair of random variables together. A marginal distribution describes one variable while ignoring the other. A conditional distribution describes one variable after specifying information about the other. These operations answer different questions and generally produce different probabilities.

Start with probability, events and random variables. The discrete example needs sums and fractions. The continuous example uses integrals over a region. All probabilities here are assigned teaching models, not estimates of equipment reliability.

Begin with a Joint Table

Let X count requests received during one observation window, with possible values 0, 1 and 2. Let Y identify one of two operating modes, coded 0 and 1. Assign this joint probability mass function:

X

Y = 0

Y = 1

Row sum

0

0.12

0.08

0.20

1

0.18

0.22

0.40

2

0.10

0.30

0.40

Column sum

0.40

0.60

1.00

The cell 0.22 means P(X=1,Y=1)=0.22P(X=1,Y=1)=0.22: both statements concern the same observation window. Every cell is nonnegative and the six cells sum to one. Row and column totals are summaries, not additional outcomes to include in that sum.

An event is a collection of cells. For example, “at least one request while in mode 1” has probability 0.22+0.30=0.520.22+0.30=0.52. The table directly supplies their intersection; multiplying separate percentages would require an independence assumption that this model does not satisfy.

Sum Out a Variable to Obtain Its Marginal

The joint-distribution definitions in MIT’s probability notes, slides 7–9, give the discrete marginal by summing over the variable being discarded:

pX(x)=∑ypX,Y(x,y),pY(y)=∑xpX,Y(x,y).\begin{aligned} p_X(x)&=\sum_y p_{X,Y}(x,y),\\ p_Y(y)&=\sum_x p_{X,Y}(x,y). \end{aligned}

Thus X has masses 0.20, 0.40 and 0.40; Y has masses 0.40 and 0.60. Each marginal separately sums to one. Marginalization combines all modes. It does not mean fixing the mode to an average value or selecting the largest cell in each row.

The joint cumulative distribution function uses a different operation:

FX,Y(a,b)=P(X≤a,Y≤b).F_{X,Y}(a,b)=P(X\le a,Y\le b).

For this table, FX,Y(1,0)=0.12+0.18=0.30F_{X,Y}(1,0)=0.12+0.18=0.30. A joint CDF accumulates probability below both thresholds. It is not a cell probability and is not generally the product of the two marginal CDFs.

Condition by Restricting and Renormalizing

Suppose the observed mode is Y = 1. Restrict attention to that column, whose probability is 0.60, and divide each cell by 0.60:

pX∣Y(x∣y)=pX,Y(x,y)pY(y),pY(y)>0.\begin{gathered} p_{X\mid Y}(x\mid y)=\frac{p_{X,Y}(x,y)}{p_Y(y)},\\ p_Y(y)>0. \end{gathered}

The conditional probabilities for X = 0, 1 and 2 are 2/152/15, 11/3011/30 and 1/21/2. They sum to one. In particular, P(X=2∣Y=1)=0.50P(X=2\mid Y=1)=0.50, whereas the unconditional probability of two requests is 0.40.

Reversing the condition gives P(Y=1∣X=2)=0.30/0.40=0.75P(Y=1\mid X=2)=0.30/0.40=0.75. Use the marginal of the variable after the conditioning bar in the denominator. A zero-probability row or column cannot be normalized by this discrete formula.

Conversely, a marginal and the corresponding conditional law reconstruct the joint law through pX,Y(x,y)=pX∣Y(x∣y)pY(y)p_{X,Y}(x,y)=p_{X\mid Y}(x\mid y)p_Y(y). Two marginals alone generally cannot: they omit the way values occur together.

Independence Is a Property of the Whole Joint Law

Discrete X and Y are independent exactly when every cell equals its marginal product. Here p(0,0)=0.12p(0,0)=0.12, while pX(0)pY(0)=0.20(0.40)=0.08p_X(0)p_Y(0)=0.20(0.40)=0.08. This one mismatch disproves independence. One matching cell, however, would not prove it.

For variables admitting a joint density, independence requires factorization into marginal densities almost everywhere, including the zero-density regions. For general distributions, the corresponding condition is factorization of probabilities for all pairs of events, or of the joint CDF. Do not infer independence from separate histograms or from a rectangular plotting window.

Continuous Probability Requires an Area Integral

Consider dimensionless X and Y with joint density 2 on the triangle 0<x<y<10<x<y<1, and zero elsewhere. The support has area 1/21/2, so its integral is one. The height 2 is a density, not a probability. If X and Y had physical units, a joint density would have inverse units of their product.

For an event region A, integrate the density over the part of A inside the support. In particular, let A be X<0.4X<0.4 and Y<0.6Y<0.6. For each 0<x<0.40<x<0.4, the permitted y values run from x to 0.6:

P(A)=∫00.4∫x0.62 dy dx=2∫00.4(0.6−x) dx=0.32.\begin{aligned} P(A)&=\int_0^{0.4}\int_x^{0.6}2\,dy\,dx\\ &=2\int_0^{0.4}(0.6-x)\,dx=0.32. \end{aligned}
Equal-scale x and y axes show the triangular support above y equals x and below y equals one. The event x less than 0.4 and y less than 0.6 is the smaller shaded polygon inside that triangle. A vertical segment shows integration from y equals x to 0.6.
Density is 2 throughout the large triangle and zero outside. The highlighted event polygon has area 0.16 and probability 0.32. The vertical segment illustrates the inner integral, not an extra probability mass. Both dimensionless axes use the same linear scale.

Integrating over the full 0.4×0.60.4\times0.6 rectangle would include impossible points with y<xy<x and incorrectly give 0.48. The support is part of the model, not a decorative boundary.

Integrate Out a Variable

For 0<x<10<x<1, integrating y from x to 1 gives fX(x)=2(1−x)f_X(x)=2(1-x). For 0<y<10<y<1, integrating x from 0 to y gives fY(y)=2yf_Y(y)=2y. Both marginals are zero outside their respective intervals and each integrates to one.

A uniform density over the triangle does not make either marginal uniform. At small x there is a longer permitted vertical slice, while at large y there is a longer horizontal slice. Nor are X and Y independent: their marginal product is positive at points with x>yx>y, where the joint density is zero.

A Continuous Conditional Density Is a Normalized Slice

For a jointly continuous model and a conditioning value with positive, finite marginal density, the standard density construction is

fX∣Y(x∣y)=fX,Y(x,y)fY(y).f_{X\mid Y}(x\mid y)=\frac{f_{X,Y}(x,y)}{f_Y(y)}.

In this triangle it becomes 1/y1/y for 0<x<y0<x<y, and zero otherwise. At y=0.8y=0.8, X is conditionally uniform from 0 to 0.8, so P(X<0.3∣Y=0.8)=0.3/0.8=0.375P(X<0.3\mid Y=0.8)=0.3/0.8=0.375.

This calculation does not divide by P(Y=0.8)P(Y=0.8), which is zero. It uses the normalized density slice. MIT’s notes on conditional densities, slides 4–5, distinguish this construction from conditioning by an event-probability ratio. For regular interior values here, it also agrees with the limit of conditioning on narrowing intervals around y. A finite measurement bin generally gives its own conditional probability.

The formula does not specify a law at y=0y=0, where the marginal density vanishes. Conditional densities are determined only up to changes on conditioning sets of probability zero; an arbitrary endpoint value is not an additional physical prediction.

Applications and checks

A joint model retains which observations belong together. In the request example, mixing operating modes changes the marginal count distribution, while conditioning answers a question about one known mode. Losing those labels can make a combined distribution appear representative of conditions it does not describe. Preserve paired records, time alignment and the meaning of each variable before estimating a joint law.

Check nonnegative masses or densities, total probability one and the support before computing a performance probability. Then check that each marginal and each applicable conditional distribution normalizes correctly. These checks catch missing cells, invalid parameters and incorrect integration limits. They do not establish that a synthetic table or triangular density represents real loads, delays or measurement errors.

For an engineering threshold, state whether the question is unconditional, conditional on an operating state, or conditional on a finite observation interval. Those questions can produce different answers under the same correct model. Separate marginal distributions are insufficient when a decision depends on simultaneous events. The worked exercises test reconstruction, support-dependent integrals, conditional expectations and cases where apparently normalized inputs are still inadmissible.

Back to contents