Obtaining an expression for empirical mean from empirical CDF definition This is my first post so I will try to be as clear and concise as possible. I am doing a course in statistics and we define the true mean of a random gaussian variable to be as follows:
$\mu$ = $\int_{R}xdF_{N(\mu, \sigma^2)}(x)$
As the Lesbesgue-Stieljes integral.
In the notes we defined the empirical CDF as follows:
${F_{n}}$ = $\frac{1}{n}\sum_{i=1}^{n}\mathbb{1}_{\{X_{i} \le x \}}$
We then proceed to show that:
$\mu$ = $\int_{R}xd(\frac{1}{n}\sum_{i=1}^{n}\mathbb{1}_{\{X_{i} \le x \}})$ = $\frac{1}{n}\sum_{i=1}^{n}X_{i}$
I am aware that this makes perfect sense as an empirical estimator for the mean, however I am quite confused as to how about deducing this from the integral. We are integrating with respect to a differential of the ECDF, and deduce that the expression is $X_{i}$?
I am struggling to even deduce what the result of $\int_{R}\mathbb{1}_{\{Xi \le x\}}$ evaluates to.
Any help on the above would be much appreciated.
 A: This is hinted at in Choosing the number of bootstrap resamples  but not written out there. First, look at the definition of Stieltjes integral, from Wikipedia, the integral
$$ \int_a^b g(x)\; dF(x) $$ is defined wia limits of approximants of the form, for partitions $a=x_0<x_1\dotsm <x_n=b$,
$$ \sum_{i=0}^{n-1} g(x_i)\left[ F(x_{i+1}) - F(x_i)\right] $$
If you integrate with respect to a unit step function, say $\int g(x) \;dI\{x\le z\}$ that differencing can only be non-zero with $x_{i}< z \le x_{i+1}$ so the integral must be $g(z)$, the value of the integrand at the step. Also note that by the above definition we have
$$ \int g(x)\;dF(x) + \int g(x) \; dG(x) =\int g(x)\; d\{(F+G)(x)\} $$
and using this with the empirical distribution function
$$ \frac{1}{n}\sum_{i=1}^{n}\mathbb{1}_{\{X_{i} \le x \}} $$ and using this
$$
\int x \;d\hat{F}_n(x) =\\
\int x \;d \bigl\{ \frac{1}{n}\sum_{i=1}^{n}\mathbb{1}_{\{X_{i} \le x \}} \bigr\}=\\
\frac1n \sum_{i=1}^{n} \int x \; d\mathbb{1}_{\{X_{i} \le x \}}=\frac1n \sum_{i=1}^{n} x_i =
\bar{x}
$$
And yes, the typical calculus course will not show this kind of integrals ...
