# A calculation involving a uniform random variable quantile

THE PROBLEM:

Let $U$ be a uniform distribution and $U_{n}$ be its nth empirical distribution. Suppose $t\in (0,1)$ and $n\in \mathbb{N}$ are constants. What's the explicit expression to $$E\{U_{n}^{-}(t) - t\}^{2}?$$ THE CONTEXT:

The generalized inverse of distribution function $F$, or quantil function, is defined by $$F^{-}(t) = \inf\{x\in \mathbb{R}; F(x)\geq t\}.$$ Let $X_{1},\ldots, X_{n}$ be independent identically distributed random variables, defined in some $(\Omega, \mathcal{F},P)$, distributed with $F$. This collection can be treated like a sample random of $F$. The empirical distribution function of the random sample $X_{1},\ldots, X_{n}$ is defined by $$F_{n}(t,\omega) = \frac{\displaystyle{\sum_{i=1}^{n}I_{(X_{i}(\omega)\leq t)}}}{n}.$$ When the parameter $t$ is constant, the above expression represents a random variable. Indeed, we can use the symbol $F_{n}(t)$ to denote such random variable, and rewrite our definition this way: $$[F_{n}(t)](\omega) = \frac{\displaystyle{\sum_{i=1}^{n}I_{(X_{i}(\omega)\leq t)}}}{n}.$$ The generalized empirical inverse of $F_{n}(t)$, is defined in a similar way to generalized inverse of $F$.

In my research, I came across the need to calculate the value of ($n$ and $t$ are constants): $$E\{F_{n}^{-}(t) - F^{-}(t)\}^{2}.$$ Such information is suffice to analyze the convergence in Mallows distance of the certain quantile processes. The convergence in Mallows distance is stronger than convergence in law.

For my purposes, the $F$ distribution is absolutely continuous, so it is true that $F_{n}^{-}(t) = F^{-}(U_{n}^{-}(t))$, where $U$ is a uniform distribution. The Mean Value Theorem allows reduce the former problem to the calculus of $$E\{U_{n}^{-}(t) - t\}^{2}.$$

-

The "explicit expression" will be by $n$ different cases depending on where $t$ lies.
For $n=0$, the answer is 0. For $n=1$, $$\mathbb E[(U^-_n(t)-t)^2] = \mathbb E [(U-t)^2]=\int_0^1 (x-t)^2 \,dx = \frac13 - t + t^2.$$ For $n=2$, we will have to split into cases depending on whether $t\ge 1/2$ or not, and get $\mathbb E[(\min(U_1,U_2)-t)^2]$ or similarly for max, where $U_i$ are independent and uniformly distributed.
In general, we get $n$ many cases: if $(k+1)/n\ge t\ge k/n$ we get an expression involving the $k$th order statistic $U^{(k)}$. Its distribution has the beta p.d.f. $$f_{U^{(k)}}(x)=c\cdot x^{k-1} (1-x)^{n-k}.$$