# $X_{1},X_{2},X_{3}\overset{i.i.d.}{\sim}N(0,1)$, find m.g.f. of $Y=X_{1}X_{2}+X_{1}X_{3}+X_{2}X_{3}$

I tried this

$$X_{1}X_{2}+X_{1}X_{3}+X_{2}X_{3}=X_{1}(X_{2}+X_{3})+\frac{1}{4}(X_{2}+X_{3})^{2}-\frac{1}{4}(X_{2}-X_{3})^{2}$$

$$U=X_{2}+X_{3}\sim N(0,2)$$

$$\psi_{X_{1}(X_{2}+X_{3})}(t)=\psi_{X_{1}U}(t)=\frac{1}{\sqrt{2}\cdot 2\pi}\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}e^{x_{1}ut}e^{-\frac{1}{2}(x_{1}^{2}+\frac{u^{2}}{2})}\, dx_{1}\, du$$

$$=\frac{1}{\sqrt{2}\cdot 2\pi}\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}e^{-\frac{1}{4}(2(x_{1}-ut)^{2}-2u^{2}t^{2}+u^{2})}\, dx_{1}\, du$$

$$V=(x_{1}-ut)\qquad dv=dx_{1}\\ =\frac{1}{\sqrt{2}\cdot 2\pi}\int_{-\infty}^{\infty}e^{-\frac{1}{4}(1-2t^{2})u^{2}}\int_{-\infty}^{\infty}e^{-\frac{1}{2}v^{2}}\, dv\, du\\$$

$$=\frac{1}{\sqrt{\pi}\cdot 2}\int_{-\infty}^{\infty}e^{-\frac{1}{4}(1-2t^{2})u^{2}}\, du$$

$$w=\sqrt{\frac{1-2t^{2}}{2}}u,\qquad \sqrt{\frac{2}{1-2t^{2}}}\, dw=du\\ \psi_{XU}(t)=\frac{1}{\sqrt{1-2t^{2}}}\int_{-\infty}^{\infty}\frac{1}{\sqrt{2\pi}}e^{-\frac{1}{2}w^{2}}\, dw=\frac{1}{\sqrt{1-2t^{2}}}$$

$$Z=X_{2}-X_{3}\sim N(0,2)$$

$$\psi_{\frac{1}{4}(X_{1}+X_{2})^{2}}(t)=\frac{1}{\sqrt{4\pi}}\int_{-\infty}^{\infty}e^{\frac{1}{4}z^{2}t}e^{-\frac{1}{4}z^{2}}\, dz$$

$$=\frac{1}{\sqrt{4\pi}}\int_{-\infty}^{\infty}e^{-\frac{1}{4}(z^{2}-z^{2}t)}\, dz=\frac{1}{\sqrt{4\pi}}\int_{-\infty}^{\infty}e^{-\frac{1}{4}(1-t)z^{2}}\, dz\\$$

$$v=\sqrt{1-t}z,\quad \frac{1}{\sqrt{1-t}}\, dv=dz\\ \psi_{\frac{1}{4}(X_{1}+X_{2})^{2}}(t)=\frac{1}{\sqrt{1-t}}\int_{-\infty}^{\infty}\frac{1}{\sqrt{4\pi}}e^{-\frac{1}{4}z^{2}}\,dz=\frac{1}{\sqrt{1-t}}$$

$$\psi_{\frac{1}{4}(X_{1}+X_{2})^{2}-\frac{1}{4}(X_{2}-X_{3})^{2}}(t)=\frac{1}{\sqrt{1-t}}\cdot \frac{1}{\sqrt{1-(-t)}}=\frac{1}{\sqrt{(1-t)(1+t)}}=\frac{1}{\sqrt{1-t^{2}}}$$

$$\psi_{X_{1}(X_{2}+X_{3})+\frac{1}{4}(X_{2}+X_{3})^{2}-\frac{1}{4}(X_{2}-X_{3})^{2}}(t)=\frac{1}{\sqrt{1-2t^{2}}}\cdot \frac{1}{\sqrt{1-t^{2}}}=\frac{1}{\sqrt{1-2t^{2}}\sqrt{1-t^{2}}}$$

But I have learned that this is incorrect. What mistakes did I make?

• See math.stackexchange.com/q/3134582/321264 for the mgf (Check the answers though for possible errors). The exact distribution is discussed at math.stackexchange.com/q/3700360/321264. This may also help: stats.stackexchange.com/a/318908/119261. Commented Jul 23, 2020 at 6:44
• One approach in the spirit of your attempt is to write $$X_1X_2+X_2X_3+X_3X_1=\frac{1}{3}(X_1+X_2+X_3)^2-\frac{1}{12}(2X_1-X_2-X_3)^2-\frac{1}{4}(X_2-X_3)^2.$$This works because the three squared quantities have uncorrelated, and therefore independent, Normal distributions.
– whuber
Commented Jul 23, 2020 at 15:21
• Amazing formatting Commented Jul 23, 2020 at 17:09

In this situation it helps to keep the computations a little abstract, because that exposes their essential simplicity. Let, then, $$Q$$ be the homogeneous quadratic form $$Q(\mathbf{x}) = x_1 x_2 + x_2 x_3 + x_3 x_1 = \frac{1}{2}\mathbf{x}^\prime\pmatrix{0&1&1\\1&0&1\\1&1&0}\mathbf{x} = \frac{1}{2}\mathbf{x}^\prime\mathbb{Q}\mathbf{x}.$$

By definition the mgf of any function $$f$$ is $$E[\exp(tf(X))],$$ which for this form is

$$E\left[\exp\left(t Q(X)\right)\right] = C \int\cdots\int \exp\left(t Q(\mathbf{x})\right)\exp\left(-\frac{1}{2} \mathbf{x}^\prime\mathbf{x}\right)\,\mathrm{d}\mathbf{x}.$$

The product of the exponentials is, of course, the exponential of the sum of the arguments, so let's focus on that sum, still keeping the details of $$Q$$ unexposed:

$$t Q(\mathbf{x})-\frac{1}{2} \mathbf{x}^\prime\mathbf{x} = -\frac{1}{2}\mathbf{x}^\prime\left(\mathbb{I} - t\mathbb{Q}\right)\mathbf{x}.$$

It is immediate, just by inspection, that this gives an integrand proportional to the multivariate density of a Normal distribution of zero mean and covariance $$\left(\mathbb{I} - t\mathbb{Q}\right)^{-1}.$$ The constant of proportionality is the square root of the determinant of the covariance. Thus (at least for $$|t|$$ sufficiently small),

$$E\left[\exp\left(t Q(X)\right)\right] = \left|\mathbb{I} - t\mathbb{Q}\right|^{-1/2}.$$

As a quick check, when $$\mathbb{Q}=2\mathbb{I}$$ represents the sum of squares $$X_1^2+X_2^2+X_3^2,$$ we should obtain the mgf for that sum of squares, which defines the $$\chi^2(3)$$ distribution. Indeed, $$\left|\mathbb{I} - t(2\mathbb{I})\right|^{-1/2} = \left|(1-2t)\mathbb{I}\right|^{-1/2} = ((1-2t)^3|\mathbb{I}|)^{-1/2} = (1-2t)^{-3/2}$$ is the correct result according to https://en.wikipedia.org/wiki/Chi-square_distribution.

The answer for the particular form $$Q$$ in the question is

\begin{aligned} \left|\mathbb{I} - t\mathbb{Q}\right|^{-1/2} &= \left|\pmatrix{1&-t&-t\\-t&1&-t\\-t&-t&1}\right|^{-1/2} \\ &= \left(1 - 3t^2 - 2t^3\right)^{-1/2} \\ &= (1-2t)^{-1/2}(1+t)^{-2/2}. \end{aligned}

At https://stats.stackexchange.com/a/318908/919, Kjetil Halvorsen diagonalizes $$Q$$ to generalize this calculation to inhomogeneous quadratic forms (giving non-central chi-squared distributions). I have offered the foregoing analysis because it is complete and more elementary (not requiring any matrix decomposition), thereby perhaps helping you to find where your original work went awry.

The post by StubbornAtom at https://stats.stackexchange.com/a/478682/919 presents the same generalization in a different way.

In your first line you write the expression as the sum of three quadratic forms. You then multiply the three mgfs. But, this is only possible if the variables (quadratic forms) are independent. Quadratic forms are independent if and only if the product of their matrices is the zero matrix. This is not true of the first and second quadratic forms. However, it is true of the first and third and it is true of the second and third. That is why you could multiply two of the mgfs and get a correct result for those.