Skip to main content

Someone wanted to learn this too, so Grasp built them a personal learning path.

You can keep exploring this one or create your own

Marginal and Conditional Distributions

Hello! Let's continue our journey into the mathematical foundations of AI.

In the last lesson, we formally defined joint, marginal, and conditional distributions, establishing the theoretical framework for describing relationships between multiple random variables. We saw that for any set of variables, the joint distribution contains all the probabilistic information, from which the marginal and conditional distributions can be derived.

Today, we transition from definition to application. Your learning outcome is to compute marginal and conditional distributions from a given joint distribution. This is a crucial skill that involves putting the formulas from our previous lesson into practice. We will work through concrete examples for both discrete and continuous random variables, requiring careful application of summation and integration techniques.

1. The Discrete Case: From Joint PMF to All Others

Let's begin with discrete random variables. As we saw last time, their behavior can often be described completely by a table representing their joint probability mass function (PMF). From this table, we can derive everything else.

The process is as follows:

  1. Compute Marginal PMFs: To find the marginal PMF of one variable (e.g., ), we sum the joint probabilities over all possible values of the other variable (e.g., ). Geometrically, this corresponds to summing the values along the rows or columns of the joint probability table.
  2. Compute Conditional PMFs: To find the conditional PMF (e.g., ), we use the fundamental definition of conditional probability:

    This involves dividing the joint probability by the marginal probability of the conditioning variable.

Let's apply this to a worked example.

Lecture 8: Joint Probability Distributions

The following document provides a clear, table-based example involving two discrete random variables. We will use this to practice computing marginal and conditional PMFs.

Please read 'Example 3' on page 14. This example defines a joint PMF table for two random variables, X and Y, representing the number of hoses in use at a service station. Familiarize yourself with the setup and the joint probability values in the table.

Now, let's perform the calculations based on that example.

Calculating Marginal Distributions

The marginal PMF of , , is found by summing the probabilities in each row:

As a sanity check, these probabilities must sum to 1: .

Similarly, the marginal PMF of , , is found by summing the probabilities in each column:

Again, checking the sum: .

Calculating Conditional Distributions

Now, let's find the conditional distribution of given that . This tells us the probability distribution for the number of hoses in use on the full-service island, given that we know exactly two hoses are in use on the self-service island.

We use the formula . We already calculated .

Notice that the resulting conditional probabilities sum to 1 (), as they must for any valid PMF. This new distribution, , fully describes the probabilistic behavior of under the condition that .

Test your understanding!

Using the same joint PMF table, calculate the conditional probability distribution of given that , i.e., find for .

Show answer

We need to compute .
First, we recall the marginal probability .

Now we compute the conditional probabilities for each value of :

The sum of these probabilities is approximately 1, accounting for rounding. This is the PMF of given we know that .

2. The Continuous Case: Integration and Careful Limits

For continuous variables, the principles are identical, but summation is replaced by integration.

  1. Compute Marginal PDFs: To find , we integrate the joint PDF over all possible values of the other variable: .
  2. Compute Conditional PDFs: The formula remains a ratio: .

The primary challenge in the continuous case is correctly identifying the limits of integration. The region where the joint PDF is non-zero (the support of the distribution) determines these limits.

Let's begin by reviewing the general procedure for finding marginal and conditional PDFs from a joint PDF.

Lecture 19: Joint, Conditional, and Marginal Distributions | Statistics 110

This video from Harvard's Statistics 110 course clearly derives the formulas for marginalization and conditioning in the continuous case. It serves as a great warm-up for our next calculation.

Please watch from 06:15 to 11:37. This segment covers: Marginalization (06:15 - 08:36): How to obtain a marginal PDF by 'integrating out' the other variable. Conditioning (08:36 - 11:37): The definition of the conditional PDF as the ratio of the joint PDF to the marginal PDF.

Now, let's apply these formulas to a problem where the integration limits are not constant.

Lecture 13: Conditional Distributions and Joint Continuity

This document presents a problem where the joint PDF is uniform over a non-rectangular (triangular) region. This is a classic example that requires careful handling of integration limits.

Please read the 'Example' on page 13-5 and the calculations on page 13-6. The joint PDF is given as f_{X,Y}(x,y) = 1 over the triangular region shown in Figure 13.3. Focus on understanding how the marginal and conditional PDFs are derived step-by-step.

Let's break down those calculations. The joint PDF is inside the triangle defined by the vertices (0,0), (1,0), and (0,2), and 0 elsewhere. The hypotenuse of this triangle is the line , or .

Calculating Marginal PDFs

Marginal PDF of Y, :
To find , we integrate with respect to . For a fixed value of between 0 and 2, ranges from 0 to the line .


And otherwise.

Marginal PDF of X, :
To find , we integrate with respect to . For a fixed value of between 0 and 1, ranges from 0 to the line .


And otherwise.

Calculating Conditional PDFs

Now we can find the conditional distributions by division.

Conditional PDF of X given Y, :

This result is fascinating. For a fixed value of , the conditional distribution of is uniform on the interval . The length of this interval depends on , but the density over it is constant with respect to .

Conditional PDF of Y given X, :

Similarly, given a fixed , the conditional distribution of is uniform on the interval .

Test your understanding!

Given that we observe , what is the probability that ? In other words, calculate .

Show answer

We first need the conditional PDF . Using the formula we just derived:

This conditional density is valid for , which is the interval .

Now, we integrate this conditional PDF from 0.5 to the upper limit of its support, which is 1:

So, if the x-coordinate is 0.5, there is a 50% chance that the y-coordinate is greater than 0.5.

Conclusion

Today's lesson was purely computational, designed to solidify your understanding of the definitions from last time. You have practiced the two fundamental procedures for moving from a joint distribution to marginal and conditional ones.

Key Takeaways:

  • Marginal distributions are found by eliminating other variables from the joint distribution. This is done by summing over all values for discrete variables and integrating over the entire range for continuous variables.
  • Conditional distributions are found by taking the ratio of the joint distribution to the marginal distribution of the conditioning variable(s).
  • For continuous variables, the most critical step is correctly identifying the limits of integration, which are defined by the support of the joint distribution.

Preview of the Next Lesson:
While conditional and marginal distributions give us a complete picture, sometimes we need a simpler, single-number summary of the relationship between two variables. In the next lesson, we will introduce covariance and correlation. These metrics quantify the direction and strength of a linear relationship between two random variables, providing a first look into how one variable tends to change as another does.

Can't find a good explanation? Sign up and we'll make it for you

Sign up