Muddy Points

Chapter 26: Independent RVs

Published

November 25, 2024

Modified

November 25, 2024

Muddy points from Fall 2023:

2. Joint vs marginal vs conditional: How are we calculating the probability?

If we start at a joint probability \(f_{X,Y}(x,y)\)…. we can look at a few probabilities:

  • Joint probability: \(P(a \leq X \leq b, c \leq Y \leq d)\)

    \[P(a \leq X \leq b, c \leq Y \leq d) = \displaystyle\int_{x=a}^{x=b}\displaystyle\int_{y=c}^{y=d} f_{X,Y}(x,y) dydx\]

  • Marginal probability: \(P(a \leq X \leq b)\)

    \[P(a \leq X \leq b) = \displaystyle\int_{x=a}^{x=b} f_{X}(x) dx\]

    OR

    \[P(a \leq X \leq b) = \displaystyle\int_{x=a}^{x=b}\displaystyle\int_{y=-\inf}^{y=\inf} f_{X,Y}(x,y) dydx\]

  • Conditional probability: \(P(a \leq X \leq b | Y = c)\)

    \[P(a \leq X \leq b | Y=c) = \displaystyle\int_{x=a}^{x=b} f_{X|Y}(x|y=c) dx\]

    You cannot calculate \(P(a \leq X \leq b | Y = c)\) by \(\dfrac{P(a \leq X \leq b, Y=c)}{P(Y = c)}\) because \(P(Y = c)\) is 0. Instead, we need to find \(f_{X|Y}(x|y=c)\) by \(\dfrac{f_{X,Y}(x,y=c)}{f_{Y}(y=c)}\) and THEN integrate over X.

4. Here’s a 3D plot of one of our joint pdf’s

\[ f_{X,Y}(x,y) = 5e^{-x-3y} \text{ for } 0 \leq y \leq x/2 \]

library(plotly)

x = seq(0, 5, 0.1)
y = seq(0, max(x)/2, 0.1/2)
fn = expand.grid(x=x,y=y)
fn$z = ifelse(fn$y<fn$x/2, 5*exp( (-1)*fn$x - 3*fn$y), NA)

z = matrix(fn$z, ncol = 51, nrow = 51, byrow = T)

fig <- plot_ly(x = x, y=y, z=z) %>% add_surface()

fig