# Check for independence of variables when the density (or distribution) is known.

This question is closely related to a previous one:

Determine correlation and independence when only the joint density is given?

Nonetheless, the setting is reproduced below.

The joint pdf of $X = (X_1,\ldots,X_n)$ is:

$$f_{X}(x_1,\ldots,x_n)=\begin{cases} Ar^2,&0 \le r \le R\\[0.2cm] 0,& \text{ otherwise }\end{cases}$$

where $r = \sqrt{x_1^2 + \ldots + x_n^2}$ and $A,R$ are constants.

I would like to know if the $X_j$'s are independent. Since the density is a sum over the $X_j$'s and the sum is bounded above by $R$ (and below by 0) , I would think the $X_j$'s are dependent. However, I have three concerns regarding this intuition.

1. How do I formally argue for (in)dependence by examining the density, and the distribution?

2. If I cannot formally argue by looking at the density/distribution alone, how do I check for independence of continuous variables? It does not seem feasible to check for the condition $$P(X_1) = P(X_1 |X_2,\ldots,X_n)$$

3. Can I still claim the $X_j$'s are independent if they are a sum, but the sum is not bounded above/below by some value?

• I answered 1. in a comment on the other page. If something is unclear to you about this, please explain what is. – Did Dec 16 '14 at 19:11
• Just the distinction between the sentence "density is not a product" and a "formal" argument. If no distinction exist then question 1 is answered. Question 3, however, remains open at least to me. – chibro2 Dec 16 '14 at 19:13
• This is the second time you misquote me. Please read: "the support of the density is not a product". If you need a formal argument to show that the disk $x^2+y^2\leqslant R^2$ is not a product... – Did Dec 16 '14 at 19:55
• Ok so I think I don't understand what you mean when you say "support of $f$ is not a product. Could you show the formal argument suggested? And why is it sufficient to check for the case when $n=2$, again assuming that's what you mean by $x^2 + y^2$ – chibro2 Dec 16 '14 at 20:10

It seems -looking at point 1 and the comments- to me that you didn't quite understand the answer (and comments) to the previous question, even informally.

Quick example: we are told that two variables $(X,Y)$ have some joint density $f_{X,Y}$ with support (that is, taking strictly positive values) over a unit circle centered in the origin: $f(x,y) > 0 \iff x^2+y^2<1$. This immediately says that the variables are NOT independent. Why? Because the marginals $f_X$ $f_Y$ will have support on the intervals $I_x = [-1,1]$ and $I_y=[-1,1]$, and then, for any $(x,y) \in I_x \times I_y$ (that, is for any point inside the rectangle - whichs is cartesian product of the two intervals) we should have, $f_{X,Y}(x,y)=f_X(x) f_Y(y) >0$, and zero otherwise . That is: the support should be a rectangle, and with sides parallel to the axes.

This is just an example, the marginals need not be intervals. But, in general, what remains true is that the support of the joint density (the region where it takes positive values) must be the product (the cartesian product!) of the supports of each variable. If not a rectangle (perhaps unbounded) at least a set of rectangles. Never a circle or a circular sector, or other shapes.

Regarding the other points: the criteria above is a first necessary (not sufficient!) condition for independence, quite elementary but useful. It says nothing if the support is all the plane, for example. Failing that, you need to apply the definition, and either check that the joint distribution factorizes as the product of the marginals, or compute the conditional. Nothing much can be said in general. (And I wonder why you emphasize that the variables are continuous , that seems pretty irrelevant).

The point 3 makes no sense to me. What does "they are a sum" mean? The sum of several variables is a single variable, so I have no idea what are the variables we are checking for independence then.

• Thank you that was very helpful! And you're right I completely missed the previous's answer point about product of the support. Now if I want to check if the joint factors as a product of the marginals, I would have to compute the marginal first by integrating out all $n-1$ variables over $(0,\sqrt{R})$ correct? This process seems unnecessarily tedious and I am wondering if there's a quicker way, maybe taking advantage some property of the density that I do not seem to be able to see – chibro2 Dec 16 '14 at 21:26
• @leonbloy Thanks... – Did Dec 16 '14 at 22:05
• I meant to say $(0,R)$. Either way a pattern emerges when I repeatedly integrate $A\int_0^R (x_1^2 + \ldots + x_n^2) dx_j$ so it seems to me that it suffice to argue the product of $f_{X_j}$'s result in a quadratic that does not resemble the joint, unless trivially A or R = 0. But if there's an even better way please share! – chibro2 Dec 16 '14 at 22:40
• @chibro2 If you need to integrate over a non-rectangular region, doesn't that imply that the support is not an hyperectangle, and hence you already know that they are not independent? Otherwise, if the joint density can be expressed as as simple formula, then usually one tries to factorize it in its variables. It's not usually difficult. Hard to say more, without a concrete example. – leonbloy Dec 17 '14 at 0:06
• Yup the second part of what you said is exactly what I was asking earlier, that if the density obviously cannot be factored into a product, then it must be independent? Both you and Did did a really great job explaining how to look at the problem and see the answer. My holdup is that as a novice, I cannot distinguish the difference between what's a rigorous statement for all readers vs. an observation made by one expert that's sufficient to convince other experts. – chibro2 Dec 17 '14 at 0:17