# Expression for $n$-th moment

I stumbled upon an expression in an article of statistics for an $n$-th moment with $X$ being a random variable over $[0, \infty)$.

$$\mathbb{E} X^{n} = \int^{\infty}_{0} nz^{n-1}\; \text{Pr}(X > z) \; \text{dz}$$

Could someone enlighten me on why the above is true? It indeed works for the exponential distribution.

-
If you are familiar with the formula $$E[Y] = \int_0^{\infty} P\{Y > y\}\,\mathrm dy$$ for a nonnegative random variable, set $Y = X^n$ and do a change of variable $z = y^{1/n}$ in $$E[Y] = \int_0^{\infty} P\{Y > y\}\,\mathrm dy = \int_0^{\infty} P\{X^n > y\}\,\mathrm dy = \int_0^{\infty} P\{X > y^{1/n}\}\,\mathrm dy.$$ – Dilip Sarwate Jun 14 '12 at 11:45
Thank you! Knowing the formula surely helps! – johnny Jun 14 '12 at 12:14
You are welcome. For the intuition behind the formula as well as a formal proof via Tonelli/Fubini as you asked of @StefanHansen, see the answers to Intuition behind using complementary CDF to compute expectation for nonnegative random variables – Dilip Sarwate Jun 14 '12 at 12:30
The article I'm reading is treating a continuously distributed random variable, so that's probably why they won't make a difference. But your point is of course very valid. – johnny Jun 14 '12 at 12:42
The functions $P(X>z)$ and $P(X\geq z)$ can only differ at a countable set of $z$ values, and so it doesn't matter which of these you integrate. – Byron Schmuland Jun 14 '12 at 13:12

First, use Tonelli's theorem to conclude that (write the probability as an integral and interchange the two integrals) $$E[X^n]=\int_0^\infty P\left(X^n> z\right)\, \mathrm{d} z.$$ Now write $P\left(X^n> z\right)=P\big(X> z^{1/n}\big)$ and use change of variables with $t=z^{1/n}$.