Understanding Why we Integrate joint density function with opposite bounds to get marginal density
I have a function $f_{x,y}(x,y)$ which represents the joint density function. In order to get marginal density function in terms of $x$, I need to integrate using $y$ bounds. Why is that? I assumed that we would integrate with $x$ bounds.
Solution 1:
For intuition it is often good practice to use discrete probabilities instead of continuous densities. Integrating is just a form of summation. Now if you had the following matrix
sick | healthy | |
---|---|---|
Test positive | 0.09 | 0.1 |
Test negative | 0.01 | 0.8 |
then getting the probability of someone being sick ($X\in\{\text{sick},\text{healthy}\}$) requires summing over the different test cases ($Y\in\{\text{positive},\text{negative}\}$) $$ P_X(\text{sick}) = \sum_{y\in\{\text{positive},\text{negative}\}} P_{X,Y}(\text{sick}, y) = 0.09 + 0.01 = 0.1. $$ More generally we have $$ P_X(x) = \sum_{y\in\{\text{positive},\text{negative}\}} P_{X,Y}(x, y), $$ which works the same for densities $$ f_X(x) = \int f_{X,Y}(x,y) dy $$