I'd like to calculate $E[\exp{\left(-\frac{1}{2}X\right)}]$ where $X$ is Gaussian distribtuted. And i know that the characteristic function is given by: $E[\exp\left(ikX\right)]=G(k)=\exp\left(i\mu k-\frac{1}{2}\sigma^2k^2\right)$ and thought: Well, I can just set k=i/2 and get my solution. The thing is, that $k$ belongs to the real numbers (per definition).
Another approach is by the moment-generating function, where $E[\exp\left(kX\right)]=M(k)=\exp\left(\mu k+\frac{1}{2}\sigma^2k^2\right)$.
I get the same result...how can that be?
Thanks already!
The two functions are clearly closely related.
The characteristic function is the Fourier Transform of the probability density function of a random variable that has a pdf. For any such random variable, the characteristic function is guaranteed to exist when treated as a function of a real valued argument.
That's where you get the idea that $k$ needs to be a real value. It is that if $k$ is real, then the integral will converge.
Now, it might also exist when treated as a function of a complex argument, though there's just no guaranteed that it will. In particular it may exist when treated as a function of a purely imaginary argument — which maps to the moment generating function.
A moment generating function is not guaranteed to always exist for random variables with pdf.
But in this case, one does exist for a Gaussian Distribution. Which is why you may use it.