AI Glossary / Statistics and probability / Beginner
Marginal probability
Definition
A marginal probability is the probability of an event or variable value without restricting other variables in a joint probability model to particular values. It is obtained by adding or integrating over those other possibilities. For example, the probability that a randomly selected customer makes a purchase can be calculated across all device types. The word marginal describes the scope of the probability, not a small, borderline, or unimportant likelihood.
What it means
Three questions should be kept separate. A joint probability asks whether two events occur together, such as using a phone and purchasing. A conditional probability asks about purchasing among phone users. A marginal probability asks about purchasing across the specified population, combining phone users and everyone else.
A marginal distribution contains the probabilities for all possible values of the retained variable. A marginal probability is one probability within that description, or the probability assigned to an event. Its meaning always depends on the underlying population, sampling rule, and information already built into the model.
How it works
Identify the event A and a set of nonoverlapping, exhaustive categories B_i. Add the joint probabilities P(A and B_i) across categories. Equivalently, use the law of total probability: P(A) = sum over i of P(A given B_i)P(B_i).
The category probabilities act as weights. A simple average of category-specific rates is appropriate only when the categories have equal weight for the target population. Independence is not needed for this calculation. If categories overlap, adding their contributions without adjustment can count the same outcome more than once.
In a data table, sum the relevant counts and divide by the appropriate grand total. In a continuous model, integrate the joint density over the variables being removed and over any range defining the event. Distinguish an estimated probability from a known model probability when communicating uncertainty.
Three practical examples
- An online shop combines purchase rates across device types to estimate the chance that a randomly selected visit produces an order.
- An AI service averages category-specific error probabilities using the expected mix of incoming requests.
- A household estimates the chance of a late delivery across its usual suppliers, weighting each supplier by how often it is used.
Think of it this way
Think of counting all green tokens in several bags after deciding how likely each bag is to be selected. The overall chance of green depends both on each bag's green fraction and on the selection probabilities. A bag containing mostly green tokens contributes little if it is almost never selected.
Worked example
Consider an original model with three mutually exclusive visit types: mobile, desktop, and tablet. Their probabilities are 0.60, 0.30, and 0.10. Purchase probabilities conditional on those types are 0.04, 0.08, and 0.05.
The joint probabilities of each type together with a purchase are 0.60 × 0.04 = 0.024, 0.30 × 0.08 = 0.024, and 0.10 × 0.05 = 0.005. Adding them gives a marginal purchase probability of 0.053, or 5.3%.
In 10,000 visits drawn under this model, the expected purchase count is 530. It is an expectation, not a guaranteed count. An unweighted average of the three conditional rates would be approximately 5.67%, which answers the wrong question for this visit mix.
If the mix changes to 0.80 mobile, 0.10 desktop, and 0.10 tablet, with conditional purchase rates unchanged, the new marginal probability is 0.80 × 0.04 + 0.10 × 0.08 + 0.10 × 0.05 = 0.045, or 4.5%. The overall rate fell by 0.8 percentage points without any device-specific deterioration.
Illustrative case study
Fictional case: ShopLantern sees its overall conversion probability fall after a marketing campaign. The team initially suspects its AI product recommendations have become less useful. A breakdown shows stable conversion rates within each device category but a much larger share of mobile visits.
The analyst separates changes in traffic composition from changes within device groups. Management evaluates the campaign using both views and checks the uncertainty in the estimated rates. The case demonstrates why an overall probability is valuable for planning while still being insufficient to explain the mechanism behind a change.
Common misconceptions and mistakes
A marginal probability is not the same as a conditional probability with the condition forgotten. Recovering the overall probability requires the relevant category weights. Nor is it generally the arithmetic average of subgroup rates.
Summing overlapping categories can exceed the correct probability because some outcomes are counted twice. A marginal probability also does not establish a causal effect: a change can reflect population composition, selection, or other factors. In a continuous distribution, a density value should not be mistaken for the probability of one exact numerical value.
Business use
Businesses use marginal probabilities in demand planning, service staffing, expected-error calculations, and communication of overall performance. They provide a concise answer to questions about a randomly selected unit from a defined population.
Always specify that unit: a customer, visit, order, or support interaction can produce different probabilities. Preserve subgroup information when it matters for decisions, and check whether the observed data mix matches the intended deployment mix. For an AI model, changing request proportions can alter the overall error probability even when performance within each request category remains stable.
People also ask
Does marginal probability require independence?
No. Summation over a joint distribution works whether or not the variables are independent.
Can it change when conditional rates do not?
Yes. The weights assigned to the conditions can change.
Is it always an unconditional probability?
It is unconditioned on the variables being averaged out, but the whole model may already be conditional on other information, such as a selected population or period.
Check your understanding
Two branches have success rates of 90% and 60%, but the first handles only 10% of all cases. Is the overall success probability 75%?
Answer: No. The correctly weighted value is 0.10 × 0.90 + 0.90 × 0.60 = 0.63, or 63%, assuming the two branches cover all cases without overlap.
Related terms
- Marginal distribution
- Joint probability
- Conditional probability
- Partition
- Base rate
- law of total probability
- mixture
- population composition
Learn next
Practice calculating joint and conditional probabilities from a contingency table, then reconstruct the marginal probabilities. Next study Bayes' rule and why reversing a conditional probability requires attention to base rates.
More in Statistics and probability
- Mann-Whitney U test - The Mann-Whitney U test is a rank-based statistical test for comparing two independent samples.
- Mantel test - A Mantel test assesses association between two matrices of pairwise distances or dissimilarities measured on the same set of objects.
- Marchenko - Pastur distribution - The Marchenko - Pastur distribution describes the limiting distribution of eigenvalues of certain large sample covariance matrices when the number of...
- Marginal structural model - A marginal structural model is a model for features of the distribution of potential outcomes under specified interventions or treatment histories.
- Marginal totals - Marginal totals are the sums for the categories of one variable after adding across the categories of another variable in a table.
- Markov logic network - A Markov logic network, or MLN, combines first-order logical formulas with numerical weights to define a probabilistic model over relationships and attributes.
Sources
Pishro-Nik, law of total probability: https://www.probabilitycourse.com/chapter1/1_4_2_total_probability.php
Pishro-Nik, joint probability mass functions and marginalization: https://www.probabilitycourse.com/chapter5/5_1_1_joint_pmf.php
The supplied AIMA glossary page did not expose its entry text during checking; the explanation was verified against the primary textbook above. The calculations and ShopLantern case are original teaching illustrations.
Previous: Marginal distribution Next: Marginal structural model