# Difference of Chi-squared Variables

Is this procedure correct? Considering that $$X$$ is a chi-square random variable with $$r$$ degrees of freedom?

$$E(e^{-tX}) =E \left(\frac{1}{e^{tX}}\right)=\frac{1}{E(e^{tX})} =\frac{1}{(1-2t)^{-r/2}}$$

The following demonstration, despite reaching a true conclusion, is not entirely correct: Let $$X_1$$ and $$X_2$$ be a chi-squared random variable with $$r_1$$ and $$r_2$$ degrees of freedom respectively, the $$Y=X_1-X_2$$ is also a chi-squared random variable with $$(r_1-r_2)$$ degrees of freedom provided that $$r_1>r_2$$:

$$M_Y(t)=\large{E(e^{tY})=E(e^{t(X_1-X_2)})=\frac{E(e^{tX_1})}{E(e^{-tX_2})}}$$ $$=\large{(1-2t)^{-\frac{r_1}{2}}(1-2t)^{\frac{r_2}{2}}=(1-2t)^{-\frac{(r_1-r_2)}{2}}}$$

therefore, $$Y$$ is chi-squared with $$r_1-r_2$$ degrees of freedom.

• I´ve made the font size a little bigger. You can rollback my edit if you think it is unnecessary. Maybe I need some glasses ;) – callculus Mar 5 '20 at 1:15

It appears that you've made a few errors.

Is this procedure correct? Considering that $$X$$ is a chi-square random variable with $$r$$ degrees of freedom?

$$E(e^{-tX}) =E \left(\frac{1}{e^{tX}}\right) \color{blue}{\fbox{=}}\frac{1}{E(e^{tX})} =\frac{1}{(1-2t)^{-r/2}}$$

The middle equality does not hold. In general, it is not true that $$\mathbb E(f(X)) = f(\mathbb E(X))$$; you seem to be applying that here with $$f(x) = 1/x$$.

The following demonstration, despite reaching a true conclusion, is not entirely correct: Let $$X_1$$ and $$X_2$$ be a chi-squared random variable with $$r_1$$ and $$r_2$$ degrees of freedom respectively, the $$Y=X_1-X_2$$ is also a chi-squared random variable with $$(r_1-r_2)$$ degrees of freedom provided that $$r_1>r_2$$:

I'll interject to agree with José Pliego -- the conclusion is not true unless $$X_1, X_2$$ are dependent upon one another in some incredibly specific way (i.e. the exact way that makes the conclusion you want to hold). In particular, the conclusion is certainly false if the two are independent, because this would result in a a positive probability that the difference would be negative, which is something $$\chi^2$$ variables cannot do.

If you wanted this to be true, you'd have to state it as: "Suppose $$X_1, X_2$$ are $$\chi^2$$ variables with $$r_1, r_2$$ df ($$r_1 > r_2$$) that have the property that $$X_1 - X_2$$ is a $$\chi^2$$ variable with $$r_1 - r_2$$ df. Then..." I don't know of an "organic" way to get that property to happen unless you essentially define it into existence, such as defining $$Y \sim \chi^2(r_1 - r_2)$$ and $$X_2 \sim \chi^2(r_2)$$ to be independent and setting $$X_1 = Y + X_2$$. If you're "starting" with the variables $$X_1$$ and $$X_2$$, it would be unusual for their difference to have the property you're claiming.

$$M_Y(t)=\large{E(e^{tY})=E(e^{t(X_1-X_2)})\color{blue}{\fbox{=}}\frac{E(e^{tX_1})}{E(e^{-tX_2})}}$$

I don't follow why that last equality above is justified; it looks like an algebra error to me.

$$=\large{(1-2t)^{-\frac{r_1}{2}}(1-2t)^{\frac{r_2}{2}}=(1-2t)^{-\frac{(r_1-r_2)}{2}}}$$

therefore, $$Y$$ is chi-squared with $$r_1-r_2$$ degrees of freedom.

The procedure has some issues, but the fundamental problem appears to be that you're attempting to prove a result that is generally false.

Like I mentioned in the deleted post, the thing you want to prove is not true. $$X_1$$ and $$X_2$$ have support on $$\mathbb{R^+}$$, but $$Y$$ can take negative values if $$X_2>X_1$$, so it cannot be a chi-square.