Problem with deriving joint/marginal PDF

  • Thread starter Thread starter lolproe
  • Start date Start date
  • Tags Tags
    deriving Pdf
Click For Summary
SUMMARY

This discussion focuses on deriving the joint and marginal probability density functions (PDFs) for a pair of random variables using MATLAB. The user initially proposed a joint PDF, f(x,y) = {1-x, if 0 ≤ x ≤ y ≤ 1; 0 otherwise}, but later realized it does not integrate to 1, indicating it is not a valid PDF. The marginal PDF was derived as f(x) = (1-x)^2 for 0 ≤ x ≤ 1, but the user expressed confusion regarding the limits and the expected linearity of the marginal PDF. The conversation emphasizes the importance of correctly defining the joint PDF to ensure it is a legitimate probability density function.

PREREQUISITES
  • Understanding of joint and marginal probability density functions
  • Proficiency in MATLAB for statistical analysis
  • Knowledge of integration techniques in probability
  • Familiarity with scatter plots and histogram generation in MATLAB
NEXT STEPS
  • Review the concept of valid probability density functions and normalization
  • Learn how to derive joint PDFs from sample data in MATLAB
  • Study the integration of joint PDFs to find marginal PDFs
  • Explore MATLAB functions for plotting and analyzing statistical data
USEFUL FOR

Students in probability and statistics courses, MATLAB users working on statistical assignments, and anyone seeking to understand the derivation of joint and marginal PDFs in a practical context.

lolproe
Messages
2
Reaction score
0
Hi, I'm having a problem with a MATLAB assignment in my probability class. It has to do with finding the joint and marginal PDFs of a pair of random variables. I understand this stuff on paper, but for some reason this assignment is giving me problems since I don't have a good idea of how the random variables translate into a graph.

Homework Statement


Here are the two questions giving me troubles

a) Run test.m once. This program generates 10,000 samples of the RV pair (X; Y ) uniformly
distributed over a region. You rst task is to identify the region and guess the PDF. To this end,
get the scatter plot of these samples and come up with an analytical expression for the joint PDF
f(x; y). Note that you need to give the exact denition of f(x; y).
b) Derive the marginal PDF of X by integrating f(x; y) over y. Let us call it f(x). By using
NormHist.m on X, plot the normalized histogram of X and f(x) on the same graph. Comment on
their match.

The plot produced by test.m is attached as 1.jpg

Homework Equations


Nothing as far as I know beyond basic probability stuff and integration

The Attempt at a Solution


My main problem is that I don't conceptually understand how to take a graph of sample data points and translate it into a PDF. After looking at the graph for a while, my guess at the joint PDF is

f(x,y)=\left\{\begin{array}{cc}1-x,&amp;\mbox{ if }<br /> 0\leq x\leq y\leq 1\\0, &amp; \mbox{ otherwise } \end{array}\right.

It makes sense to me logically, since for a given y value, x can only be as large as the y value and its probability decreases linearly as x increases from 0 to y. So that should cover part a, but I really don't know if I'm right.

For b, I just integrated it over the range of y, so:

f(x)=\int_x^1 (1-x)dy = (1-x)y|_x^1 =\left\{\begin{array}{cc}(1-x)^2,&amp;\mbox{ if }<br /> 0\leq x\leq 1\\0, &amp; \mbox{ otherwise } \end{array}\right.

I'm not really good with the limits during this sort of thing, so I figure this is probably where I made a mistake but I'm not sure.

When I run test.m, it saves X as a variable in MATLAB, and I have also have a function which plots the normalized histogram of a chosen variable with a number of bins. So running this script on X with 10 bins, I get the second attachment, 2.jpg.

This is where things really start confusing me. From looking at that, it seems like the marginal PDF should be linear, or specifically 2(1-x) instead of (1-x)^2. This would be easy to get from my joint PDF, but I see no way to get my Y limits to be as simple as 0 and 2. This is the main problem I have with the question. This is the first chance I have to really verify my work and it doesn't match up, so I don't know where I made my mistake. Any help would be much appreciated, thanks

[edit]
Looking at the question again, I guess it saying the values are uniformly distributed could lead somewhere but I'm not sure how. I tried assuming the marginal PDF was a uniform distribution with y as the limit but that didn't really get me any closer to the answer.
 

Attachments

  • 1.jpg
    1.jpg
    39.8 KB · Views: 549
  • 2.jpg
    2.jpg
    28.7 KB · Views: 392
Last edited:
Physics news on Phys.org
lolproe said:
Hi, I'm having a problem with a MATLAB assignment in my probability class. It has to do with finding the joint and marginal PDFs of a pair of random variables. I understand this stuff on paper, but for some reason this assignment is giving me problems since I don't have a good idea of how the random variables translate into a graph.

Homework Statement


Here are the two questions giving me troubles



The plot produced by test.m is attached as 1.jpg

Homework Equations


Nothing as far as I know beyond basic probability stuff and integration

The Attempt at a Solution


My main problem is that I don't conceptually understand how to take a graph of sample data points and translate it into a PDF. After looking at the graph for a while, my guess at the joint PDF is

f(x,y)=\left\{\begin{array}{cc}1-x,&amp;\mbox{ if }<br /> 0\leq x\leq y\leq 1\\0, &amp; \mbox{ otherwise } \end{array}\right.

It makes sense to me logically, since for a given y value, x can only be as large as the y value and its probability decreases linearly as x increases from 0 to y. So that should cover part a, but I really don't know if I'm right.

For b, I just integrated it over the range of y, so:

f(x)=\int_x^1 (1-x)dy = (1-x)y|_x^1 =\left\{\begin{array}{cc}(1-x)^2,&amp;\mbox{ if }<br /> 0\leq x\leq 1\\0, &amp; \mbox{ otherwise } \end{array}\right.

I'm not really good with the limits during this sort of thing, so I figure this is probably where I made a mistake but I'm not sure.

When I run test.m, it saves X as a variable in MATLAB, and I have also have a function which plots the normalized histogram of a chosen variable with a number of bins. So running this script on X with 10 bins, I get the second attachment, 2.jpg.

This is where things really start confusing me. From looking at that, it seems like the marginal PDF should be linear, or specifically 2(1-x) instead of (1-x)^2. This would be easy to get from my joint PDF, but I see no way to get my Y limits to be as simple as 0 and 2. This is the main problem I have with the question. This is the first chance I have to really verify my work and it doesn't match up, so I don't know where I made my mistake. Any help would be much appreciated, thanks

[edit]
Looking at the question again, I guess it saying the values are uniformly distributed could lead somewhere but I'm not sure how. I tried assuming the marginal PDF was a uniform distribution with y as the limit but that didn't really get me any closer to the answer.

The f(x,y) you wrote above does not integrate to 1, so is not a legitimate probability density function. Instead, try setting f(x,y) = constant inside the triangle.

RGV
 

Similar threads

Replies
7
Views
1K
Replies
11
Views
3K
Replies
6
Views
2K
Replies
9
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 40 ·
2
Replies
40
Views
5K
  • · Replies 3 ·
Replies
3
Views
3K