1
$\begingroup$

I am trying to compute the marginal pdf of transformed standard normals. I'm not sure if I have followed the method correctly. Any help would be most appreciated.

Let $X_1, X_2 \sim \mathcal{N}(0,1)$. And let $Y_1 := X_1^2 + X_2^2$ and $Y_2 := X_2$.

$$\sqrt{Y_1 - Y_2^2} = X_1 \qquad \text{ and } \qquad Y_2 = X_2 $$ $$\implies J = \left | \begin{matrix} \frac{1}{2}(Y_1 - Y_2^2)^{-1/2} & -Y_2(Y_1-Y_2^2)^{-1/2} \\ 0 & 1 \end{matrix} \right | = (Y_1-Y_2^2)^{-1/2} - 0 $$ $$= \frac{1}{\sqrt{(Y_1-Y_2^2)}}$$

$$\text{So, } \, \, f_{X_1,X_2}(x_1,x_2) = \left(\frac{1}{\sqrt{2 \pi}}\right)^2 e^{-X_1^2/2}e^{-X_2^2/2} \, = \, \frac{1}{2 \pi} e^{-(X_1^2 + X_2^2)/2} =|J|f_{X_1,X_2}(w_1(X_1), w_2(X_2)) $$ $$\implies f_{Y_1, Y_2}(y_1,y_2) = \begin{cases} \frac{1}{2 \pi \sqrt{(Y_1-Y_2^2)}} e^{-Y_1/2}& \text{ for } -\sqrt{Y_1} < Y_2 < \sqrt{Y_1} \text{ and } 0 < Y_1 < \infty\\ 0 & \, \, \text{ elsewhere}\end{cases} $$

Is this the correct transformed joint pdf, or have I made a mistake somewhere?

$$\text{Now, } \, \, f_{Y_1}(y_1) =C \int_{-\sqrt{y_1} }^{\sqrt{y_1}} \frac{B}{\sqrt{1 - B^2 y_2^2}} \,dy_2 = C \sin^{-1}\left ( \frac{y_2}{\sqrt{y_1}}\right) \Bigr|_{-\sqrt{y_1}}^{\sqrt{y_1}} = C\left( \frac{\pi}{2} - \left( -\frac{\pi}{2}\right) \right) = C\pi$$ $$\text{Since, } \, \, y_2 := B^{-1}\sin{\theta} \implies \, dy_2 = B^{-1}\cos{\theta}\, d\theta$$

$$\text{And } \, \, \frac{B}{\sqrt{1 - B^2 y_2^2}} \, dy_2 = \frac{B}{B\sqrt{\cos^2{\theta}} }\cos{\theta}\, d\theta = \, d\theta $$

$$\therefore \qquad f_{Y_1}(y_1) =\frac{1}{2} e^{-y_1/2} $$ So, $Y_1 \sim \chi^2(2)$.

$\endgroup$
4
  • 2
    $\begingroup$ The definition of a $\chi^2(d)$ distribution is that it's the one followed by the sum of squares of $d$ independent standard Normals. $\endgroup$
    – whuber
    Feb 21, 2021 at 23:05
  • $\begingroup$ I'm aware that a sum of squares for $d$ i.i.d. normals will be a $\chi^2(d)$ distribution. I guess I'm just not sure about the transformation steps. Like should I be picking up an extra $1/2$ somewhere or doing something extra with the Jacobian since we're going from a distribution over $\mathbb{R}$ to $\mathbb{R}^{+}$? $\endgroup$ Feb 21, 2021 at 23:52
  • 1
    $\begingroup$ If you made such a mistake, it ought to show up in the final check: does your $f_{Y_1}$ integrate to unity? $\endgroup$
    – whuber
    Feb 22, 2021 at 0:09
  • $\begingroup$ Fair point! Thanks. $\endgroup$ Feb 22, 2021 at 0:12

1 Answer 1

1
$\begingroup$

Comment. A brief check with a simulation in R: With a sample of size one million the mean and variance of the sample should match the mean and variance of the chi-squared distribution with degrees of freedom $\nu = 2$ to one or two decimal places.

set.seed(2021)
x1 = rnorm(10^6);  x2 = rnorm(10^6)
y1 = x1^2 + x2^2
mean(y1);  var(y1)
[1] 2.002323   # aprx 2, consistent with CHISQ(2) mean
[1] 4.022933   # aprx 4, consistent with CHISQ(2) variance

A histogram of a sample of a million seems consistent with the density function (orange curve) of $\mathsf{Chisq}(\nu = 2).$

hdr = "Simulated Values of CHISQ(df = 2)"
hist(y1, prob=T, br=30, col="skyblue2", main=hdr)
 curve(dchisq(x, 2), add=T, lwd=2, col="orange")

enter image description here

$\endgroup$
4
  • $\begingroup$ I think the principal question here concerns the joint distribution: see the comments to the question. $\endgroup$
    – whuber
    Feb 22, 2021 at 14:38
  • $\begingroup$ Granted, but $Y_2=X_2,$ so it seemed worthwhile to illustrate that $Y_1$ is chi-squared, as intended. One more indication OP's work is OK. $\endgroup$
    – BruceET
    Feb 23, 2021 at 8:25
  • $\begingroup$ I think that issue had been settled in the comments. $\endgroup$
    – whuber
    Feb 23, 2021 at 13:08
  • 1
    $\begingroup$ I was initially hoping for confirmation of my derivation. But, it is helpful to see a computational check as well. Thanks for the R code snippets and to you both for your help in general. $\endgroup$ Feb 23, 2021 at 22:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.