Hi Maths Forum. Suppose that X is N ( μ , 1) and Y = X^2. Find the MGF of Y.
Can anybody help please with workings?
Thanks.
The same problem appeared in a recent thread, in a slightly more complicated way (more parameters, hence heavier computation), and I devised a computation-free way in my second post (after having spent some time on the direct way in the first one): when $\displaystyle t>0$,
$\displaystyle \int e^{-t x^2}e^{-\frac{1}{2}(x-\mu)^2}\frac{dx}{\sqrt{2\pi}}\frac{\sqrt{t}}{\sqrt {\pi}}$
is the convolution product of the pdf's of a $\displaystyle N(0,\frac{1}{2t})$ and a $\displaystyle N(0,1)$, evaluated at the point $\displaystyle \mu$, thus it is the pdf of a $\displaystyle N(0,1+\frac{1}{2t})$ evaluated at the point $\displaystyle \mu$ (cf. explanation in the quoted post if necessary):
$\displaystyle \int e^{-t x^2}e^{-\frac{1}{2}(x-\mu)^2}\frac{dx}{\sqrt{2\pi}}\frac{\sqrt{t}}{\sqrt {\pi}} = \frac{1}{\sqrt{2\pi(1+\frac{1}{2t})}}e^{-\frac{\mu^2}{2(1+\frac{1}{2t})}}$.
Thus, $\displaystyle E[e^{-tY}]=\int e^{-t x^2}e^{-\frac{1}{2}(x-\mu)^2}\frac{dx}{\sqrt{2\pi}} = \frac{1}{\sqrt{2t+1}}e^{-\frac{t \mu^2}{2t+1}}$.
If you want $\displaystyle E[e^{tY}]$ for positive $\displaystyle t$ (in fact, for $\displaystyle 0\leq t<2$ otherwise it diverges), this method doesn't work directly. But you can use analytic continuation: $\displaystyle t\mapsto E[e^{-t Y}]$ is analytic on $\displaystyle (-2,+\infty)$ (using the integral formula,...), and it coincides with the above function when $\displaystyle t> 0$, therefore the coincidence extends to $\displaystyle (-2,0]$, i.e. for $\displaystyle t\geq -2$. This gives:
$\displaystyle E[e^{tY}]= \frac{1}{\sqrt{1-2t}}e^{\frac{t \mu^2}{1-2t}}$
for any $\displaystyle t<2$.
Thank you to Moo and Laurent. Your contributions to the Maths web forum are invaluable. It is amazing how you can code and solve the sums at the same time!
I realised that from the solutions there was a factor in the distributions. I used this to solve Q 2B.
Can you guys help also with your thoughts/solutions with Q 1B?
PK.
Laurent's method is more skilled
For Q 1.B, just remember that the mgf of the sum of independent rv's is the product of the mgf's.
Since the $\displaystyle X_i$ are independent, the $\displaystyle X_i^2$ are independent too, and the result should follow easily.