73
$\begingroup$

I'm trying to solve the following problem:

Let $X$ have the CDF $F(x) = 1 - x^{-\alpha}, x\ge1$.
Find $E(X)$ for those values of $\alpha$ for which $E(X)$ exists.

How can I determine which values of $\alpha$ exist? What do I do with the CDF?

There are formulas for finding the expected value when you have a frequency function or density function. Wikipedia says the CDF of $X$ can be defined in terms of the probability density function $f$ as follows:

$$F(x) = \int_{-\infty}^x f(t)\,dt$$

This is as far as I got. Where do I go from here?

$\endgroup$
2
  • $\begingroup$ Note that the distribution $F(x) = 1 - x^{-\alpha}, x\ge1$ for $\alpha \in (0,2)$ is often said to have a fat tail. The distribution has a finite mean only for $\color{blue}{\alpha >1}$, as obtained in this answer, and finite variance only for $\alpha>2$; see also power law distributions. $\endgroup$
    – Amir
    Commented May 10 at 13:52
  • $\begingroup$ See math.stackexchange.com/a/2211416/91378 $\endgroup$
    – Avraham
    Commented May 10 at 18:44

7 Answers 7

30
$\begingroup$

Note that $F(1)=0$ in this case so the distribution has probability $0$ of being less than $1$, so $x \ge 1$, and you will also need $\alpha > 0$ for an increasing cdf.

If you have the cdf then you want the anti-integral or derivative which with a continuous distribution is like this:

$$f(x) = \frac{dF(x)}{dx}$$

and in reverse $F(x) = \int_{1}^x f(t)\,dt$ for $x \ge 1$.

Then to find the expectation you need to find

$$E[X] = \int_{1}^{\infty} x f(x)\,dx$$

providing that this exists. I will leave the calculus to you.

$\endgroup$
6
  • 3
    $\begingroup$ @henry - $F(1)=1-1^{-\alpha}=1-1=0$, so support can't be below 1 (as CDF is a non-decreasing function) $\endgroup$ Commented Apr 30, 2011 at 6:59
  • $\begingroup$ @probabilityislogic: You may be correct in terms of the book. I will change my response. $\endgroup$
    – Henry
    Commented Apr 30, 2011 at 9:49
  • $\begingroup$ Thanks for the response. What does f(x) represent? The probability density function? Is the derivative of the cdf always f(x)? $\endgroup$
    – styfle
    Commented Apr 30, 2011 at 20:23
  • 1
    $\begingroup$ $f(x)$ is indeed supposed to be the probability density function. If the cdf has a derivative then it is the density, though there are distributions (for example discrete) where the cdf does not have a derivative everywhere $\endgroup$
    – Henry
    Commented Apr 30, 2011 at 20:24
  • 1
    $\begingroup$ @styfle: If it exists then $E[X^2] = \int_{1}^{\infty} x^2 f(x)\,dx$, and similarly for the expectations of other functions of $x$. $\endgroup$
    – Henry
    Commented Apr 30, 2011 at 22:08
146
$\begingroup$

Usage of the density function is not necessary

Integrate 1 minus the CDF

When you have a random variable $X$ that has a support that is non-negative (that is, the variable has nonzero density/probability for only positive values), you can use the following property:

$$ E(X) = \int_0^\infty \left( 1 - F_X(x) \right) \,\mathrm{d}x $$

A similar property applies in the case of a discrete random variable.

Proof

Since $1 - F_X(x) = P(X\geq x) = \int_x^\infty f_X(t) \,\mathrm{d}t$,

$$ \int_0^\infty \left( 1 - F_X(x) \right) \,\mathrm{d}x = \int_0^\infty P(X\geq x) \,\mathrm{d}x = \int_0^\infty \int_x^\infty f_X(t) \,\mathrm{d}t \mathrm{d}x $$

Then change the order of integration:

$$ = \int_0^\infty \int_0^t f_X(t) \,\mathrm{d}x \mathrm{d}t = \int_0^\infty \left[xf_X(t)\right]_0^t \,\mathrm{d}t = \int_0^\infty t f_X(t) \,\mathrm{d}t $$

Recognizing that $t$ is a dummy variable, or taking the simple substitution $t=x$ and $\mathrm{d}t = \mathrm{d}x$,

$$ = \int_0^\infty x f_X(x) \,\mathrm{d}x = \mathrm{E}(X) $$

Attribution

I used the Formulas for special cases section of the Expected value article on Wikipedia to refresh my memory on the proof. That section also contains proofs for the discrete random variable case and also for the case that no density function exists.

$\endgroup$
6
  • 1
    $\begingroup$ +1 great result: the integral of the cdf is really simple, moreover, it is wise to avoid derivatives, whenever we can (they are not as well behaved as integrals ;)). Additional: using the cdf to calculate the variance see here math.stackexchange.com/questions/1415366/… $\endgroup$ Commented May 30, 2017 at 21:46
  • 4
    $\begingroup$ When you change the order of integration, how do you get the integration limits? $\endgroup$
    – Zaz
    Commented Oct 1, 2017 at 16:40
  • 1
    $\begingroup$ The standard proof does not assume that $X$ has a density. $\endgroup$
    – ae0709
    Commented Sep 27, 2018 at 23:19
  • 4
    $\begingroup$ @Zaz we set the integration limits so that the same part of (t, x) space is covered. The original constraints are x >0 and t > x. We can't have the outer limits depend on the inner variable, but we can define the same region as t > 0 and 0 < x < t. Good examples of this process here: mathinsight.org/… $\endgroup$ Commented Oct 7, 2019 at 21:16
  • $\begingroup$ how is that $\int_0^t f_X(t)\,\mathrm{d}x = xf_X(t)\Big|_0^t$? $\endgroup$
    – Kuo
    Commented Feb 23 at 4:53
61
$\begingroup$

The result extends to the $k$th moment of $X$ as well. Here is a graphical representation: enter image description here

$\endgroup$
2
  • 7
    $\begingroup$ an undervalued answer $\endgroup$
    – Kuo
    Commented Oct 8, 2023 at 18:35
  • 2
    $\begingroup$ I love this result. I would really appreciate a citation so that I can use it in some of my formal work. $\endgroup$
    – Galen
    Commented May 14 at 14:51
13
$\begingroup$

I think you actually mean $x\geq 1$, otherwise the CDF is vacuous, as $F(1)=1-1^{-\alpha}=1-1=0$.

What you "know" about CDFs is that they eventually approach zero as the argument $x$ decreases without bound and eventually approach one as $x \to \infty$. They are also non-decreasing, so this means $0\leq F(y)\leq F(x)\leq 1$ for all $y\leq x$.

So if we plug in the CDF we get:

$$0\leq 1-x^{-\alpha}\leq 1\implies 1\geq \frac{1}{x^{\alpha}}\geq 0\implies x^{\alpha}\geq 1 > 0\implies x\geq 1 \>.$$

From this we conclude that the support for $x$ is $x\geq 1$. Now we also require $\lim_{x\to\infty} F(x)=1$ which implies that $\alpha>0$

To work out what values the expectation exists, we require:

$$\newcommand{\rd}{\mathrm{d}}E(X)=\int_{1}^{\infty}x\frac{\rd F(x)}{\rd x}\rd x=\alpha\int_{1}^{\infty}x^{-\alpha} \rd x$$

And this last expression shows that for $E(X)$ to exist, we must have $-\alpha<-1$, which in turn implies $\alpha>1$. This can easily be extended to determine the values of $\alpha$ for which the $r$'th raw moment $E(X^{r})$ exists.

$\endgroup$
5
  • 2
    $\begingroup$ (+1) Particularly for the sharp-eyed recognition that the given support was incorrect. $\endgroup$
    – cardinal
    Commented Apr 30, 2011 at 14:00
  • $\begingroup$ Thanks for the response. I fixed the question. I meant to put x>=1. How did you know to first differentiate the cdf to get the density function? $\endgroup$
    – styfle
    Commented Apr 30, 2011 at 20:37
  • $\begingroup$ @styfle - because that's what a PDF is, whenever the CDF is continuous and differentiable. You can see this by looking at how you have defined your CDF. Differentiating an integral just gives you the integrand when the upper limit is the subject of the differentiation. $\endgroup$ Commented May 1, 2011 at 1:00
  • 1
    $\begingroup$ @styfle - the PDF can also be seen as the probability that a RV lies in an infinitesimal interval. $Pr(x<X<x+dx)=F(x+dx)-F(x)\to \frac{dF(x)}{dx}dx=f(x)dx$ as $dx\to 0$. This way holds more generally, even for discrete RV and RV without a density (the limit is just something other than a derivative) $\endgroup$ Commented May 1, 2011 at 1:04
  • $\begingroup$ +1 because this post actually answers the question! $\endgroup$
    – whuber
    Commented Mar 23, 2022 at 13:25
12
$\begingroup$

The Answer requiring change of order is unnecessarily ugly. Here's a more elegant 2 line proof.

$$\int udv = uv - \int vdu$$

Now take $du = dx$ and $v = 1- F(x)$

\begin{align} \int_{0}^{\infty} [ 1- F(x)] dx &= [x(1-F(x))]_{0}^{\infty} + \int_{0}^{\infty} x f(x)dx \\ &= 0 + \int_{0}^{\infty} x f(x)dx \\ &= \mathbb{E}[X] \qquad \blacksquare \end{align}

$\endgroup$
4
  • $\begingroup$ I think you mean to let du-dx so that u=x. $\endgroup$ Commented Aug 30, 2019 at 19:20
  • 2
    $\begingroup$ With your proof, we need to assume that $\lim _{x \rightarrow \infty} x(1 - F(x)) = 0$. Does it make sense to assume that for any continuous cdf F ? $\endgroup$
    – Eryna
    Commented Jun 11, 2023 at 8:42
  • $\begingroup$ @Eryna otherwise the expectation wouldn't exist i guess? $\endgroup$
    – DuttaA
    Commented Feb 29 at 19:30
  • $\begingroup$ It does not work for distributions with fat tails when $\alpha \in (0,1].$ You may see this MSE post for more details. $\endgroup$
    – Amir
    Commented May 10 at 11:59
0
$\begingroup$

In case when a conditional expectation using only CDF is needed, we can formulate two cases,

$\mathbb{E}\left(x|x\geq y\right)=y+\frac{\int_{y}^{\infty}\left(1-F(x)\right)dx}{\left(1-F(y)\right)}$

$\mathbb{E}\left(x|x\leq y\right)=y-\frac{\int_{-\infty}^{y}F(x)dx}{F(y)}$

The derivation leverages on previous post such that we first define following integral, $\int_{y}^{\infty} [ 1- F(x)] dx = [x(1-F(x)) ]_{y}^{\infty} + \int_{y}^{\infty} x f(x)dx$

$\int_{y}^{\infty} x f(x)dx=\mathbb{E}\left(x|x\geq y\right)(1-F(y))$

Then using this definition and some algebra we arrive at first result. The second result can be obtained in the same way.

$\endgroup$
2
  • $\begingroup$ The first formula is not fully correct. Although it holds when $F$ is continuous at $y,$ if it has a jump at $y$ then the amount of that jump needs to be subtracted from the denominator. $\endgroup$
    – whuber
    Commented Mar 22, 2022 at 18:53
  • 1
    $\begingroup$ Thank you very much @whuber for pointing that out. I solely, thought of a continuous one and did numerical experiments based on that. $\endgroup$ Commented Mar 22, 2022 at 23:55
0
$\begingroup$

Alternative derivation of $EX = \int_0^\infty \left(1-F_X(x)\right)\mathrm d x$ (for a positive r.v. $X$):

For any $x \ge 0$ one has that $x=\int_0^x 1 \mathrm dt = \int_0^\infty \mathbf I_{t\le x}\mathrm dt$, where $\mathbf I$ is the indicator function. Let $x=X$, take expectations on both sides, and use Fubini's theorem to exchange the integrals to obtain $EX = \int_0^\infty P(X\ge t)\mathrm dt$.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.