How can we assess Bias when estimating step functions? I am currently conducting a simulation study in which there is a known true function $F(t)$ which is strictly decreasing and continuous over time. I want to know if a particular estimator $\hat{F}(t)$ is unbiased over some time interval $0$ to $\tau$. The estimator $\hat{F}(t)$ produces step functions over the interval of interest.
My question is: How do I figure out if the estimator $\hat{F}(t)$ produces unbiased estimates of the true function $F(t)$ in the range of $0$ to $\tau$ using a simulation study?
My first Idea was to simply calculate the integral of the difference between the true function and the estimated function for a big number of simulation runs. That quantity would be $Bias = \int^{\tau}_{0} (F(t) - \hat{F}(t))$. In the case of a truly unbiased estimator, this quantity clearly converges to 0 over many simulation runs. The Mean-Squared-Error could be estinated in a similar fashion using $MSE = \int^{\tau}_{0} (F(t) - \hat{F}(t))^2$. I soon realized however that there are situations in which the first quantity converges to 0 even when the estimator is biased. The (very badly drawn) graph below shows what I am talking about.

Case A shows an unbiased estimate. The step function wiggles around the true curve. Case B shows a biased estimate. The step function is always below the true curve. Now the problem comes with Case C. Here the integral would be approximately 0, since the positive bias in the first half of the time interval cancels out the negative bias in the second half of the interval.
I would be very thankfull for any ideas.
 A: To compare a biased with an unbiased estimate of $F(\cdot)$, consider the case of a complement cdf,$$F(t)=\mathbb P(X\ge t)$$
which is strictly decreasing in $t\in(0,\tau)$ when $X$ is a continuous random variable with support $(0,\tau)$. Then, given a sample $X_1,\ldots,X_n$ associated with the cdf $1-F(\cdot)$ the step function
$$\hat F(t) =\frac{1}{n}\sum_{i=1}^n \mathbb I_{x_i\ge t}$$
is unbiased, since
$$\mathbb E_F[\mathbb I_{X_i\ge t}]=\mathbb P(X_i\ge t)=F(t)$$
Here is an illustration with

*

*$n=10$ points in the sample

*$\tau=1$

*$F$ the complement cdf for the standard normal

*$M=10^5$ repetitions

*$100$ plots of $\hat F$

*the graph of the average of the $M$ $\hat F$'s (red)

*the graph of the true $F$ (blue)


showing they are indistinguishable, i.e. the expectation of $\hat F$ is $F$. In the opposite, if using the biased step function
$$\hat F(t) =\frac{1}{n}\sum_{i=1}^n \varphi(x_i)\mathbb I_{x_i\ge t}$$
instead, the bias is clear:

A: Like I suggested in a comment, a set of bias effects, say polynomial ones), might be useful. That is, $i$th degree bias would be defined as
$$ B_i = \int_0^\tau p_i(t)\cdot(\hat F(t) - F(t))dt $$
where $p_i(t)$ is a suitable basis function. [I think you should subtract in the other direction than in the OP; for example, your original bias measure would come out positive in case B, even though the estimate is negatively biased.]
To keep these measures independent of one another, you should orthogonalize them. For orthogonal polynomials, define $h_i(t) = t^i$, $i=1,2,\ldots,n$ and construct these functions:
\begin{eqnarray*}
  p_0(t) &=& 1\\
  p_i(t) &=& h_i(t) - \sum_{j=0}^{i-1} a_{ij}p_j(t) \qquad i=1,2,\ldots
\end{eqnarray*}
where
$$ a_{ij} = \int_0^\tau h_i(t)p_j(t)dt $$
If I did this right (i.e., the Gram-Schmidt procedure), this ensures that $\int p_i(t)p_k(t)=0$ for any $i\ne k$.
You could construct another set of bases using some other set of $h_i$s. A useful idea might be for $h_i(t)$ to be a function that jumps from 0 to 1 at abscissae of odd multiples of $\tau/(2i)$, and from 1 to 0 at even multiples. Those create a kind of wavelet basis.
Or (duh!) a Fourier basis: $p_i(t) = \cos\left(\frac{2\pi}\tau it\right)$, which are already orthogonal (where $i$ is the index $i$, not $\sqrt{-1}$!)
