본문 바로가기

Enginius/Machine Learning

Expectation of X^n; X~N(u,sigma^2)

When X~N(u,sigma^2)
then Expectation of X^n can be solved easily using MGF(Moment Generating Function)

OrderRaw momentCentral momentCumulant
1 μ 0 μ
2 μ2 + σ2 σ 2 σ 2
3 μ3 + 3μσ2 0 0
4 μ4 + 6μ2σ2 + 3σ4 3σ 4 0
5 μ5 + 10μ3σ2 + 15μσ4 0 0
6 μ6 + 15μ4σ2 + 45μ2σ4 + 15σ6 15σ 6 0
7 μ7 + 21μ5σ2 + 105μ3σ4 + 105μσ6 0 0
8 μ8 + 28μ6σ2 + 210μ4σ4 + 420μ2σ6 + 105σ8 105σ 8 0
 
일반적인 경우의 MGF는 다음과 같다. 

 If X has a continuous probability density function ƒ(x), then MX(−t) is the two-sided Laplace transform of ƒ(x).


\begin{align}
M_X(t) & = \int_{-\infty}^\infty e^{tx} f(x)\,dx \\
& = \int_{-\infty}^\infty \left( 1+ tx + \frac{t^2x^2}{2!} + \cdots\right) f(x)\,dx \\
& = 1 + tm_1 + \frac{t^2m_2}{2!} +\cdots,
\end{align}
where mi is the ith moment. 

여러 분포 함수들의 MGF 는 다음과 같다.  
DistributionMoment-generating function MX(t)Characteristic function φ(t)
Bernoulli \, P(X=1)=p   \, 1-p+pe^t   \, 1-p+pe^{it}
Geometric (1 - p)^{k-1}\,p\!   \frac{pe^t}{1-(1-p) e^t}\!,
for  t<-\ln(1-p)\!
  \frac{pe^{it}}{1-(1-p)\,e^{it}}\!
Binomial B(n, p)   \, (1-p+pe^t)^n   \, (1-p+pe^{it})^n
Poisson Pois(λ)   \, e^{\lambda(e^t-1)}   \, e^{\lambda(e^{it}-1)}
Uniform U(a, b)   \, \frac{e^{tb} - e^{ta}}{t(b-a)}   \, \frac{e^{itb} - e^{ita}}{it(b-a)}
Normal N(μ, σ2)   \, e^{t\mu + \frac{1}{2}\sigma^2t^2}   \, e^{it\mu - \frac{1}{2}\sigma^2t^2}
Chi-square χ2k   \, (1 - 2t)^{-k/2}   \, (1 - 2it)^{-k/2}
Gamma Γ(k, θ)   \, (1 - t\theta)^{-k}   \, (1 - it\theta)^{-k}
Exponential Exp(λ)   \, (1 - t\lambda^{1})^{-1}   \, (1 - it\lambda^{1})^{-1}
Multivariate normal N(μΣ)   \, e^{t^\mathrm{T} \mu + \frac{1}{2} t^\mathrm{T} \Sigma t}   \, e^{i t^\mathrm{T} \mu - \frac{1}{2} t^\mathrm{T} \Sigma t}
Degenerate δa   \, e^{ta}   \, e^{ita}
Laplace L(μ, b)   \, \frac{e^{t\mu}}{1 - b^2t^2}   \, \frac{e^{it\mu}}{1 + b^2t^2}
Cauchy Cauchy(μ, θ) not defined   \, e^{it\mu -\theta|t|}
Negative Binomial NB(r, p)   \, \frac{(1-p)^r}{(1-pe^t)^r}   \, \frac{(1-p)^r}{(1-pe^{it})^r}