1

I am just wondering if there is something trivial that I have missed regarding this. If I've understood it right, two random variables are called independent if and only if: $f(x_1,x_2)=f_{x_1}(x_1)*f_{x_2}(x_2)$

Where the left hand side denotes the joint density function, and the right hand side denotes the product of the marginal densities.

But when I am asked to determine if two random variables X and Y are independent given the joint density function, I use the definition above. Yet it seems that every exercise regarding this, is followed up by another question where they ask for the marginal densities.

If Im using the definition above I've already calculated the marginal densities, and hence solved the follow-up exercises. So am I doing something wrong, or is the book just confusing me?

Biggiez
  • 159
  • 2
    First, not all independent random variables have joint densities, so the "only if" part of your second sentence is wrong. Second, you might recognize that $f$ factors as a product $f=f_1 f_2$ of functions but not be sure what the correct integrate-to-1 scaling factors are, so that, for instance, $2f_1$ is the correct $x_1$ margin and $f_2/2$ is the correct $x_2$ margin. Otherwise, yes, you are right, and the book seems confusing. – kimchi lover Sep 17 '17 at 14:24

2 Answers2

3

Actually the condition that you mention is sufficient but is not necessary. This because densities are in not determined by the distribution.

If $f$ is a density for the distribution and $A$ is a Borel-measurable subset of $\mathbb R^2$ with Lebesgue measure $0$ then also $f1_{A^{\complement}}$ will work as density. That gives you the freedom to find a density $f(x_1,x_2)$ and next to that marginal densities $f_{1},f_{2}$ with: $$\{(x_1,x_2)\in\mathbb R^2\mid f(x_1,x_2)\neq f_1(x_1)f(x_2)\}\neq\varnothing$$ in spite of independence.

So you can use the formula for proving independence but you better not use it when it comes to defining independence.

drhab
  • 153,781
  • Whats the benefit of calcuating the marginal densities $f_{x_1}(x_1)$ and $ f_{x_2}(x_2)$? Can you for example use the first one to calculate $P(a \leq x_1 \leq b) = \int_{a}^b f_{x_1}(x_1) $? – Biggiez Sep 17 '17 at 14:52
  • Indeed. For that it can be used, and also it can be used to prove independency. – drhab Sep 17 '17 at 14:54
  • @drhab But this only holds assuming that $x_1$ is a continuos random variable, or? If $x_1$ would have been a discrete r.v and $x_2$ continuous, would I had to replace $\int_a^b$ with $\sum_a^b$ for $P(a \leq x_1 \leq b)$ ? – Biggiez Sep 17 '17 at 15:07
  • What does $f1_A$ stand for? Never seen it before.. – Biggiez Sep 17 '17 at 15:14
  • @Biggiez Of course we are talking about (absolutely) continuous rv's here. Not discrete ones. That's another chapter with PMF instead of PDF. $f1_A$ stands for the product of two functions: $f$ and $1_A$ where $1_A$ denotes the indicator function of set $A$. – drhab Sep 17 '17 at 15:15
  • If we have a mixed random vector, where $x_1$ is discrete and $x_2$ is continuos. Can I use the marginal density $f(x_1)$ to calculate $P(a \leq x_1 \leq b)$ ? Then $P(a \leq x_1 \leq b)= \sum_a^b f(x_1)$ ? Or am I thiking wrong? – Biggiez Sep 17 '17 at 15:20
  • This is a place to comment my answer and ask for explanation of it. Not to ask questions. If you want an answer then place it as a new question. – drhab Sep 17 '17 at 15:22
1

Your definition of independent random variables is missing the important requirement that (for jointly continuous random variables), $$f_{X,Y}(x,y) = f_X(x)f_Y(y) ~ \textbf{for all real numbers}~x~\text{and}~y.\tag{1}$$ In some cases, it is possible to determine that $X$ and $Y$ are dependent random variables without determining the marginal densities and verifying whether $(1)$ is satisfied or not. For example, if the support of $f_{X,Y}$ is not a rectangular region with sides parallel to the axes (e.g. the support is a rotated square with vertices $(1,0), (0,1),(-1,0), (0,-1)$ or the triangle with vertices $(0,0), (1,1), (0,1)$), then $X$ and $Y$ are dependent random variables. This is essentially noting (visually after sketching the support on a piece of paper or in one's mind) that there are points $(x,y)$ for which $f_{X,Y}(x,y) = 0$ while both $f(x)$ and $f_Y(y)$ are clearly nonzero, and so $(1)$ obviously does not hold. In an answer to a different question, I have called this the eyeball test for dependence. Try it for $(x,y) = \left(\frac 34, \frac 34\right)$ in the example cited above.

In short, there can be good reason for asking for the actual marginal densities from those who used their imagination as described above.

Dilip Sarwate
  • 26,411
  • Okay, nice . How do you determine that both $f_X(x)$ and $f_Y(y)$ are nonzero when $f_{XY}(x,y)=0$ in your example? – Biggiez Sep 17 '17 at 14:59
  • Sketch the support of the joint density and mark on it the lines along which you travel when computing $$f_X\left(\frac 34\right) = \int_{-\infty}^\infty f_{X,Y}\left(\frac 34, y\right) ,\mathrm dy$$ and $$f_Y\left(\frac 34\right) = \int_{-\infty}^\infty f_{X,Y}\left(x,\frac 34\right) ,\mathrm dx?$$. Can you tell that the marginal densities must be nonzero without having to compute their actual values? – Dilip Sarwate Sep 17 '17 at 15:14
  • Not sure if im thinking right, but in both cases I end up on the line y=x? – Biggiez Sep 17 '17 at 15:32
  • Maybe they must be non-zero since when we integrate $f(x)=y$ from 0 to 3/4 we cant get a non-zero value? – Biggiez Sep 17 '17 at 15:39