9

Suppose we have random variable $X_1$ distributed as $U[0,1]$ and $X_2$ distributed as $U[0,X_1]$, where $U[a,b]$ means uniform distribution in interval $[a,b]$.

I was able to compute joint pdf of $(X_1,X_2)$ and marginal pdf of $X_1$.

$$ p(x_1,x_2) = \frac{1}{x_1}, \text{ for }\quad 0\le x_1\le 1, \quad 0\le x_2 \le x_1,$$

$$ p(x_1)= 1, \text{ for } \quad 0\le x_1\le 1.$$

However while computing marginal pdf of $X_2$ I am encountering limits problem. The resultant of integral through marginal of $X_2$ is $\log(X_1)$ and the limits are from 0 to 1. As $\log(X_1)$ is not defined for $X_1=0$, I am facing a difficulty.

Am I wrong somwhere? Thanks.

Andre Silva
  • 3,070
  • 5
  • 28
  • 55

2 Answers2

3

In the "marginalisation" integral, the lower limit for $x_1$ is not $0$ but $x_2$ (because of the $0<x_2<x_1$ condition).

So the integral should be:

$$p(x_2)=\int p(x_1,x_2) dx_1=\int \frac{I(0\leq x_2\leq x_1\leq 1)}{x_1} dx_1=\int_{x_2}^{1} \frac{dx_1}{x_1}=log\big(\frac{1}{x_2}\big)$$

You have stumbled across, what I think is one of the hardest parts of statistical integrals - determining the limits of integration.

NOTE: This is consistent with Henry's answer, mine is the PDF, and his is the CDF. Differentiating his answer gives you mine, which shows we are both right.

probabilityislogic
  • 22,555
  • 4
  • 76
  • 97
1

You should not have $X_1$ in the marginal distribution for $X_2$

I would expect you to get $P(X_2 \le x_2) = x_2 (1-\log(x_2))$ and so the derivative gives a marginal density of $-\log(x_2)$.

This comes from $P(X_2 \le x_2 |X_1=x_1) = 1$ if $x_1 \le x_2$, and $ P(X_2 \le x_2 |X_1=x_1) = \frac{x_2}{x_1}$ if $x_2 \le x_1$ so the integral is $$P(X_2 \le x_2) = \int_{x_1=0}^{x_2} dx_1 + \int_{x_1=x_2}^{1} \frac{x_2}{x_1} dx_1$$ $$ = \left[ x_1 \right]_{x_1=0}^{x_1=x_2} + \left[x_2 \log(x_1)\right]_{x_1=x_2}^{x_1=1} $$ $$ = x_2 - 0 +x_2 \log(1) - x_2 \log(x_2) $$ $$ = x_2 (1-\log(x_2))$$

Henry
  • 30,848
  • 1
  • 63
  • 107
  • Henry: log(X1) is after integrating (but before substituting limits) for marginal of X2. Your P(X2) is wrong. I believe you are integrating log(X1) that I said which we get after integration itself. –  Feb 25 '11 at 21:23
  • @Harpreet: testing using R, it is clear to me that $P(X_2 \le x_2) = x_2 (1-\log(x_2))$ is correct for $0 < x_2 < 1$. I have also expanded the integrals to show how this is obtained. So which $P(X_2)$ do you think is wrong? – Henry Feb 25 '11 at 23:16
  • P(X2)=int(1/X1). –  Feb 25 '11 at 23:21
  • Thanks Henry. But I think what you are doing is correct, however marginal of X2 will be $ln(X_1)$ without limits. –  Feb 25 '11 at 23:26
  • $X_1 \le 1$ so $\ln(x_1) \le 0$, which means it cannot be a density or distribution function. And I still think $X_1$ should not appear in the marginal distribution of $X_2$. http://en.wikipedia.org/wiki/Marginal_distribution says the same thing in "The distribution of the marginal variables (the marginal distribution) is obtained by marginalizing over the distribution of the variables being discarded, and the discarded variables are said to have been marginalized out." – Henry Feb 26 '11 at 01:54
  • Henry: I am sorry about that. I didn't look at LHS to see that its a CDF. Thanks for your answer and I regret that I chose the answer before I realized it (I realized through the other guy's note). –  Feb 28 '11 at 01:19