text:
\section{INTRODUCTION}
The COVID-19 pandemic has revealed the need for non-pharmaceutical interventions such as lockdowns to mitigate the spread of novel diseases, when cures and vaccines are not available. Unfortunately, while very effective, such interventions are very costly from an economic perspective. A wide variety of strategies were adopted all over the world, implementing different tradeoffs between economic and epidemic cost. In general, this class of epidemic control strategies can be classified in two main categories: \emph{suppression strategies}, which "aim to reverse epidemic growth, reducing case numbers to low levels and maintaining that situation indefinitely", or
\emph{mitigation strategies}, which "focus on slowing but not necessarily stopping epidemic spread, reducing peak healthcare demand" while
minimizing the negative effects on economic activities \cite{ferguson2020report}.

We here aim at understanding better the trade-off in terms of economic and epidemic cost  of lockdown strategies on epidemic spread within a standard susceptible-infected-recovered (SIR) model \cite{kermack1927contribution}. We study the optimal lockdown from an optimal control perspective as first analyzed in \cite{behncke2000optimal}, with an objective that takes into account the epidemic cost associated with deaths and the economic cost due to lockdowns, as suggested in \cite{alvarez2020simple,acemoglu2020multi}. The cost takes into account hospital congestion, which appeared to be a key feature of the recent pandemic, by assuming that the lethality due to the disease is an increasing affine function of the fraction of infected $i$,  leading to a quadratic mortality rate in $i$. To the best of our knowledge, no analytical solutions to optimal control problems with quadratic cost in $i$ are provided in the literature \cite{nowzari2016analysis}. While in \cite{alvarez2020simple,acemoglu2020multi} numerical solutions are provided, in \cite{kruse2020optimal} authors show that if the cost is linear in the infected, i.e., there is no hospital congestion, and convex in the intervention, the optimal policy is quasi-convex. In  \cite{miclo2020optimal} the authors consider the problem of minimizing the cost of the intervention subject to the constraint that the fraction of infected is below a certain threshold, i.e., $i(t) \le \overline{i}$ for every time $t$,  where the value of $\overline{i}$ is based on hospitals capacity. For the case of infinite time horizon $T$, the authors prove analytically that in a first phase it is optimal to let the epidemic spread, until $i(t)=\overline{i}$; then the optimal lockdown is such that the infected remain constant at the threshold, and is released when herd immunity is reached, i.e., when the fraction of people that contracted the disease is large enough to guarantee that, from there on, the number of infected people will decrease even without lockdown. While \cite{miclo2020optimal} handle hospital congestion by a hard constraint on the simultaneous fraction of infected, without any cost on the number of deaths, our formulation considers a quadratic cost in $i$ without hard constraints. A feedback control with a hard constraint of the simultaneous fraction of infected is also proposed in \cite{di2020covid}. Optimal control approaches to containment of COVID-19 pandemic using more detailed compartmental models are also studied numerically in \cite{djidjou2020optimal,kantner2020beyond}.

The contribution of our work is two-fold. We first show numerically that as $T$ increases and the trade-off between economic and epidemic cost vary, the optimal control captures the fundamental difference between suppression and mitigation, exhibiting a phase transition between solutions that avoid diffusion of the disease, and solutions that steer the system to herd immunity while maintaining the number of infected low to mitigate the negative effects of hospital congestion. Our second main contribution is to consider two simple feedback policies, where lockdown levels are selected to either stabilize the reproduction number $R(t)$ (i.e., reduce the number of secondary infections to  ``flatten the curve'') or the fraction of infected (i.e., containing the number of hospitalizations). We note that the policy stabilizing $i(t)$ resembles the optimal control in \cite{miclo2020optimal}, with the only difference that in \cite{miclo2020optimal} the threshold depends on hospitals capacity, while in our formulation the threshold is a free parameter that can be optimized to reduce the cost. We analytically compute the exact cost of these policies, and provide an upper bound to the performance gap between the two policies and the optimal control. In particular, we show that if $T$ is infinite, controlling $i(t)$ is better than controlling $R(t)$ and is close to optimal. Together with its close-to-optimal performance, the policy that controls the number of infected is in feedback form and easy to interpret, in contrast with numerical solutions of optimal control. As a corollary, our result shows that the spectral control approach  (see e.g., \cite{nowzari2016analysis, birge2020controlling}), where typically one aims at selecting the minimal intervention guaranteeing $R(t)<1$ is not optimal in the long run when i) the cost of the intervention has to be paid repeatedly in time (e.g., lockdown are different than vaccinations since if lockdown are interrupted the reproduction number will immediately go back to above 1, while after a vaccination campaign,  assuming permanent immunization, the  system will be stable forever on) and ii)  the horizon is long or the economic cost associated with the intervention is comparable with the epidemic cost. We remark that our theoretical analysis is restricted to the case of infinite time horizon and does not consider pharmaceutical interventions that may be implemented when cures and vaccines become available. Furthermore, we assume that individuals who contracted the infection become immune from there one. We emphasize that our purpose is not to suggest specific control strategies for the COVID-19 pandemic, but to provide general insights and mathematical contribution on the control of epidemics
\section{Model and problem formulation}
\label{sec:model}
To capture the effect of lockdown interventions, we consider the following simple SIR model introduced in \cite{alvarez2020simple}:
\begin{equation}\label{eq:sir}
	\begin{cases}
		\dot{s}=-\beta {(1-\theta L)^2}si\\
		\dot{i}=\beta{(1-\theta L)^2} si-\gamma i\\
		\dot{r}=\gamma i,
	\end{cases}
\end{equation}
where $s/i/r$ is the fraction of susceptible/infected/recovered agents, with initial condition $s_0/i_0/r_0$, $\beta$ is the infection rate, $\gamma$ is the recovery rate, $L \in [0,\overline{L}]$ is the percentage of population in lockdown and $\theta$ is the effectiveness of the lockdown (i.e. even if $L=1$ only $\theta$ percent of the population actually complies with the lockdown) and the dependence of $s, i, r, L$ on $t$ is omitted for convenience of notation. While the transmission mechanisms of the SARS-CoV-2 are very complicated (see e.g. \cite{sun2021transmission}), we assume that the lockdown $L$ enters quadratically in the dynamics, because people get the disease through pairwise interactions, (see \cite{alvarez2020simple,acemoglu2020multi}). When considering lockdown policies, one needs to consider not only the epidemics dynamics, but also the economic cost associated with such interventions. To this end, the cost of the lockdown policy can be divided into an \textit{economic cost} (due to loss of workforce because of the lockdown) which we model as
$ cost_{eco}(t)=L(t)$,
and an  \textit{epidemic cost} (related to number of fatalities) which following \cite{alvarez2020simple} and \cite{acemoglu2020multi} we model as
$ cost_{epi}(t)= \kappa \gamma_d(i(t))i(t),$
where $\gamma_d(i(t))i(t)$ is the mortality rate and $\kappa$ is the trade-off between economic and epidemic cost. We assume that the mortality  $\gamma_d(i)=\gamma_0+\gamma_1 i$ is increasing in $i$ to take into account hospitals congestion, as proposed in \cite{alvarez2020simple,acemoglu2020multi}.
\subsection*{Reproduction number}
The behaviour of the SIR dynamics is characterized by the reproduction number $R(t):=\beta s(t) /\gamma$, which is the number of secondary infections that an infected person produces on average. If $R(t)<1$, the epidemic is stable in the sense that the number of infected decreases indefinitely, while if $R(t)>1$ the number of infected increases until the first time $t^*$ such that $R(t^*)=1$. In presence of control, i.e., when $L(t)>0$, the infection rate and therefore the reproduction number are reduced. We let $R_L(t):=\beta(1-\theta L)^2/\gamma$ denote the \emph{controlled reproduction number} and $R(t)$ denote the \emph{uncontrolled reproduction number}.
\subsection*{Optimal control}
Let $c(t):=cost_{eco}(t)+cost_{epi}(t)$.
The objective of the planner is to find the optimal control $L^*(t)$ solving
\begin{equation}\label{eq:cost}
	\begin{aligned}
	L^* = \underset{L:[0,T] \to [0,\overline{L}]}{\arg\min} & \quad  \int_0^T c(t) dt \\
	\textup{s.t.} & \quad \textup{dynamics in }\eqref{eq:sir},
	\end{aligned}
\end{equation}
where $T$ is the time horizon,
We start by noting that, using similar techniques as in \cite{behncke2000optimal}, one can show that the optimal lockdown $L^*(t)$ solution to the optimal control problem \eqref{eq:cost} is an increasing function of the force of infection $f:=\beta s i$. It is remarkable to note that, although the stability of the system does not depend on $i$, the lockdown policy does, through $f$. Thus, even if the system is highly unstable (i.e.,
$R(t)=\beta s(t)/\gamma \gg 1$) if $i(t) \rightarrow 0$ then $L^*(t) \rightarrow 0$, which means that the optimal lockdown lets the infected grow when the number of infected is low.
Besides this characterization, an analytic solution to \eqref{eq:cost} remains open. Numerical solutions to optimal control problems such as \eqref{eq:cost} have been investigated, but typically suffer from lack of interpretability and robustness guarantees, as they are not in feedback form, i.e., the policy does not depend explicitly on the state. As an alternative, in the next section we propose two simple feedback policies based on controlling the reproduction number (which is typically considered in spectral control \cite{nowzari2016analysis}) or controlling the total number of infected (to reduce congestion of the health system).
These strategies, or their combination, have informed the response to COVID-19 of governments and public/private entities (e.g., Cornell University \cite{cornell}, USA \cite{USA} and Italy \cite{Italy}).

\section{Two feedback policies}\label{sec:heuristic}
We here describe the two feedback policies. Their performance are studied in Section \ref{sec:results}. To simplify the exposition we set $\theta=1$ and $\overline{L}=1$, but  all results can be  generalized.
\subsection{Policy A: Controlling reproduction number}
This policy aims at controlling the reproduction number, as typically considered in spectral control (see e.g. \cite{nowzari2016analysis}). Given a target reproduction number $\rho$, if the uncontrolled reproduction number $R(t)$ is greater than $\rho$, i.e. $\beta s(t) /\gamma > \rho$, a lockdown level $L_\rho(t)>0$ such that $R_L(t)=\rho$ is imposed, leading to $L_\rho$ satisfying
	\begin{equation}\label{eq:r0_const}
		R_L(t)= \frac{\beta}{\gamma}(1-L_\rho(t))^2s(t) =\rho.
	\end{equation}
If instead $R(t)\le \rho$, then $L_\rho(t)=0$.\\
   We can divide the dynamics in two phases:
	\begin{enumerate}
		\item Phase I: in $[0,t^*)$ with $t^*$ such that $s(t^*)=\gamma \rho / \beta$. In this phase $\beta  s /\gamma\ge \rho $, $L_\rho$ is as in \eqref{eq:r0_const} and the dynamics are
		\begin{equation*}
			\label{eq:part1rho}
				\dot{s}=-\rho \gamma i, \quad
				\dot{i}=\rho \gamma i -\gamma i = (\rho-1)\gamma i, \quad
				\dot{r}=\gamma i.
		\end{equation*}
		\item Phase II: in $[t^*,T]$. Since $R(t)\le\rho$, $L_\rho=0$, the dynamics is uncontrolled and given by
	\begin{equation*}
			\dot{s}=-\beta  si, \quad
			\dot{i}=\beta si -\gamma i, \quad
			\dot{r}=\gamma i.
	\end{equation*}
	\end{enumerate}
	Fig. \ref{fig:control_R0} illustrates the dynamics under Policy A.
	Notice that Phase I may not exist if $\beta  s_0 /\gamma \le \rho$, and Phase II may not exist if $\beta s(T)/\gamma>\rho$ (this scenario typically occurs when $\rho<1$ because the infected decay exponentially and the disease does not spread). Policy A is parametric in $\rho$, thus a policy-maker that adopts this policy should select $\rho^*$ to minimize the total cost (see Fig. \ref{fig:control_R0}), leading to
	\begin{equation*}\label{eq:r}
	\begin{aligned}
		\rho^*:=\arg\min_\rho & \quad \int_0^T c(t) dt \\
		s.t & \quad  \quad \eqref{eq:sir} \textup{ with } L(t)=L_\rho(t).
	\end{aligned}
	\end{equation*}
\begin{figure}
	\centering
\includegraphics[width=4.2cm]{1f.png}
\includegraphics[width=4.2cm]{cost_vs_rmax_f.png}
\caption{Policy A. \emph{Left}: Dynamics with $\rho=1.2$. Phase I ($L_\rho(t)>0$) lasts until $\beta s /\gamma = \rho$ (red line); then, the trajectory becomes uncontrolled (Phase II). Infected grows until the reproduction number becomes less than 1. The unit of time is one day. \emph{Right}: optimization over $\rho$. The parameters used in this simulation, and are $\beta=0.2$, $\gamma=1/18$, $\gamma_0=5.6 \cdot 10^{-4}$, $\gamma_1=5.6 \cdot 10^{-3}$ based on the COVID-19 pandemic, see \cite{alvarez2020simple, acemoglu2020multi}), $s_0=0.98$, $i_0=0.01$, $r_0=0.01$, $\kappa=40\cdot365$, $T=5$ years. For the used parameters $\rho^*>1$, meaning that the total cost is minimized with a mitigation policy that lets the infection spread in a controlled way. \label{fig:control_R0}
\end{figure}
\subsection{Policy B: controlling fraction of infected}
As anticipated in Section \ref{sec:model}, optimality conditions suggest that the optimal quantity to be controlled is the force of infection \cite{behncke2000optimal}. Stabilizing this quantity, i.e., imposing lockdown $L_f(t)$ such that that the $\beta(1- L_f(t))^2 s(t) i(t) = \phi$ yields the dynamics
\begin{equation*}
	\label{eq:dyn_force}
	\dot{s}=-\phi, \quad
	\dot{i}=\phi -\gamma i, \quad
	\dot{r}=\gamma i,
\end{equation*}
which stabilizes asymptotically $i(t)$ to $\phi/\gamma$. Based on this observation, instead of controlling the force of infection, we here propose a policy that stabilizes the number of infected $i(t)$ (as the optimal policy in \cite{miclo2020optimal}), whose meaning is more intuitive. Given a target value $\iota$, policy B works as follows: if $i_0<\iota$, $L_\iota(t)=0$ until the first time $\tau_1$ such that $i(\tau_1)=\iota$; if $i_0>\iota$, $L_\iota(t)=1$ until $\tau_1$; then, impose $L_\iota(t)$ in such a way that $\dot{i}(t)=0$, hence $i(t)=\iota$, until time $\tau_2$ such that herd immunity is reached, i.e., $s(\tau_2)=\gamma/\beta$; finally, the lockdown is released, i.e., $L_\iota(t)=0$ (see Fig. \ref{fig:control_i}). Given $\iota$, we divide the trajectory in three phases:
\begin{enumerate}
	\item Phase I in $[0,\tau_1)$, with $\tau_1$ being the smallest time such that $i(\tau_1)=\iota$. If $i_0 < \iota$  $L_\iota(t)=0$ and the dynamics is
	\begin{equation*}
		\dot{s}=-\beta s i, \quad
		\dot{i}=\beta s i -\gamma i, \quad
		\dot{r}=\gamma i,
\end{equation*}
If $i_0 > \iota$, $L_\iota(t)=1$, with dynamics
		\begin{equation*}
		\dot{s}=0, \quad
		\dot{i}= -\gamma i, \quad
		\dot{r}=\gamma i.
\end{equation*}
	\item Phase II in $[\tau_1,\tau_2)$, with $\tau_2$ such that $s(\tau_2)=\gamma/\beta$. In this phase $i(t)=\iota$, and the dynamics is
	\begin{equation*}
		\dot{s}=-\gamma \iota, \quad
		\dot{i}=0, \quad
		\dot{r}=\gamma \iota.
\end{equation*}
with
\begin{equation*}
	L_\iota(t) \ \text{s.t.}\ \beta s(t) (1-L_\iota(t))^2 = \gamma.
\end{equation*}
	\item Phase III in $[\tau_2,T]$: the dynamics is uncontrolled and given by
	\begin{equation*}
		\dot{s}=-\beta s i, \quad
		\dot{i}=\beta s i -\gamma i,  \quad
		\dot{r}=\gamma i.
	\end{equation*}
\end{enumerate}
Notice that in Phase III $\dot{i}(t)<0$ even without control because herd immunity is reached.
In contrast with \cite{miclo2020optimal}, where the value of $\iota$ depends on the ICU capacity and the policy-maker has to choose the optimal policy complying with the constraint $i(t)\le \iota$, here for any value of $\iota$ the policy is given, and the policy-maker should select $\iota^*$ to minimize the total cost \eqref{eq:cost} (see Fig. \ref{fig:control_i}), leading to
\begin{equation*}\label{eq:i}
	\begin{aligned}
		\iota^*:=\arg\min_\iota & \quad \int_0^T c(t) dt \\
		s.t & \quad  \quad \eqref{eq:sir} \textup{ with } L(t)=L_\iota(t).
	\end{aligned}
\end{equation*}
\begin{figure}
	\centering
	\includegraphics[width=4.2cm]{4f.png}
	\includegraphics[width=4.2cm]{cost_vs_imax_f.png}
	\caption{Policy B. \emph{Left}: Dynamics with $\iota=0.06$. In Phase I the trajectory is uncontrolled ($L(t)>0$) and the fraction of infected grows (Phase I); when $i(t)$ reaches the threshold $\iota$, lockdown $L(t)$ is imposed in such a way to maintain the fraction of infected constant (Phase II). When herd immunity is reached, the lockdown is released and infected start decreasing (Phase III). \emph{Right}: Optimization over $\iota$. The parameters are as in Fig. \ref{fig:control_R0}. \label{fig:control_i}}
\end{figure}
\section{Results}\label{sec:results}
This section is divided in two parts. In the first part, some observations on numerical solutions are presented. In the second part, we provide an upper bound on the performance gap between the feedback policies presented in Section \ref{sec:heuristic} and the optimal control \eqref{eq:cost}, and show that, some under assumptions, controlling the fraction of infected is close to optimal and outperforms the policy based on controlling the reproduction number.
\subsection{Numerical results}
\begin{figure}
	\centering
	\includegraphics[width=4.2cm]{plot_pareto_chi_N2.png}
	\includegraphics[width=4.2cm]{plot_pareto_T_N2.png}
	\caption{\emph{Left}: Economic loss, defined as $\frac{\int_0^T L(t)dt}{T} $, vs epidemic cost, i.e., fraction of population died because of the disease under the optimal control, as the trade-off between economic and epidemics cost $\kappa$ vary ($T=1.5$ yrs). \emph{Right}: same with $T$ varying, ($\kappa=20 \cdot 365$), and economic cost defined as $\frac{\int_0^T L(t)dt}{1.5 \text{yrs}}$. Other parameters are as in Fig. \ref{fig:control_R0}.}
		\label{fig:phase}
\end{figure}
Our first result is that numerical solutions of the optimal control exhibit a phase transition from suppression to mitigation, as described in \cite{ferguson2020report}, as $T$ increases and $\kappa$ decreases. In the left panel of Fig. \ref{fig:phase}, economic and epidemic cost as their trade-off $\kappa$ vary are computed, while other parameters (including $T$) are fixed. There is a clear phase transition: when $\kappa$ is small, the optimal policy lets the epidemic spread (high number of deaths, small economic cost), whereas when $\kappa$ is large optimal policy maintains the lockdown until the horizon (high economic cost and small epidemic cost). Solutions in between these two strategies are never optimal. The right plot shows that a similar phase transition occurs with $\kappa$ constant and varying $T$. Despite the economic and epidemic cost exhibiting a phase transition, we emphasize that the total cost is continuous in the parameters.
\begin{remark}
	We also observe that similar phase transition occurs for Policies A and B, namely if $\kappa$ is large and $T$ is small, the optimal reproduction number for Policy A satisfies $\rho^*<1$, implying that $i(t)$ decreases, and under Policy B the optimal $\iota^*$ is very small, whereas, if $\kappa$ is small and $T$ is large, the optimal reproduction number satisfies $\rho^*>1$, the optimal $\iota^*$ is much larger, and the epidemic cost is in general comparable with the economic cost.
\end{remark}\medskip
This confirms our intuition that solutions based on spectral control problems, that minimize statically the cost of intervention subject to the constraint $R_0<1$, are suboptimal from an optimal control perspective when $T$ is large or  $\kappa$ is not too high, since stabilizing the system indefinitely leads to a prohibitively
 high economic cost. As shown in Fig. \ref{fig:suppression_mitigation}, in the range of parameters that make the optimal control select suppression strategies, the optimal control and the feedback policies achieve similar performances, whereas when the optimal control selects mitigation, Policy B is close to optimal and outperforms Policy A. We next investigate these observations.
\subsection{Theoretical results}
\label{sec:results}

\begin{table*}	\caption{Analytic expressions of the cost under the two heuristics}
\vspace{-0.3cm}\hrule
	\begin{equation}\label{eq:t*}
			\begin{aligned}
			&C_A(\rho
			=(t^*-T_1)+\frac{\kappa \gamma_0}{\gamma} (r(\infty)-r_0)
				+\frac{\kappa \gamma_1 }{2(\rho-1)\gamma} \left(i(t^*)^2 -i(0)^2\right)
				+\kappa\gamma_1\bigg(\gamma\frac{[\ln(s(t^*))]^2-[\ln(s(\infty))]^2}{2\beta^2}-\frac{s(t^*)-s(\infty)}{\beta} +\big(1-r(t^*)-\frac{\gamma}{\beta}\ln (s(t^*))\big)\frac{r(\infty)-r(t^*)}{\gamma}\bigg),\\
			&	\textup{with}\quad  t^*=\frac{ ln\left( 1 - \frac{\rho\gamma-\beta s_0 }{\beta\nu i_0}\right)}{(\rho-1)\gamma}, \
	\nu = \frac{\rho}{\rho+1}, \ \tilde{\nu}=(s_0+\nu i_0), \
	s(t^*)=\frac{\gamma \rho}{\beta},  \ r(t^*)=1-\frac{s(t^*) + \tilde{\nu}}{\nu},\\&\qquad
	T_1=2\sqrt{\frac{\rho }{\beta \tilde{\nu}(\rho-1)^2\gamma }}  { \left(     \at\left(\sqrt{\frac{s_0}{\tilde{\nu}}}\right) - \at\left(\sqrt{\frac{ \rho\gamma}{\beta\tilde{\nu}}}\right)    \right) }, \
	r(\infty)=1-s(\infty)=1-s(t^*) e^{-\frac{\beta}{\gamma} (r(\infty)-r(t^*))}
			\end{aligned}
		\end{equation}
		\hrule
		\vspace{0.2cm}
		\begin{equation}\label{eq:cost_B}
		\begin{aligned}
		&C_B(\iota
		=\kappa\gamma_1\Bigg(\gamma\frac{[\ln s_0]^2-[\ln s(\tau_1)]^2}{2\beta^2}-\frac{s_0-s(\tau_1)}{\beta} +\big(s_0+i_0-\frac{\gamma}{\beta}\ln s_0\big)\frac{i_0+s_0-\iota-s(\tau_1)}{\gamma}+(\tau_2-\tau_1)\iota^2+\gamma\frac{[\ln \frac{\gamma}{\beta}]^2-[\ln s(\infty)]^2}{2\beta^2}-\frac{\frac{\gamma}{\beta}-s(\infty)}{\beta} +\\
		&+\big(\frac{\gamma}{\beta}+\iota-\frac{\gamma}{\beta}\ln \frac{\gamma}{\beta}\big)\frac{r(\infty)-1+\iota+\frac{\gamma}{\beta}}{\gamma}\Bigg) + \frac{1}{\iota}\bigg(\sqrt{\frac{s(\tau_1)}{\gamma}}-\sqrt{\frac{1}{\beta}}\bigg)^2+\frac{\kappa\gamma_0}{\gamma} (r(\infty)-r_0)\\
		&\textup{where } s(\tau_1) \textup{ and } r(\infty) \textup{ are the unique feasible solutions of}\\& \quad \ln\Big(\frac{s(\tau_1)}{s_0}\Big)=\frac{1}{\gamma}[s(\tau_1)-s_0+\iota-i_0], \
		r(\infty)=1-\frac{\gamma}{\beta} e^{-\frac{\beta}{\gamma} (r(\infty)-1+\iota+\frac{\gamma}{\beta})}, \ \tau_2-\tau_1=\frac{s(\tau_1)-\gamma/\beta}{\gamma \iota}, \
		s(\infty)=1-r(\infty).
	\end{aligned}
		\end{equation}
		\hrule
\end{table*}
\begin{figure}
	\centering
	\includegraphics[width=4.2cm]{prova.png}
	\includegraphics[width=4.2cm]{fig2f.png}\\
	\includegraphics[width=8cm]{table_pnas2.png}

	\caption{\emph{Left}: $T=1 yr$, optimal control (orange) and feedback policies (policy A in blue, policy B in purple) select suppression strategy.
	Performances of the three strategies are comparable, and economic cost is much larger than epidemic cost. \emph{Right}: $T=3 yrs$,
	optimal control and feedback policies select mitigation. The dynamics under policy B is similar to dynamics under the optimal control, and Policy B outperforms Policy A. In this simulation $\kappa=1.5$, and the other parameters are as in Fig. \ref{fig:control_R0}. \label{fig:suppression_mitigation}}
\end{figure}
To compare the cost achieved by the feedback policies with the optimal cost, we work under the assumption that $T=+\infty$, which has two main implications:
\begin{enumerate}
	\item there exists $t^*$ such that $s(t^*)=\gamma/\beta$ under optimal control, that is, herd immunity is reached; indeed, if it were not the case, the lockdown could never be totally released and the economic cost would explode;
	\item the fraction of infected $i(T)$ vanishes (see e.g. \cite{hethcote2000mathematics}).
\end{enumerate}
In other words, with infinite $T$ there is no phase transition between suppression and mitigation (unless $\kappa=0$), since avoiding the spread of the infection leads to an infinite economic cost and is therefore unfeasible.
\begin{remark}
We observed from simulations that above a certain value of $T$, the optimal policy does not depend on $T$. Indeed, if the epidemic reaches herd immunity, the infected naturally asymptotically decrease to $0$ and both epidemic and economic cost tend to vanish. Hence our results provide insight not only for the infinite horizon case, but for any large $T$
\end{remark}\medskip
Before establishing our main results, we introduce a technical lemma on SIR dynamics which is needed for the proofs and may be of separate interest.
\begin{lemma}[Uncontrolled dynamics]
	\label{prp:nc_square}
	Let $a \le b$, and let $L(t)=0$ for every $t \in [a,b]$.
	Then,
	\begin{equation*}
		\begin{aligned}
			\int_a^b i^2dt
			&=\gamma\frac{[\ln(s(a))]^2-[\ln(s(b))]^2}{2\beta^2}-\frac{s(a)-s(b)}{\beta} +\\ &+\big(s(a)+i(a)-\frac{\gamma}{\beta}\ln (s(a))\big)\frac{r(b)-r(a)}{\gamma}.
		\end{aligned}
		\label{eq:i^2_nc}
	\end{equation*}
\end{lemma}\medskip
\begin{proof}
	It can be shown that $s(t)+i(t)-\frac{\gamma}{\beta}s(t)$ is constant in time if $L(t)=0$, hence
	\begin{equation}
		\label{eq:constant}
		s(a)+i(a)-\frac{\gamma}{\beta}s(a) = s(b)+i(b)-\frac{\gamma}{\beta}s(b).
	\end{equation}
	By \eqref{eq:constant}, omitting the dependence on $t$,
	\begin{equation}
		\begin{aligned}
			&\int_a^b i^2dt=\int_a^b i\big(\frac{\gamma}{\beta}\ln (s)-\frac{\gamma}{\beta}\ln s(a)-s+s(a)+i(a)\big)dt\\
			=&\frac{\gamma}{\beta}\int_a^b i \ln (s) dt-\int_a^b is dt + \big(s(a)+i(a)-\frac{\gamma}{\beta}\ln s(a)\big)\int_a^b i dt.
		\end{aligned}
		\label{eq:sum_pieces}
	\end{equation}
	From $\dot{s}=-\beta s i$, the first integral gets:
	\begin{equation}
		\begin{aligned}
			&\int_a^b i \ln(s) dt= -\frac{1}{\beta}\int_a^b \frac{\dot{s}\ln(s)}{s}dt\\
			=&-\frac{1}{2\beta}\int_a^b\frac{d}{dt}[\ln(s)]^2dt=\frac{[\ln s(a)]^2-[\ln s(b)]^2}{2\beta}.
			\label{eq:piece1}
		\end{aligned}
	\end{equation}
	The second and the third integral are
	\begin{equation}
		\label{eq:piece2}
		\begin{aligned}
			&\int_a^b is dt=-\frac{1}{\beta}\int_a^b \frac{\dot{s}}{s}sdt=-\frac{1}{\beta}\int_a^b \dot{s}dt=\frac{s(a)-s(b)}{\beta},\\
			&\int_a^b i(t)dt=\int_a^b\frac{\dot{r}(t)}{\gamma}dt=\frac{r(b)-r(a)}{\gamma}.
		\end{aligned}
	\end{equation}
	The statement follows by plugging \eqref{eq:piece1} and \eqref{eq:piece2} in \eqref{eq:sum_pieces}.
\end{proof}\medskip
Let $C_{A}(\rho)$ and $C_B(\iota)$ denote the cost of policies $A$ and $B$ for a given value of $\rho$ and $\iota$, respectively. In the next two propositions we derive analytical expressions for $C_{A}(\rho)$ and $C_B(\iota)$. For the sake of readability, for the two policies we work respectively under the assumption that $\iota \ge i_0$ and $\rho > 1$, but similar expressions hold in case $\iota<i_0$ and $\rho \le 1$.
\begin{proposition}
	\label{prpA}
	Let $T = +\infty$. Then, $C_A(\rho)$ is as in \eqref{eq:t*}.
\end{proposition}
\begin{proof}
	See the Appendix.
\end{proof}
\begin{proposition}
	\label{prpB}
Let $T = +\infty$. Then, $C_{B}(\iota)$ is as in  \eqref{eq:cost_B}.
\end{proposition}
\begin{proof}
	See the Appendix.
\end{proof}
The idea for the proofs is to split the cost in three terms:
\begin{enumerate}
	\item economic cost: $\int_0^T L dt$;
	\item infected cost:
	$\int_0^T i dt  $;
	\item infected squared cost:
	$\int_0^T i^2 dt  $.
\end{enumerate}
The terms may be computed exactly by using Lemma \ref{prp:nc_square} and by using the fact that in presence of control the dynamics is linear.
In the next proposition we give a lower bound on the optimal cost, which will be used to compare Policy A and B with the optimal control. For technical reasons we restrict our analysis to policies that do not put control after herd immunity. This is a natural assumption, and numerical solutions show that this is indeed the case for most values of parameters.
	\begin{proposition}
		\label{prp:lb}
	Let $T=+\infty$, and let $t^*$ be the smallest time such that $s(t^*)\le\gamma/\beta$ (herd immunity). The cost of any control such that $L(t)=0$ for every $t \in [t^*,+\infty)$ is lower bounded by
	\begin{equation*}
		\label{eq:lower_bound}
		C^* := \underset{0\le i^* \le i_{max}}\min U(i^*),
	\end{equation*}
	where
	$
	 U(i^*)=2 {U_{12}^I(i^*)}+U_{22}^{II}(i^*)+U_{3}(i^*)
	 $
	 and
	 \begin{equation*}\footnotesize
		\begin{aligned}\footnotesize
			U_{12}^I(i^*)&= \epsilon \sqrt{\kappa\gamma_1} \left[ \frac{ -i^*+ i_0-s({t^*})+s_0}{\gamma} +\frac{1}{\beta} (\ln{s(t^*})- \ln s_0)\right],\\
		U_{22}^{II}(i^*) &=
			\frac{\gamma}{\beta}\frac{[\ln{(\gamma/\beta)}]^2-[\ln(s(\infty))]^2}{2\beta}-\frac{\gamma/\beta-s(\infty)}{\beta} +\\ &+\big(\gamma/\beta+i^*-\frac{\gamma}{\beta}\ln {\gamma/\beta}\big)\frac{i^*+\gamma/\beta-s(\infty)}{\gamma},\\
			U_3(i^*)&= \frac{\kappa\gamma_0}{\gamma}(r(\infty)-r_0),
		\end{aligned}
	\end{equation*}
	with $r(\infty)$ solution of $
		r(\infty)=1-s(t^*) e^{-\frac{\beta}{\gamma} \big(r(\infty)-1+i^*+s(t^*)\big)}$, $s(\infty)=1-r(\infty)$, $i_{max}=i_0+s_0-\frac{\gamma}{\beta}\big(1-\ln\frac{\gamma}{\beta s_0}\big)$, $\epsilon = \sqrt{27/32}$.
\end{proposition}\medskip
\begin{remark}
	Notice that $U(i^*)$ depends on $i^*$ both explicitly and through $s(\infty)$ and $r(\infty)$.
\end{remark}\medskip
\begin{proof}
	See the Appendix.
\end{proof}
Apart from constants, $U_3$ is the infected cost, and $U_{22}^{II}$ is the infected squared cost after herd immunity, computed starting from the state at time $t^*$ under the assumption that there is no control after herd immunity (so that economic cost is zero). These are computed using \eqref{eq:sir} with $L(t)=0$ and Lemma \ref{prp:nc_square}, respectively. The term $U_{12}^I$ is a lower bound for the sum of economic and infected squared cost before herd immunity. \\
Let $C_{opt}$ denote the cost of the optimal control among all the controls such that after herd immunity do not put any lockdown.
We can now derive bounds between performance of our two policies and $C_{opt}$.
\begin{theorem}
	Let $T = +\infty$. Then,
	\begin{equation*}
		C_A(\rho^*)-C_{opt} \le \min_\rho \ \eqref{eq:t*} - C^*.
	\end{equation*}
\end{theorem}
\begin{proof}
The proof follows immediately from Propositions \ref{prpA} and~\ref{prp:lb}.
\end{proof}\medskip
\begin{theorem}
Let $T = +\infty$. Then,
\begin{equation*}
	C_B(\iota^*)-C_{opt} \le \min_\iota \ \eqref{eq:cost_B} - C^*.
\end{equation*}
\end{theorem}
\begin{proof}
The proof follows immediately from Propositions \ref{prpB} and \ref{prp:lb}.
\end{proof}\medskip
In Fig. \ref{fig:plot} the exact cost of the two policies, the cost under the optimal control computed numerically, and the lower bound on the optimal cost are plotted as a function of $\kappa$. Note that controlling $i(t)$ is close to the optimal control computed numerically. The theoretical analysis allows to conclude that, for the tested parameters, controlling $i(t)$ is better than controlling $R(t)$, as the distance between cost of Policies A and B is comparable with the distance between Policy B and the lower bound $C^*$. From a computational viewpoint, note that controlling $i(t)$ instead of solving the optimal control, reduces the complexity of the problem from an optimization over a set of functions to a minimization over the parameter $\iota$.
\begin{figure}
	\centering
	\includegraphics[width=6cm]{plots_heuristic_vs_lowerbound_f2.png}
	\caption{\label{fig:plot} Exact cost of Policies A and B with optimal $\rho^*$ and $\iota^*$ (analytical), optimal cost (numerical) and lower bound to the optimal cost (analytical) as functions of $\kappa$. We noticed that $T=5$ years is large enough to approximate infinite time horizon. Indeed, after a large enough time, both economic and epidemic cost are negligible (see Fig. \ref{fig:suppression_mitigation}). Other parameters are as in Fig. \ref{fig:control_R0}.}
\end{figure}
\section{Conclusion}
In this work we consider a SIR with lockdown, and we study the optimal lockdown as solution to an optimal control problem. We model the cost as the sum of an epidemic cost, and economic cost due to lockdowns. We first show numerically that, as the time horizon and the cost of life vary, the solutions of optimal control exhibit a phase transition from suppression strategies to mitigation strategies, as described in \cite{ferguson2020report}. Then, we introduce two simple feedback policies, one stabilizing the reproduction number, and one stabilizing the fraction of infected. We compute their exact cost, and compare analytically their performance with the optimal cost. We show that in case of infinite time horizon controlling the fraction of infected is close to optimal. Future directions include but are not limited to: investigation on where the phase transition occurs; extending the analysis to the case of finite time horizon, considering different cost functions like sigmoidal functions, and extending the analysis to network SIR, as in the numerical analysis of \cite{acemoglu2020multi}.

\section*{Acknowledgements}
This research was carried on within the framework of the MIUR-funded {\it Progetto di Eccellenza} of the {\it Dipartimento di Scienze Matematiche G.L. Lagrange}, Politecnico di Torino, CUP: E11G18000350001. It received partial support from the {\it Compagnia di San Paolo} through a Joint Research Project. It was also supported by C3.ai Digital Transformation Institute award.

\bibliographystyle{IEEEtran}


text:
\section{Introduction}

Let $\left(  X_{i},Y_{i}\right)  $, $i=1,...,n$ be independent and identically
distributed continuous variables and suppose that their common density
has a support defined by
$$
S=\left\{  \left(  x,y\right)  \in\mathbb{R} \times\mathbb{R};0\leq y\leq g\left(  x\right)  \right\}.
$$
The unknown
function $g$ is called the \textit{frontier}. We address the problem of
estimating $g$. In~\cite{JMVA2}, we introduced a new kind of estimator
based upon kernel regression on high power-transformed data. More precisely
the estimator of $g(x)$ was defined by
\[
\left(  \left(  p+1\right)  \sum_{i=1}^{n}K_{h}\left(  X_{i}-x\right)
Y_{i}^{p}\left/\sum_{i=1}^{n}K_{h}\left(  X_{i}-x\right) \right. \right)  ^{1/p}%
\]
where $p=p_{n}\rightarrow\infty$ and $h=h_{n}\rightarrow0$ are non
random sequences, $K$ is a symmetrical probability density with support
included in $\left[  -1,1\right]$, and $K_{h}(\bullet)=K\left(  \bullet/h\right)
/h$. Although the correcting term $\left(  p+1\right)  ^{1/p}$ was
specially designed to deal with the case of a uniform conditional distribution
of $Y/X=x$, this estimate has been shown to converge in any case. In the
special but interesting case of a uniform conditional distribution of $Y/X=x$
for a $\alpha-$lipschitzian frontier the minimax rate of convergence is
attained. We also proved that the estimator is asymptotically Gaussian.
It is also interesting to note that, compared to the
extreme value based
estimators~\cite{ISUPLaurent,Geffroy,Scandi,JSPI,JSPI2,ESAIM},
projection estimators~\cite{JacSuq}
or piecewise polynomial estimators~\cite{KorTsy,KorTsy3,Har},
this estimator does not require a partition of the support $S$.

A natural idea suggested by our referees was to investigate the possible
gains obtained by substituting a local polynomial regression to the
Nadaraya-Watson regression. The basic idea in this theory
consists in approximating locally a $C_{k+1}$ regression function by a
polynomial of degree $k$ and taking the zero-degree term as an estimate of the
regression. The regularity of the function brings improvement on the
bias term.
Accordingly, when dealing with high power-transformed data we establish in this paper that the
bias of the local polynomial estimator of degree $k$ is $O_{p}(h(hp)^{k})$
and the variance is $O_{p}\left(  1/nhp\right)  $.

Let us introduce the notations $Z=\left(  p+1\right)  Y^{p}$ and $r_{n}\left(
x\right)  =\mathbb{E}\left(  Z/X=x\right)  $. The conditional distribution of $Y/X=x$
is supposed to be uniform on $\left[  0,g\left(  x\right)  \right]  $, so that
$r_{n}\left(  x\right)  =g^{p}\left(  x\right)  $. For fixed $p$ the method
for estimating $r_{n}\left(  x\right)  $ first consists in solving the
following minimization problem%
\begin{equation}
\underset{ \beta_{0},...,\beta_{k}}%
{\arg\min}\sum_{i=1}^{n}\left(  \left(  p+1\right)  Y_{i}^{p}-\sum_{j=0}%
^{k}\beta_{j}\left(  X_{i}-x\right)  ^{j}\right)  ^{2}K_{h}\left(
X_{i}-x\right)  \text{.} \label{1-0}%
\end{equation}
Then, denoting by
$\widehat{\mathbf{\beta}}=(  \widehat{\beta}%
_{0},...,\widehat{\beta}_{k})  ^{t}$ the solution of this least square
minimization, one considers $\widehat{\beta}_{0}$ as an estimate of
$r_{n}\left(  x\right)  =\mathbb{E}\left(  Z/X=x\right)  $. The originality and the
difficulty of our paper in contrast with these traditional lines is that here
$p=p_{n}\rightarrow\infty$ and that we consider $\widehat{\beta}_{0}^{1/p}$ as
an estimate of $g\left(  x\right)  .$ So we write $\widehat{g}_{n}\left(
x\right)  =\widehat{\beta}_{0}^{1/p}=\widehat{r}_{n}^{1/p}\left(  x\right)  $.
We refer to~\cite{Hall,Hall3,Keith} for other definitions of local
polynomials estimators (i.e. without high power transform)
and to~\cite{DST,Farrel,Gijbels2,Aragon,Cazals} for the estimation of frontier functions under monotonicity assumptions.

In order to get simplified matricial expressions, let us denote by $\mathbf{X}$ the
$n\times\left(  k+1\right)  $ matrix defined by the lines
 $[1,X_{i}-x,...,\left(  X_{i}-x\right)  ^{k}] _{i=1,...n}$. The
diagonal matrix of weights $diag\left\{  K_{h}\left(  X_{i}-x\right)
\right\}  $ is denoted by $\mathbf{W}$. We call \textit{design} the
vector$\ \mathcal{X}=(X_{1},...,X_{n})^{t}$ and we denote by $\mathcal{Z}$ the
vector $\left(  Z_{1},...,Z_{n}\right)^{t}$. Then the local regression
problem $\left(  \ref{1-0}\right)  $ can be rewritten as

\[
\widehat{\mathbf{\beta}}=\arg\min_{\beta}\left(  \mathcal{Z}\mathbf{-X\beta
}\right)  ^{t}\mathbf{W}\left(  \mathcal{Z}\mathbf{-X\beta}\right)  ,
\]
where
$\beta=(\beta_0,\dots,\beta_k)^t$.
It is well known from the weighted least square theory that
\[
\widehat{\mathbf{\beta}}=\left(  \mathbf{X}^{t}\mathbf{WX}\right)
^{-1}\mathbf{X}^{t}\mathbf{W}\mathcal{Z}.
\]
In particular, in the case $k=0$ we have
\[
\widehat{\mathbf{\beta}}=\widehat{\beta}_{0}=\sum_{i=1}^{n}Z_{i}K_{h}\left(
X_{i}-x\right) \left/\sum_{i=1}^{n}K_{h}\left(  X_{i}-x\right) \right. ,
\]
so we exactly find back the estimator $\widehat{g}_{n}\left(  x\right)
=\widehat{\beta}_{0}^{1/p}$ studied in~\cite{JMVA2}.
In order to give a general expression of $\widehat{r}_{n}\left(  x\right)$,
we adopt the notations of
Fan and Gijbels whose book~\cite{FanGij} will also serve of
reference for some preliminary results established in Section~\ref{preli}
(see also~\cite{RupWan} for a general multidimensional analysis).
Basing on this, the asymptotic conditional bias and variance
of the estimator are derived in Section~\ref{condi}
when $Y$ given $X=x$ is uniformly distributed.
This result is extended in Section~\ref{comple}, where the almost
complete convergence is proved without this uniformity assumption.
We conclude this paper by an illustration of the behavior
of our estimator on some finite sample situations in Section~\ref{simul}.
Technical lemmas are postponed to the appendix.

\section{Preliminary results}
\label{preli}

Let $x\in {\mathbb{R}}$. From now on, it is assumed that
the density function $f$ of $X_1$ is continuous at $x$ and that $f(x)>0$.
Besides, we suppose that there exists $g_{\min}>0$
such that, for all $t\in{\mathbb{R}}$, $g_{\min}\leq g(t)$.
Let $\mathbf{S}_{n}=\mathbf{X}^{t}\mathbf{WX}$ be the $\left(  k+1\right)
\times\left(  k+1\right)  $ matrix $\left[  S_{n,j+l}\right]  $ $_{0\leq
j,l\leq k}$ defined by
$$
S_{n,j}=\sum_{i=1}^{n}\left(  X_{i}-x\right)  ^{j} K_{h}\left(  X_{i}-x\right).
$$
 Similarly, denoting by $\mathbf{\Sigma}$ the
$n\times n$ diagonal matrix $diag\left\{  K_{h}^{2}\left(  X_{i}-x\right)
g^{2p}\left(  X_{i}\right)  \right\}  $, $\mathbf{S}_{n}^{\ast}~=\mathbf{X}%
^{t}\mathbf{\Sigma X}$ is the $\left(  k+1\right)  \times\left(  k+1\right)  $
matrix\ $[  S_{n,j+l}^{\ast}]_{0\leq j,l\leq k}$ with
$$
S_{n,j}^{\ast}=\sum_{i=1}^{n}\left(  X_{i}-x\right)  ^{j}K_{h}^{2}\left(
X_{i}-x\right)  g^{2p}\left(  X_{i}\right).
$$
Finally, we introduce the
matrices $\mathbf{S}=\left[  \mu_{j+l}\right]  _{0\leq j,l\leq k}$ and
$\mathbf{S}^{\ast}=$ $\left[  \nu_{j+l}\right]  _{0\leq j,l\leq k}$ with
$\mu_{j}=\int u^{j}K\left(  u\right)  du$ and $\nu_{j}=\int u^{j}K^{2}\left(
u\right)  du$.
Following roughly the same lines as Fan and Gijbels~\cite{FanGij},
we obtain asymptotic expressions for $S_{n,j}$ and $S_{n,j}^{\ast}$. The
first equality~(\ref{1-3}) is a standard result of the
theory and the second one~(\ref{1.4}) boils down to an easy
adaptation. Proofs are thus omitted.

\begin{proposition}
\label{prop1}
If $h\rightarrow0$ and $nh\rightarrow\infty$, then
\begin{equation}
S_{n,j}=nh^{j}f\left(  x\right)  \mu_{j}\left[  1+o_{p}\left(  1\right)
\right]  . \label{1-3}%
\end{equation}
If, moreover, $ph\rightarrow0$ we have for any $C_{1}$ function $g$
\begin{equation}
S_{n,j}^{\ast}=nh^{j-1}g^{2p}\left(  x\right)  f\left(  x\right)  \nu
_{j}\left[  1+o_{p}\left(  1\right)  \right]  \text{.} \label{1.4}%
\end{equation}
\end{proposition}
Let us now quote a general expression of the conditional bias of$\ \widehat{r}_{n}\left(x\right)$.
From Fan and Gijbels~\cite{FanGij},
and denoting by $e_{1}=(1,0,...,0)^{t}$ the first vector of the canonical basis of
$\mathbb{R}^{k+1}$, we have
\begin{eqnarray*}
r_{n}\left(  x\right)  &=&\beta_{0}=e_{1}^{t}\beta\mathbf{~=}~e_{1}%
^{t}\mathbf{S}_{n}^{-1}\mathbf{X}^{t}\mathbf{WX\beta,}\\
\widehat{r}_{n}\left(  x\right)  &=&\widehat{\beta}_{0}=e_{1}^{t}\widehat
{\mathbf{\beta}}=e_{1}^{t}\mathbf{S}_{n}^{-1}\mathbf{X}^{t}\mathbf{W}%
\mathcal{Z},
\end{eqnarray*}
so that
\begin{equation}
\mathbb{E}\left(  \widehat{r}_{n}\left(  x\right)  /\mathcal{X}\right)  -r_{n}\left(
x\right)  =e_{1}^{t}\mathbf{S}_{n}^{-1}\mathbf{X}^{t}\mathbf{W}\left[
\mathbb{E}\left(  \mathcal{Z}/\mathcal{X}\right)  -\mathbf{X\beta}\right]  .
\label{1-1}%
\end{equation}
In Appendix I we give a detailed proof of the following
\begin{proposition}
\label{prop2}
Suppose $g$ is a $C_{k+1}$ function. If $h\rightarrow0$,
$nh\rightarrow\infty$ and $ph\rightarrow0$, then
$$
\mathbb{E}\left(  \frac{\widehat
{r}_{n}\left(  x\right)  }{r_{n}\left(  x\right)  }-1/\mathcal{X}\right)
=O_{p}\left(  \left(  hp\right)  ^{k+1}\right).
$$
\end{proposition}
We now examine the conditional variance of
$\widehat{r}_{n}\left(  x\right)  $%
\[
\mathbb{V}\left(  \widehat{r}_{n}\left(  x\right)  /\mathcal{X}\right)  =e_{1}%
^{t}\mathbf{S}_{n}^{-1}\mathbf{X}^{t}\mathbb{V}\mathbf{\left(  \mathbf{W}%
\mathcal{Z}\mathbf{/}\mathcal{X}\right)  XS}_{n}^{-1}e_{1}.
\]
Taking into account of the independence of the pairs $\left(  X_{i},Y_{i}\right)
,\mathbb{V}\mathbf{\left(  \mathbf{W}\mathcal{Z}\mathbf{/}\mathcal{X}\right)  }$ is
the diagonal matrix $diag\left\{  K_{h}^{2}\left(  X_{i}-x\right)
\mathbb{V}(Z_{i}/X_{i}=x)\right\}  $. From the uniformity of the conditional
distribution of the $Y_{i}/X_{i}=x$, it is easily seen that $\mathbb{V}(Z_{i}%
/X_{i}=x)=\frac{p^{2}}{2p+1}g^{2p}\left(  x\right)  $, so that
\[
\mathbb{V}\left(  \widehat{r}_{n}\left(  x\right)  /\mathcal{X}\right)  =\frac{p^{2}%
}{2p+1}e_{1}^{t}\mathbf{S}_{n}^{-1}\mathbf{S}_{n}^{\ast}\mathbf{S}_{n}%
^{-1}e_{1}.
\]
Following the same lines as Fan and Gijbels~\cite{FanGij}, we
obtain the following asymptotic expression
\begin{proposition}
\label{prop3}
Suppose $g$ is a $C_{k+1}$ function. If $h\rightarrow0$,
$nh\rightarrow\infty$ and $ph\rightarrow0$, then
\[
\mathbb{V}\left(  \frac{\widehat{r}_{n}\left(  x\right)  }{r_{n}\left(  x\right)
}/\mathcal{X}\right)  =\frac{C}{f\left(  x\right)  }\frac{1}{nh}\frac{p^{2}%
}{2p+1}\left[  1+o_{p}\left(  1\right)  \right],
\]
where $C=e_{1}^{t}\mathbf{S}^{^{-1}}\mathbf{S}^{\ast}\mathbf{S}^{^{-1}}e_{1}$.
\end{proposition}
The proof of Proposition~\ref{prop3} is much easier than the one of
Proposition~\ref{prop2} and it thus omitted.

\section{Conditional bias and variance of $\widehat{g}_{n}\left(  x\right)  $}
\label{condi}

Here we present the main results of this paper and an outline of their
proofs. Many details and ancillary results are postponed to Appendix II.
Proofs are made under the assumption that $g$ is a $C_{k+1}$ function
and the system of conditions below
\[
H:%
\begin{bmatrix}
n\rightarrow\infty,~h\rightarrow0,~p\rightarrow\infty\\
nh\rightarrow\infty,~hp\rightarrow0\\
\left(  p/nh\right)  \log^{2}(nh)\sim\left(  hp\right)  ^{2k+2}%
\end{bmatrix}
.
\]
\begin{theorem}
\label{th4}
Suppose $H$ holds and $g$ is a $C_{k+1}$ function. Then, the asymptotic
conditional bias of the estimate is given by
$$
\mathbb{E}\left(  \frac{\widehat{g}_{n}\left(  x\right)  }{g\left(  x\right)  }-1/\mathcal{X}\right)
=O_{p}\left(  h\left(  hp\right)  ^{k}\right) .
$$
\end{theorem}

\begin{proof}
Let us write $w_{n}\left(  x\right)  =\widehat{r}_{n}\left(  x\right)
/r_{n}\left(  x\right)  -1$, so that $\widehat{g}_{n}\left(  x\right)
/g\left(  x\right)  =\left(  1+w_{n}\left(  x\right)  \right)  ^{1/p}$ and
define%
\begin{equation}
\label{defdelta}
\Delta_n=\left\vert \left(  1+w_{n}\left(  x\right)  \right)  ^{1/p}-\left(
1+\frac{w_{n}\left(  x\right)  }{p}\right)  \right\vert .
\end{equation}
Let $\alpha_{n}=\left(  p/nh\right)  ^{1/4}$. For sufficiently large $n$ we
have $\alpha_{n}<1/2$, and thus, Lemma~\ref{lem16} entails
\begin{equation}
\Delta_n\mathbf{1}\left\{  \left\vert w_{n}\left(  x\right)  \right\vert
<\alpha_{n}\right\}  <c_6\frac{1}{p}w_{n}^{2}\left(  x\right)  \label{2-0},
\end{equation}
which leads to the following bound%
\[
\mathbb{E}\left(  \Delta_n\mathbf{1}\left\{  \left\vert w_{n}\left(  x\right)
\right\vert <\alpha_{n}\right\}  /\mathcal{X}\right)  \leq c_6\frac{\alpha_{n}%
}{p}\mathbb{E}\left(  \left\vert w_{n}\left(  x\right)  \right\vert /\mathcal{X}%
\right)  \leq c_6\frac{\alpha_{n}}{p}\mathbb{E}^{1/2}\left(  w_{n}^{2}\left(  x\right)
/\mathcal{X}\right).
\]
Now, from Proposition~\ref{prop2} and Proposition~\ref{prop3},
\begin{align*}
\mathbb{E}\left(  w_{n}^{2}\left(  x\right)  /\mathcal{X}\right)   &  =\mathbb{V}\left(
\frac{\widehat{r}_{n}\left(  x\right)  }{r_{n}\left(  x\right)  }%
/\mathcal{X}\right)  +\mathbb{E}^{2}\left(  \frac{\widehat{r}_{n}\left(  x\right)
}{r_{n}\left(  x\right)  }-1/\mathcal{X}\right)  \\
&  =\frac{c_6}{f\left(  x\right)  }\frac{1}{nh}\frac{p^{2}}{2p+1}\left[
1+o_{p}\left(  1\right)  \right]  +O_{p}\left(  \left(  hp\right)
^{2k+2}\right)  \text{.}%
\end{align*}
Then, taking into account of $h\left(  hp\right)  ^{k}\sqrt{nhp}=\sqrt{\log
(nh)}\rightarrow\infty$, it follows that
\begin{align}
\mathbb{E}\left(  \Delta_n\mathbf{1}\left\{  \left\vert w_{n}\left(  x\right)
\right\vert <\alpha_{n}\right\}  /\mathcal{X}\right)   &  \leq c_6\frac
{\alpha_{n}}{p}\left[  O_{p}\left(  \frac{p}{nh}\right)  +O_{p}\left(  \left(
hp\right)  ^{2k+2}\right)  \right]  ^{1/2}\nonumber\\
&  =O_{p}\left(  \alpha_{n}/\sqrt{nhp}\right)  +O_{p}\left(  \alpha
_{n}h\left(  hp\right)  ^{k}\right) \nonumber\\
& =O_{p}\left(  \alpha_{n}h\left(
hp\right)  ^{k}\right).  \label{2-1}%
\end{align}
Besides, making use of Lemma~\ref{lem15}, we can write%
\[
\mathbb{E}\left(  \Delta_n\mathbf{1}\left\{  \left\vert w_{n}\left(  x\right)
\right\vert \geq\alpha_{n}\right\}  /\mathcal{X}\right)  \leq c_5\left(
\mathcal{X}\right)  \mathbb{P}\left\{  \left\vert w_{n}\left(  x\right)  \right\vert
\geq\alpha_{n}/\mathcal{X}\right\},
\]
and, from the triangular inequality,
\begin{align*}
\mathbb{P}\left\{  \left\vert w_{n}\left(  x\right)  \right\vert \geq\alpha
_{n}/\mathcal{X}\right\}   &  \leq \mathbb{P}\left\{  2\left\vert w_{n}\left(
x\right)  -\mathbb{E}\left(  w_{n}\left(  x\right)  /\mathcal{X}\right)  \right\vert
\geq\alpha_{n}/\mathcal{X}\right\}  \\
&  +\mathbb{P}\left\{  2\left\vert \mathbb{E}\left(  w_{n}\left(  x\right)  /\mathcal{X}\right)
\right\vert \geq\alpha_{n}/\mathcal{X}\right\}  .
\end{align*}
Recalling that
$$
\mathbb{E}\left(  w_{n}\left(  x\right)  /\mathcal{X}\right)  =\mathbb{E}\left(
\frac{\widehat{r}_{n}\left(  \mathcal{X}\right)  }{r_{n}\left(  \mathcal{X}%
\right)  }-1/\mathcal{X}\right)  =O_{p}\left(  \left(  hp\right)
^{k+1}\right),
$$
and noticing that $\left(  hp\right)  ^{k+1}/\alpha
_{n}=\left(  p/nh\right)  ^{1/4}\left(  \log(nh)\right)  ^{1/2}\rightarrow0$,
we conclude that the sequence $\mathbb{P}\left\{  2\left\vert \mathbb{E}\left(  w_{n}\left(
x\right)  /\mathcal{X}\right)  \right\vert \geq\alpha_{n}/\mathcal{X}\right\}
$ goes to $0$.
Moreover, remark that  $\mathbb{P}\left\{  2\left\vert \mathbb{E}\left(  w_{n}\left(  x\right)
/\mathcal{X}\right)  \right\vert \geq\alpha_{n}/\mathcal{X}\right\}  $ is a
$\left\{  0,1\right\}  $-valued random variable.
This means that for a
sufficient large $n$ depending on $\mathcal{X}$, we merely have
$$
\mathbb{P}\left\{
2\left\vert \mathbb{E}\left(  w_{n}\left(  x\right)  /\mathcal{X}\right)  \right\vert
\geq\alpha_{n}/\mathcal{X}\right\}  =0.
$$
Now, from Lemma~\ref{lem14},
\begin{align*}
&  \mathbb{P}\left(  2\left\vert w_{n}\left(  x\right)  -\mathbb{E}\left(  w_{n}\left(
x\right)  /\mathcal{X}\right)  \right\vert \geq\alpha_{n}/\mathcal{X}\right)
\\
&  =\mathbb{P}\left(  \left\vert \widehat{r}_{n}\left(  x\right)  -\mathbb{E}\left(  \widehat
{r}_{n}\left(  x\right)  /\mathcal{X}\right)  \right\vert \geq\frac{1}%
{2}\alpha_{n}r_{n}\left(  x\right)  /\mathcal{X}\right)  \\
&  \leq2\exp\left\{  -c_4\frac{nh}{p}\frac{\alpha_{n}^{2}}{4}\left[
1+o_{p}\left(  1\right)  \right]  \right\}\\
&  =2\exp\left\{  -\frac{c_4}{4}\sqrt
{nh/p\log^{2}(nh)}\left[  1+o_{p}\left(  1\right)  \right]  \log(nh)\right\}  \\
&  =\left(  nh\right)  ^{-\infty_{p}\left(  1\right)  },
\end{align*}
where $\infty_{p}\left(  1\right)  $ stands for a sequence going almost surely
to the infinity. We thus have at least%
\begin{equation}
\mathbb{E}\left(  \Delta_n\mathbf{1}\left\{  \left\vert w_{n}\left(  x\right)
\right\vert \geq\alpha_{n}\right\}  /\mathcal{X}\right)  =O_{p}\left(
1/nh\right).  \label{2-2}%
\end{equation}
Collecting $\left(  \ref{2-1}\right)$ and $\left(  \ref{2-2}\right)  $ yields
\[
\mathbb{E}\left(  \Delta_n/\mathcal{X}\right)  =O_{p}\left(  \alpha_{n}h\left(
hp\right)  ^{k}\right)  +O_{p}\left(  1/nh\right).
\]
From%
\[
\left\vert \mathbb{E}\left(  \frac{\widehat{g}_{n}\left(  x\right)  }{g\left(
x\right)  }-1/\mathcal{X}\right)  -\frac{1}{p}\mathbb{E}\left(  w_{n}\left(  x\right)
/\mathcal{X}\right)  \right\vert \leq \mathbb{E}\left(  \Delta_n/\mathcal{X}\right)
\]
and Proposition~\ref{prop2},  we obtain
\begin{align}
\mathbb{E}\left(  \frac{\widehat{g}_{n}\left(  x\right)  }{g\left(  x\right)
}-1/\mathcal{X}\right)   &  =\frac{1}{p}\mathbb{E}\left(  w_{n}\left(  x\right)
/\mathcal{X}\right)  +O_{p}\left(  \alpha_{n}h\left(  hp\right)  ^{k}\right)
+O_{p}\left(  1/nh\right)  \nonumber\\
&  =O_{p}\left(  h\left(  hp\right)  ^{k}\right)  +O_{p}\left(  1/nh\right)
.\label{2-3}%
\end{align}
Finally, since $h\left(  hp\right)  ^{k}nh=\left(  nh/p\right)  \left(
hp\right)  ^{k+1}=\sqrt{nh/p}\log(nh)\rightarrow\infty$, expansion~$\left(
\ref{2-3}\right)  $ reduces to%
\[
\mathbb{E}\left(  \frac{\widehat{g}_{n}\left(  x\right)  }{g\left(  x\right)
}-1/\mathcal{X}\right)  =O_{p}\left(  h\left(  hp\right)  ^{k}\right),
\]
and the conclusion follows.
\end{proof}

\begin{theorem}
Suppose $H$ holds and $g$ is a $C_{k+1}$ function. Then, the asymptotic
conditional variance of the estimate is given by
$$
\mathbb{V}\left(  \frac
{\widehat{g}_{n}\left(  x\right)  }{g\left(  x\right)  }-1/\mathcal{X}%
\right)  =O_{p}\left(  \frac{1}{nhp}\right).
$$
\end{theorem}

\begin{proof}
Introducing%
\[
\delta=\frac{\widehat{g}_{n}\left(  x\right)  }{g\left(  x\right)
}-1-\frac{w_{n}\left(  x\right)  }{p},
\]
we have%
\[
\mathbb{V}\left(  \frac{\widehat{g}_{n}\left(  x\right)  }{g\left(  x\right)
}/\mathcal{X}\right)  \leq\frac{2}{p^{2}}\mathbb{V}\left(  w_{n}\left(  x\right)
/\mathcal{X}\right)  +2\mathbb{V}\left(  \delta/\mathcal{X}\right).
\]
The first term is bounded using Proposition~\ref{prop3}:
\[
\frac{1}{p^{2}}\mathbb{V}\left(  w_{n}\left(  x\right)  /\mathcal{X}\right)
=\frac{1}{p^{2}}\mathbb{V}\left(  \frac{\widehat{r}_{n}\left(  x\right)  }%
{r_{n}\left(  x\right)  }/\mathcal{X}\right)  =O_{p}\left(  \frac{1}%
{nhp}\right).
\]
Second,
\[
\mathbb{V}\left(  \delta/\mathcal{X}\right)  \leq \mathbb{E}\left(  \delta^{2}/\mathcal{X}%
\right)  =\mathbb{E}\left(  \Delta_n^{2}/\mathcal{X}\right),
\]
and (\ref{2-0}) yields, for sufficiently large $n$,
\[
\Delta_n^{2}\mathbf{1}\left\{  \left\vert w_{n}\left(  x\right)  \right\vert
<\alpha_{n}\right\}  <c_6^{2}\frac{1}{p^{2}}w_{n}^{4}\left(  x\right)
<c_6^{2}\frac{\alpha_{n}^{2}}{p^{2}}w_{n}^{2}\left(  x\right),
\]
which entails%
\begin{align*}
\mathbb{E}\left(  \Delta_n^{2}\mathbf{1}\left\{  \left\vert w_{n}\left(  x\right)
\right\vert <\alpha_{n}\right\}  /\mathcal{X}\right)   &  \leq c_6^{2}%
\frac{\alpha_{n}^{2}}{p^{2}}\mathbb{E}\left(  w_{n}^{2}\left(  x\right)  /\mathcal{X}%
\right) \\
&  =\frac{\alpha_{n}^{2}}{p^{2}}\left[  O_{p}\left(  \frac{p}{nh}\right)
+O_{p}\left(  \left(  hp\right)  ^{2k+2}\right)  \right]  .
\end{align*}
In a similar way as in the previous proof, one has
\begin{align*}
\mathbb{E}\left(  \Delta_n^{2}\mathbf{1}\left\{  \left\vert w_{n}\left(  x\right)
\right\vert \geq\alpha_{n}\right\}  /\mathcal{X}\right)   &  \leq c_5\left(
{\mathcal{X}}\right)  \mathbb{P}\left\{  \left\vert w_{n}\left(  x\right)  \right\vert \geq
\alpha_{n}/\mathcal{X}\right\} \\
&  =\left(  nh\right)  ^{-\infty_{p}\left(  1\right)  }=O_{p}\left(  \frac
{1}{n^{2}h^{2}}\right).
\end{align*}
It follows that
\[
\mathbb{E}\left(  \Delta_n^{2}/\mathcal{X}\right)  =O_{p}\left(  \frac{\alpha_{n}^{2}%
}{nhp}\right)  +O_{p}\left(  \alpha_{n}^{2}h^{2}\left(  hp\right)
^{2k}\right)  +O_{p}\left(  \frac{1}{n^{2}h^{2}}\right),
\]
and, taking account of $\alpha_{n}=\left(  p/nh\right)  ^{1/4}$ and
$nh/p\log^{2}(nh)\rightarrow\infty$,
we finally obtain
\begin{align*}
\mathbb{V}\left(  \frac{\widehat{g}_{n}\left(  x\right)  }{g\left(  x\right)
}/\mathcal{X}\right)   &  =O_{p}\left(  \frac{1}{nhp}\right)  +O_{p}\left(
\alpha_{n}^{2}h^{2}\left(  hp\right)  ^{2k}\right)  +O_{p}\left(  \frac
{1}{n^{2}h^{2}}\right) \\
&  =O_{p}\left(  \frac{1}{nhp}\right),
\end{align*}
and the result is proved.
\end{proof}

\begin{remark} Under the assumptions of the above theorems,
the conditional mean square error is given by
\begin{align*}
\mathbb{E}\left[\left( \frac{\widehat{g}_{n}\left(  x\right)
}{g\left(  x\right)  }-1\right)^2/\mathcal{X} \right]
&=  \mathbb{V}\left(  \frac{\widehat{g}_{n}\left(  x\right)  }{g\left(  x\right)
}-1/\mathcal{X}\right)  +\mathbb{E}^{2}\left(  \frac{\widehat{g}_{n}\left(  x\right)
}{g\left(  x\right)  }-1/\mathcal{X}\right) \\
&  =O_{p}\left(  \frac{1}{nhp}\right)  +O_{p}\left(  h^{2}\left(  hp\right)
^{2k}\right) \\
&  =O_{p}\left(  h^{2}\left(  hp\right)  ^{2k}\right)  =O_{p}\left(  \frac
{1}{nhp}\log^{2}(nh)\right).
\end{align*}
\end{remark}
Under condition H, the ratio between the bias and variance terms
is asymptotically equivalent to $\log^2(nh)$. Thus, bias and variance of
$\widehat{g}_{n}\left(  x\right)$ are approximatively of same order, up to this
logarithmic factor.

\section{Convergence of $\widehat{g}_{n}\left(  x\right)  $ under
general conditions}
\label{comple}

In this section, the almost complete convergence of  $\widehat{g}_{n}\left(  x\right)  $
is established without any assumption on the conditional distribution of $Y$ given $X$.

\begin{theorem}
If  $h\rightarrow0$, $p\rightarrow\infty$, and $nh/\log n\rightarrow\infty$,
then $\widehat{g}_{n}\left(  x\right)  $ converges to $g\left(  x\right)  $
almost completely.
\end{theorem}

\begin{proof}
Introducing
\[
a\left(  X_{i}\right)  =\frac{1}{nf\left(  x\right)  }K_{h}\left(
X_{i}-x\right)  \sum_{j=0}^{k}u_{j}\left(  \frac{X_{i}-x}{h}\right)  ^{j}%
\]
and$\ \widehat{s}_{n}\left(  x\right)  =\sum\nolimits_{i=1}^{n}a\left(
X_{i}\right)  Z_{i}$, Lemma~\ref{lem9} entails that $\widehat{r}_{n}$
can be rewritten as
\[
\widehat{r}_{n}\left(  x\right)  =\widehat{s}_{n}\left(  x\right)
+\widehat{s}_{n}\left(  x\right)  o_{p}\left(  1\right).
\]
Thus, with $2\eta=\varepsilon/g\left(  x\right)  $ and since
$[1+o_{p}(1)]^{1/p}=[  1+o_{p}(1)]  $, we have
\begin{align*}
\left\{  \left\vert \widehat{g}_{n}\left(  x\right)  -g\left(  x\right)
\right\vert >\varepsilon\right\}   &  =\left\{  \left\vert \frac{\widehat
{r}_{n}^{1/p}\left(  x\right)  }{g\left(  x\right)  }-1\right\vert
>2\eta\right\} \\
&  \subseteq\left\{  \left\vert \frac{\widehat{s}_{n}^{1/p}\left(  x\right)  }{g\left(
x\right)  }-1\right\vert >\eta\right\}  \cup\left\{  \left\vert \frac
{\widehat{s}_{n}^{1/p}\left(  x\right)  }{g\left(  x\right)  }o_{p}\left(
1\right)  \right\vert >\eta\right\},
\end{align*}
with
\[
\frac{\widehat{s}_{n}^{1/p}\left(  x\right)  }{g\left(  x\right)  }=\left[
\sum_{i=1}^{n}a\left(  X_{i}\right)  \left(  p+1\right)  \left[
\frac{Y_{i}}{g\left(  x\right)  }\right]  ^{p}\right]  ^{1/p}.
\]
Since $\left(  1+p\right)  ^{1/p}\rightarrow1$, let us focus on
\[
T_{n}\left(  x\right)  =\left[  \sum_{i=1}^{n}a\left(  X_{i}\right)
\left[  \frac{Y_{i}}{g\left(  x\right)  }\right]  ^{p}\right]  ^{1/p}.
\]
Taking $0<\delta<\eta$, $\left\vert X_{i}-x\right\vert <h$ implies
$Y_{i}-g\left(  x\right)  \left(  1+\delta\right)  <0$ and thus
\begin{align*}
T_{n}\left(  x\right)   &  =\left[  \sum_{i=1}^{n}a\left(
X_{i}\right)  \left[  \frac{Y_{i}}{g\left(  x\right)  }\right]  ^{p}%
\mathbf{1}\left\{  Y_{i}<g\left(  x\right)  \left(  1+\delta\right)  \right\}
\right]  ^{1/p}\\
&  \leq\left(  1+\delta\right)  \left[  \sum_{i=1}^{n}a\left(
X_{i}\right)  \mathbf{1}\left\{  Y_{i}<g\left(  x\right)  \left(
1+\delta\right)  \right\}  \right]  ^{1/p}.
\end{align*}
Moreover, since, for $n$ large enough, $\left(  \frac{1+\eta}{1+\delta
}\right)  ^{p}>2$, it follows that
\begin{align*}
&\left\{  T_{n}\left(  x\right)  >1+\eta\right\}\\
   &  \subseteq\left\{
\sum_{i=1}^{n}a\left(  X_{i}\right)  \mathbf{1}\left\{
Y_{i}<g\left(  x\right)  \left(  1+\delta\right)  \right\}  >2\right\} \\
&  =\left\{  \frac{1}{n}\sum_{i=1}^{n}K_{h}\left(  X_{i}-x\right)
\sum_{j=0}^{k}u_{j}\left(  \frac{X_{i}-x}{h}\right)  ^{j}\mathbf{1}\left\{
Y_{i}<g\left(  x\right)  \left(  1+\delta\right)  \right\}  \frac{1}{f\left(
x\right)  }>2\right\}.
\end{align*}
Now, the only difference with the proof of Theorem~1 in~\cite{JMVA2} is
that the positive kernel $K\left(  x\right)  $ is replaced by the signed
kernel of higher order $K\left(  x\right)  \sum_{j=0}^{k}u_{j}x^{j}$.
The case
$\left\{  T_{n}\left(  x\right)  <1-\eta\right\}  $ is easily treated in a
similar way.
\end{proof}

\section{Numerical experiments}
\label{simul}

Here, the following model is simulated:
$X$ is uniformly distributed on $[0,1]$ and $Y$ given $X=x$
is distributed on $[0,g(x)]$ such that
\begin{equation}
\label{proba}
\mathbb{P}(Y>y|X=x)=\left(1-\frac{y}{g(x)}\right)^\gamma,
\end{equation}
with $\gamma>0$. This conditional survival distribution function
belongs to the Weibull domain of attraction, with extreme value
index $-\gamma$, see~\cite{EMBR} for a review on this topic.
In the following, three exponents are used $\gamma\in\{1,2,3\}$.
The case $\gamma=1$ corresponds to the situation where $Y$ given $X=x$
is uniformly distributed on $[0,g(x)]$. The larger $\gamma$ is,
the smaller the probability~(\ref{proba}) is, when $y$ is close to
the frontier $g(x)$.
The frontier function is given by
$$
g(x)=(1/10+\sin(\pi x))\left(11/10-\exp\left(-64(x-1/2)^2\right)/2\right).
$$
The following kernel is chosen
$$
K(t)=\cos^2(\pi t /2)\mathbf{1}\{t\in[-1,1]\},
$$
and we limit ourselves to first order local polynomials, i.e. $k=1$.
In this case, to fulfill assumption H, one can choose
$h= c_h n^{-1/2} (\log n)^{1+3\tau/5}$ and $p= c_p n^{1/2} (\log n)^{-1-\tau}$
where $\tau$, $c_h$ and $c_p$ are positive constants.
In practice, since the choice of $c_h$ and $c_p$ is more important than
the logarithmic factors, we use
$h=4\hat\sigma(X) n^{-1/2}$ and $p=n^{1/2}$.
The multiplicative constants are chosen heuristically.
The dependence with respect to the standard-deviation of $X$
is inspired from the density estimation case. The scale factor 4 was
chosen on the basis of intensive simulations, similarly to~\cite{JMVA2}.

\noindent The experiment involves four steps:
\begin{itemize}
\item First, $m=500$ replications of a $500-$ sample are simulated.
\item For each of the $m$ previous set of points, the
frontier estimator $\hat g_n$ is computed for $k=1$.
\item The $m$ associated $L_1$ distances to $g$ are evaluated on a grid.
\item The smallest and largest $L_1$ errors are recorded.
\end{itemize}
\noindent Results are depicted on Figure~\ref{fctludo1}--\ref{fctludo3},
where the best situation
(i.e. the estimation corresponding to the smallest $L_1$ error)
and the worst situation
(i.e. the estimation corresponding to the largest $L_1$ error)
are represented.
Worst situations are obtained when
no points were simulated at the upper boundary of the support.
To overcome this problem, the normalizing constant $(p+1)$
in~(\ref{1-0}) could be modified as in~\cite{JMVA2}, Section~6 to
deal with some particular parametric models of $Y$ given $X=x$.

\section*{Appendix I: Conditional bias of $\widehat{r}_{n}\left(  x\right)  $}

In this appendix, we provide a proof of Proposition~\ref{prop2}.
From $\left(  \ref{1-1}\right)  $, we have
\[
\mathbb{E}\left(  \frac{\widehat{r}_{n}\left(  x\right)  }{r_{n}\left(  x\right)
}-1/\mathcal{X}\right)  =g^{-p}\left(  x\right)  e_{1}^{t}\mathbf{S}_{n}%
^{-1}\mathbf{X}^{t}\mathbf{W}\left[  \mathbb{E}\left(  \mathcal{Z}/\mathcal{X}\right)
-\mathbf{X\beta}\right],
\]
where the term $\mathbb{E}\left(  \mathcal{Z}/\mathcal{X}\right)  -\mathbf{X\beta}$ can
be rewritten as
\[
\left(r_{n}\left(  X_{1}\right)  -\sum_{j=0}^{k}\beta_{j}\left(  X_{1}-x\right)
^{j},...,~r_{n}\left(  X_{n}\right)  -\sum_{j=0}^{k}\beta_{j}\left(
X_{n}-x\right)  ^{j}\right).
\]
Taylor-Lagrange formula with $\beta_{j}=\frac{1}{j!}\frac
{\partial^{j}g^{p}}{\partial x^{j}}\left(  x\right)  $ and $0<\theta<1$ yields
\[
g^{p}\left(  u\right)  =\sum_{j=0}^{k}\beta_{j}\left(  u-x\right)
^{j}+\left(  u-x\right)  ^{k+1}\frac{1}{k+1!}\frac{\partial^{k+1}g^{p}%
}{\partial x^{k+1}}\left(  x+\theta\left(  u-x\right)  \right)  ,
\]
so that, we can derive, for $0<\theta_{i}<1$ depending on $X_{i}$,
the following expansion
\[
r_{n}\left(  X_{i}\right)  -\sum_{j=0}^{k}\beta_{j}\left(  X_{i}-x\right)
^{j}=\left(  X_{i}-x\right)  ^{k+1}\frac{1}{k+1!}\frac{\partial^{k+1}g^{p}%
}{\partial x^{k+1}}\left(  x+\theta_{i}\left(  X_{i}-x\right)  \right)  .
\]
Since $K$ has a bounded support, we have $K_{h}\left(
X_{i}-x\right)  =0$ for $\left\vert X_{i}-x\right\vert >h$. If $\left\vert
X_{i}-x\right\vert \leq h$ and $0<\theta_{i}<1$,
under the conditions $h\rightarrow0$ and $ph\rightarrow
0$, Lemma~\ref{lem11} yields
\begin{align*}
&  \left(  X_{i}-x\right)  ^{j}K_{h}\left(  X_{i}-x\right)  \frac
{\partial^{k+1}g^{p}}{\partial x^{k+1}}\left(  x+\theta_{i}\left(
X_{i}-x\right)  \right)  \\
&  =\left(  X_{i}-x\right)  ^{j}K_{h}\left(  X_{i}-x\right)  \left[
\frac{\partial^{k+1}g^{p}}{\partial x^{k+1}}\left(  x\right)  +\sum
_{j=1}^{k+1}p^{j}g^{p-j}\left(  x\right)  o\left(1\right)  \right].
\end{align*}
Thus, recalling that $S_{n,j}=\sum_{i=1}^{n}\left(  X_{i}-x\right)  ^{j}%
K_{h}\left(  X_{i}-x\right)  $ and $\beta_{j}=\frac{1}{j!}\frac{\partial
^{j}g^{p}}{\partial x^{j}}\left(  x\right)  $,   the $(k+1)$%
-dimensional vector $\mathbf{X}^{t}\mathbf{W}\left(  \mathbb{E}\left(
\mathcal{Z}/\mathcal{X}\right)  -\mathbf{X\beta}\right)  $ can be
rewritten as
\begin{align*}
&  \left[  \sum_{i=1}^{n}\frac{\left(  X_{i}-x\right)  ^{k+j}}{k+1!}%
K_{h}\left(  X_{i}-x\right)  \frac{\partial^{k+1}g^{p}}{\partial x^{k+1}%
}\left(  x+\theta_{i}\left(  X_{i}-x\right)  \right)  \right]  _{j=1,...,k+1}%
\\
&  =\left[  \beta_{k+1}S_{n,k+j}+\frac{1}{k+1!}S_{n,k+j+1}\sum_{j=1}%
^{k+1}p^{j}g^{p-j}\left(  x\right)  o\left(1\right)  \right]
_{j=1,...,k+1}.
\end{align*}
Introducing the vector $c_{n}=\left(  S_{n,k+1},...,S_{n,2k+1}%
\right)  ^{t}$, we obtain%
\[
\mathbf{X}^{t}\mathbf{W}\left(  \mathbb{E}\left(  \mathcal{Z}/\mathcal{X}\right)
-\mathbf{X\beta}\right)  =\beta_{k+1}c_{n}+\frac{1}{k+1!}c_{n}\sum_{j=1}%
^{k+1}p^{j}g^{p-j}\left(  x\right)  o\left(1\right),
\]
and, returning to the bias of $\widehat{r}_{n}\left(  x\right)$,
\begin{equation}
\label{bias}
\mathbb{E}\left(  \frac{\widehat{r}_{n}\left(  x\right)  }{r_{n}\left(  x\right)
}-1/\mathcal{X}\right)  =g^{-p}\left(  x\right)  \beta_{k+1}e_{1}%
^{t}\mathbf{S}_{n}^{-1}c_{n}+\frac{1}{k+1!}e_{1}^{t}\mathbf{S}_{n}^{-1}%
c_{n}\sum_{j=1}^{k+1}p^{j}g^{-j}\left(  x\right)  o\left(1\right).
\end{equation}
Recalling that $\mathbf{S}_{n}=nf\left(  x\right)  \mathbf{H}\mathbf{SH}%
\left[  1+o_{p}\left(  1\right)  \right]  $ with $ \mathbf{H}=diag(1,h,\dots,h^k)$, we have
\[
\mathbf{S}_{n}^{-1}=\frac{1}{nf\left(  x\right)  }\mathbf{H}^{-1}%
\mathbf{S}^{-1}\mathbf{H}^{-1}\left[  1+o_{p}\left(  1\right)  \right].
\]
Besides, introducing the vector $c=\left(  \mu_{k+1},...,\mu_{2k+1}\right)$,
the asymptotic expression of $S_{n,j}$ established in Proposition~\ref{prop1} entails
\[
c_{n}=nh^{k+1}f\left(  x\right)  \mathbf{H}c\left[  1+o_{p}\left(  1\right)
\right]  .
\]
Let us first focus on the first term of the bias expansion~(\ref{bias}):
\begin{align*}
g^{-p}\left(  x\right)  e_{1}^{t}\mathbf{S}_{n}^{-1}\beta_{k+1}c_{n}  &
=g^{-p}\left(  x\right)  \frac{1}{nf\left(  x\right)  }\beta_{k+1}%
nh^{k+1}f\left(  x\right)  e_{1}^{t}\mathbf{H}^{-1}\mathbf{S}^{-1}%
\mathbf{H}^{-1}\mathbf{H}c\left[  1+o_{p}\left(  1\right)  \right] \\
&  =g^{-p}\left(  x\right)  h^{k+1}\beta_{k+1}e_{1}^{t}\mathbf{S}^{-1}c\left[
1+o_{p}\left(  1\right)  \right],
\end{align*}
and using the expression of $\frac{\partial^{k}g^{p}}{\partial x^{k}}$ in
$\left(  \ref{4-1}\right)$, we have
\[
g^{-p}\left(  x\right)  \beta_{k+1}=\sum_{j=1}^{k+1}\frac{p!}{\left(
p-j\right)  !}g^{-j}\left(  x\right)  \phi_{\substack{j\\}}\left(  x\right)
=O\left(  p^{k+1}\right)  ,
\]
leading to
\begin{equation}
\label{bias1}
g^{-p}\left(  x\right)  e_{1}^{t}\mathbf{S}_{n}^{-1}\beta_{k+1}c_{n}=e_{1}%
^{t}\mathbf{S}^{-1}cO_{p}\left(  \left(  hp\right)  ^{k+1}\right)
=O_{p}\left(  \left(  hp\right)  ^{k+1}\right).
\end{equation}
Let us now consider the second term in~(\ref{bias}):
\begin{align*}
\frac{1}{k+1!}e_{1}^{t}\mathbf{S}_{n}^{-1}c_{n}\sum_{j=1}^{k+1}p^{j}%
g^{-j}\left(  x\right)  o\left(1\right)
&  =e_{1}^{t}\mathbf{S}_{n}^{-1}c_{n}p^{k+1}o\left(1\right) \\
&  =\frac{1}{nf\left(  x\right)  }e_{1}^{t}\mathbf{S}^{-1}\mathbf{H}^{-1}%
c_{n}p^{k+1}o_{p}\left(1\right)
\end{align*}
Expanding $\mathbf{H}^{-1}c_{n}$ we have
\[
\mathbf{H}^{-1}c_{n}=\mathbf{H}^{-1}nh^{k+1}f\left(  x\right)  \mathbf{H}%
c\left[  1+o_{p}\left(  1\right)  \right]  =nh^{k+1}f\left(  x\right)
c\left[  1+o_{p}\left(  1\right)  \right],
\]
which entails
\begin{equation}
\label{bias2}
\frac{1}{nf\left(  x\right)  }e_{1}^{t}\mathbf{S}^{-1}\mathbf{H}^{-1}%
c_{n}p^{k+1}o_{p}\left(1\right)  =e_{1}^{t}\mathbf{S}^{-1}co_{p}\left(
\left(  hp\right)  ^{k+1}\right)  =o_{p}\left(  \left(  hp\right)
^{k+1}\right).
\end{equation}
Collecting (\ref{bias1}) and (\ref{bias2}),
we obtain the announced result
\[
\mathbb{E}\left(  \frac{\widehat{r}_{n}\left(  x\right)  }{r_{n}\left(  x\right)
}-1/\mathcal{X}\right)  =O_{p}\left(  \left(  hp\right)  ^{k+1}\right).
\]

\section*{Appendix II: Auxiliary results}

We first quote a Bernstein-Fr\'{e}chet inequality adapted to our framework.
\begin{lemma}
\label{lem8}
Let $X_{1},...,X_{n}$ independent centered random variables such that for each
positive integers $i$ and $k$, and for some positive constant $C$, we have
\begin{equation}
\label{condBF}
\mathbb{E}\left\vert X_{i}\right\vert ^{k}\leq k!C^{k-2}\mathbb{E} X_{i}^{2}.
\end{equation}
Then, for every $\varepsilon>0$, we have
$$
\mathbb{P}\left(  \left\vert \sum_{i=1}^{n}X_{i}\right\vert >\varepsilon
\sqrt{\sum_{i=1}^{n}\mathbb{E} X_{i}^{2}}\right)  \leq2\exp\left\{
-\frac{\varepsilon^{2}}{4+2\varepsilon C/\sqrt{\sum_{i=1}^{n}%
\mathbb{E} X_{i}^{2}}}\right\}.
$$
\end{lemma}
The proof is standard. Note that condition~(\ref{condBF}) is verified
under the boundedness assumption
$\forall i\geq1$,
$\left\vert X_{i}\right\vert  \leq C$.
In the next lemma, an asymptotic expansion of the estimated regression function $\widehat{r}_{n}\left(  x\right)  =e_{1}^{t}\mathbf{S}_{n}^{-1}X^{t}\mathbf{W}\mathcal{Z}$ is introduced.
\begin{lemma}
\label{lem9}
The estimated regression function $\widehat{r}_{n}\left(  x\right)$
can be rewritten as
$$
\widehat{r}_{n}\left(  x\right)  =\frac{1}{nf\left(  x\right)  }%
\sum_{i=1}^{n}Z_{i}~K_{h}\left(  X_{i}-x\right)  \sum_{j=0}^{k}%
u_{j}\left(  \frac{X_{i}-x}{h}\right)  ^{j}\left[  1+o_{p}\left(  1\right)
\right],
$$
where $(u_{0,}u_{1},...,u_{k})$ is the first line of the matrix $\mathbf{S}%
^{^{-1}}$.
\end{lemma}

\begin{proof}
It is known from the local polynomial fitting theory that $\widehat{r}%
_{n}\left(  x\right)  =\widehat{\beta}_{0}=e_{1}^{t}\mathbf{S}_{n}^{-1}%
$\textbf{$x$}$^{t}\mathbf{W}\mathcal{Z}$ admits the following asymptotic expression%
\[
\widehat{r}_{n}\left(  x\right) =\frac{1}{nhf\left(  x\right)  }\sum_{i=1}^{n}Z_{i}~K_{0}^{\ast
}\left(  \frac{X_{i}-x}{h}\right)  \left[  1+o_{p}\left(  1\right)  \right],
\]
where%
\[
K_{0}^{\ast}\left(  t\right)  =e_{1}^{t}\mathbf{S}^{-1}\left(  1,t,...,t^{k}%
\right)  K\left(  t\right)
\]
is the so-called \textit{equivalent kernel}, see~\cite{FanGij}.
The remaining of the proof consists in
explicitly writing this equivalent kernel. It is worth noticing that
$o_{p}\left(  1\right)  $ depends exclusively of the design $\mathcal{X}$.
\end{proof}

\noindent The following lemma is dedicated to the control of the local
variations of the derivatives of $g^p$, when $p\to\infty$, on a neighborhood of size $h$.
\begin{lemma}
\label{lem11}
Suppose $g$ is a  $C_{k+1}$ function with $k<p$.
If, moreover, $ph\rightarrow0$ and $\left\vert u-v\right\vert \leq h$, then
\[
\frac{\partial^{k+1}g^{p}}{\partial x^{k+1}}\left(  v\right)  =\frac
{\partial^{k+1}g^{p}}{\partial x^{k+1}}\left(  u\right)  +\sum_{j=1}%
^{k+1}\frac{p!}{\left(  p-j\right)  !}g^{p-j}\left(  u\right)  o(1).
\]
\end{lemma}

\begin{proof}
From $\frac{\partial g^{p}}{\partial x}=pg^{p-1}\frac{\partial g}{\partial x}$
and a recurrence argument it is easily checked that
\begin{equation}
\frac{\partial^{k+1}g^{p}}{\partial x^{k+1}}=\sum_{j=1}^{k+1}%
\frac{p!}{\left(  p-j\right)  !}g^{p-j}\phi_j,\label{4-1}%
\end{equation}
where the $\phi_{j}$ are continuous functions. The triangular inequality
entails
\begin{align*}
\left\vert g^{p-j}\left(  u\right)  \phi_{j}\left(  u\right)  -g^{p-j}\left(
v\right)  \phi_{j}\left(  v\right)  \right\vert
&\leq\left\vert g^{p-j}\left(
u\right)  \right\vert \left\vert \phi_{j}\left(  u\right)  -\phi_{j}\left(
v\right)  \right\vert \\
&+\left\vert \phi_{j}\left(  v\right)  \right\vert
\left\vert g^{p-j}\left(  u\right)  -g^{p-j}\left(  v\right)  \right\vert,
\end{align*}
and, from Lemma~\ref{lem10}, if $ph\rightarrow0$ and $\left\vert
u-v\right\vert \leq h$ we get, for sufficiently large $n$,
\[
\left\vert g^{p-j}\left(  u\right)  \phi_{j}\left(  u\right)  -g^{p-j}\left(
v\right)  \phi_{j}\left(  v\right)  \right\vert \leq \left\vert
g^{p-j}\left(  u\right)  \right\vert o(1)+c_1 D_{j}\left\vert g^{p-j}\left(
u\right)  \right\vert \left(  p-j\right)  h,
\]
where $D_{j}= \sup_{s\in\left[  u,v\right]  }| \phi_{j}(s)|$.
Thus,
\begin{align*}
g^{p-j}\left(  v\right)  \phi_{j}\left(  v\right)  &=g^{p-j}\left(  u\right)
\phi_{j}\left(  u\right)  +g^{p-j}\left(  u\right)  (O\left(  ph\right)+o(1))\\
 &=g^{p-j}\left(  u\right)
\phi_{j}\left(  u\right)  +g^{p-j}\left(  u\right)  o(1),
\end{align*}
and replacing in~(\ref{4-1}) yields
\begin{align*}
\frac{\partial^{k+1}g^{p}}{\partial x^{k+1}}\left(  v\right)   &
=\sum_{j=1}^{k+1}\frac{p!}{\left(  p-j\right)  !}g^{p-j}\left(
v\right)  \phi_{\substack{j\\}}\left(  v\right)  \\
&  =\sum_{j=1}^{k+1}\frac{p!}{\left(  p-j\right)  !}g^{p-j}\left(
u\right)  \phi_{\substack{j\\}}\left(  u\right)  +\sum_{j=1}%
^{k+1}\frac{p!}{\left(  p-j\right)  !}g^{p-j}\left(  u\right) o(1) \\
  &
=\frac{\partial^{k+1}g^{p}}{\partial x^{k+1}}\left(  u\right)  +
\sum_{j=1}^{k+1}\frac{p!}{\left(  p-j\right)  !} g^{p-j}\left(  u\right) o(1),
\end{align*}
and the result is proved.
\end{proof}

\noindent Let us consider, for $i=1,\dots,n$ the random variables defined by
\[
\xi_{i}=\frac{nh}{pg^{p}\left(  x\right)  }a\left(  X_{i}\right)  \left(
\left(  p+1\right)  Y_{i}^{p}-g^{p}\left(  X_{i}\right)  \right).
\]
The next two lemmas are preparing the application of the
Bernstein-Fr\'echet inequality given in Lemma~\ref{lem8}.
First, it is established that the $\xi_i$ are bounded
random variables. Second, a control of the conditional
variance $\mathbb{V}\left(  \sum\nolimits_{i=1}^{n}\xi_{i}/\mathcal{X}\right)$
is provided.
\begin{lemma}
\label{lem12}
There exists a positive constant $c_2$ such that
$\left\vert \xi_{i}\right\vert \leq c_2$ for all $i=1,\dots,n$.
\end{lemma}

\begin{proof}
Since the kernel $K$ is bounded and has bounded support,
it is easily seen that $a\left(  X_{i}\right)  =0$ if $\left\vert
X_{i}-x\right\vert >h$ and that $a\left(  X_{i}\right)  =O\left(  \frac{1}%
{nh}\right)  $ uniformly in $i$. Noticing that $Y_{i}^{p}\leq$ $g^{p}\left(
X_{i}\right)  $ and using Lemma~\ref{lem10}, we get%
\begin{align}
\left\vert \xi_{i}\right\vert  &  =\frac{nh}{pg^{p}\left(  x\right)
}\left\vert a\left(  X_{i}\right)  \right\vert \left\vert \left(  \left(
p+1\right)  Y_{i}^{p}-g^{p}\left(  X_{i}\right)  \right)  \right\vert
\nonumber\\
&  \leq\frac{nh}{pg^{p}\left(  x\right)  }\left\vert a\left(  X_{i}\right)
\right\vert \left\vert \left(  p+1\right)  g^{p}\left(  X_{i}\right)
\right\vert \label{4-7}\\
&  \leq\frac{nh}{pg^{p}\left(  x\right)  }\left(  p+1\right)  g^{p}\left(
x\right)  \left(  1+ c_1 ph\right)  O\left(  \frac{1}{nh}\right)  \nonumber\\
&  =O\left(  1\right)  \left(  1+O\left(  ph\right)  \right),  \nonumber
\end{align}
and the result is proved.
\end{proof}

\begin{lemma}
\label{lem13}
There exists a positive constant $c_3$ such that%
\begin{equation}
 \label{4-5}
\frac{nh}{p}\left/\mathbb{V}\left(  \sum_{i=1}^{n}\xi_{i}/\mathcal{X}\right)  \right.
=c_3\left[  1+o_{p}\left(  1\right)  \right],
\end{equation}
or equivalently,
\begin{equation}
 \label{4-6}%
\frac{nh}{p}\left/\sqrt{\mathbb{V}\left(  \sum_{i=1}^{n}\xi_{i}/\mathcal{X}
\right)  }  \right. =\sqrt{\frac{nh}{p}}\sqrt{c_3}\left[  1+o_{p}\left(  1\right)
\right].
\end{equation}
\end{lemma}

\begin{proof}
Recalling that
\[
\mathbb{V}\left(  \left(  p+1\right)  Y_{i}^{p}-g^{p}\left(  X_{i}\right)
/\mathcal{X}\right)  =\mathbb{V}\left(  Z_{i}/\mathcal{X}\right)  =\frac{p^{2}}%
{2p+1}g^{2p}\left(  X_{i}\right),
\]
we can write
\begin{align*}
&\mathbb{V}\left(  \sum_{i=1}^{n}\xi_{i}/\mathcal{X}\right)  \\
&=\frac{(nh)^{2}}{g^{2p}\left(  x\right)  }\frac{1}{2p+1}\sum_{i=1}%
^{n}a^{2}\left(  X_{i}\right)  g^{2p}\left(  X_{i}\right)  \\
&  =\frac{h^{2}}{g^{2p}\left(  x\right)  }\frac{1}{2p+1}\frac{1}{f^{2}\left(
x\right)  }\sum_{i=1}^{n}K_{h}^{2}\left(  X_{i}-x\right)  \left[
\sum_{j=0}^{k}u_{j}\left(  \frac{X_{i}-x}{h}\right)  ^{j}\right]  ^{2}%
g^{2p}\left(  X_{i}\right)  \\
&  =\frac{h^{2}}{g^{2p}\left(  x\right)  }\frac{1}{2p+1}\frac{1}{f^{2}\left(
x\right)  }\sum_{j,l=0}^{k}u_{j}u_{l}\sum_{i=1}^{n}K_{h}^{2}\left(
X_{i}-x\right)  \left(  \frac{X_{i}-x}{h}\right)  ^{j+l}g^{2p}\left(
X_{i}\right)  \\
&  =\frac{h^{2}}{g^{2p}\left(  x\right)  }\frac{1}{2p+1}\frac{1}{f^{2}\left(
x\right)  }\sum_{j,l=0}^{k}u_{j}u_{l}\frac{1}{h^{j+l}}S_{n,j+l}^{\ast}.
\end{align*}
Now, substituting the asymptotic expression for $S_{n,j}^{\ast}$ into the
above expression yields
\[
\mathbb{V}\left(  \sum_{i=1}^{n}\xi_{i}/\mathcal{X}\right)  =\frac{nh}%
{2p+1}\frac{1}{f\left(  x\right)  }\sum_{j,l=0}^{k}u_{j}u_{l}\nu_{j+l}\left[
1+o_{p}\left(  1\right)  \right],
\]
and the parts $\left(  \ref{4-5}\right)  ~$and $\left(  \ref{4-6}\right)  $ of
this lemma follow.
\end{proof}

\noindent
The next two lemmas are the key tools to prove Theorem~\ref{th4}.
Lemma~\ref{lem14} is mainly a consequence of the
Bernstein-Fr\'{e}chet inequality given in Lemma~\ref{lem8}.
Lemma~\ref{lem15} is dedicated to the control of the random variable
$\Delta_n$ introduced in~(\ref{defdelta}).
\begin{lemma}
\label{lem14}
There exists a positive constant $c_4$ such that for every $\varepsilon>0$,
\[
\mathbb{P}\left(  \left\vert \widehat{r}_{n}\left(  x\right)  -\mathbb{E}\left(  \widehat{r}%
_{n}\left(  x\right)  /\mathcal{X}\right)  \right\vert \geq\varepsilon
r_{n}\left(  x\right)  /\mathcal{X}\right)  \leq2\exp\left\{  -c_4\frac
{nh}{p}\varepsilon^{2}\left[  1+o_{p}\left(  1\right)  \right]  \right\},
\]
where the sequence $\left[  1+o_{p}\left(  1\right)  \right]  $ depends
exclusively on the design $\mathcal{X}$ .
\end{lemma}

\begin{proof}
Following the asymptotic expression of $\widehat{r}_{n}\left(  x\right)  $
in Lemma~\ref{lem9}, we can write%
\begin{align*}
&  \mathbb{P}\left(  \left\vert \widehat{r}_{n}\left(  x\right)  -\mathbb{E}\left(  \widehat
{r}_{n}\left(  x\right)  /\mathcal{X}\right)  \right\vert \geq\varepsilon
r_{n}\left(  x\right)  /\mathcal{X}\right) \\
&  =\mathbb{P}\left(  \left\vert \sum_{i=1}^{n}a\left(  X_{i}\right)  \left(
Z_{i}-\mathbb{E}\left(  Z_{i}/\mathcal{X}\right)  \right)  \right\vert \left[
1+o_{p}\left(  1\right)  \right]  \geq\varepsilon r_{n}\left(  x\right)
/\mathcal{X}\right) \\
&  =\mathbb{P}\left(  \left\vert \sum_{i=1}^{n}a\left(  X_{i}\right)  \left(
\left(  p+1\right)  Y_{i}^{p}-g^{p}\left(  X_{i}\right)  \right)  \right\vert
\geq\left[  1+o_{p}\left(  1\right)  \right]  \varepsilon g^{p}\left(
x\right)  /\mathcal{X}\right).
\end{align*}
It is worth noticing that, conditionally to $\mathcal{X}$, the
sequence $o_{p}\left(  1\right)  $ can be seen as a deterministic sequence
converging to $0$. We now introduce the bounded variables $\xi_{i}$
(see Lemma~\ref{lem12}).
In accordance with the Bernstein-Fr\'{e}chet
inequality given in Lemma~\ref{lem8}, and with the expressions~(\ref{4-5}) and~(\ref{4-6})
  in Lemma~\ref{lem13}, we write%
\begin{align*}
&  \mathbb{P}\left(  \left\vert \widehat{r}_{n}\left(  x\right)  -\mathbb{E}\left(  \widehat
{r}_{n}\left(  x\right)  /\mathcal{X}\right)  \right\vert \geq\varepsilon
r_{n}\left(  x\right)  /\mathcal{X}\right) \\
&= \mathbb{P}\left(  \left\vert
\sum\nolimits_{i=1}^{n}\xi_{i}\right\vert \geq\left[  1+o_{p}\left(  1\right)
\right]  \varepsilon\frac{nh}{p}/\mathcal{X}\right)  \\
&  =\mathbb{P}\left(  \left\vert \sum_{i=1}^{n}\xi_{i}\right\vert
\geq\varepsilon\left[  1+o_{p}\left(  1\right)  \right]  \frac{nh}%
{p\sqrt{\mathbb{V}\left(  \sum_{i=1}^{n}\xi_{i}/x\right)  }}\sqrt{\mathbb{V}\left(
\sum\nolimits_{i=1}^{n}\xi_{i}/x\right)  }/\mathcal{X}\right)  \\
&  \leq2\exp\left\{  -\frac{\left(  \varepsilon\left[  1+o_{p}\left(
1\right)  \right]  \frac{nh}{p\sqrt{\mathbb{V}\left(  \sum_{i=1}^{n}\xi
_{i}/\mathcal{X}\right)  }}\right)  ^{2}}{4+2\varepsilon\left[  1+o_{p}\left(
1\right)  \right]  \frac{nh}{p\sqrt{\mathbb{V}\left(  \sum_{i=1}^{n}\xi
_{i}/\mathcal{X}\right)  }}c_2/\sqrt{\mathbb{V}\left(  \sum_{i=1}^{n}%
\xi_{i}/\mathcal{X}\right)  }}\right\}  \\
&  =2\exp\left\{  -\frac{\left(  \varepsilon\sqrt{\frac{nh}{p}}\sqrt{c_3%
}\left[  1+o_{p}\left(  1\right)  \right]  \right)  ^{2}}{4+c_2%
\varepsilon\left[  1+o_{p}\left(  1\right)  \right]  \frac{nh}{p}/\mathbb{V}\left(
\sum_{i=1}^{n}\xi_{i}/\mathcal{X}\right)  }\right\}  \\
&  =2\exp\left\{  -\frac{\varepsilon^{2}\frac{nh}{p}^{{}}c_3\left[
1+o_{p}\left(  1\right)  \right]  }{4+c_2 c_3\varepsilon\left[
1+o_{p}\left(  1\right)  \right]  }\right\} \\
& \leq2\exp\left\{  -c_4\frac
{nh}{p}\varepsilon^{2}\left[  1+o_{p}\left(  1\right)  \right]  \right\},
\end{align*}
and the conclusion follows.
\end{proof}

\begin{lemma}
\label{lem15}
The random variable $\Delta_n$ is bounded conditionally to $\mathcal{X}$, which
means that there exists a positive constant, depending on the design, $c_5\left(  \mathcal{X}\right) $ such that  $\Delta_n\leq c_5\left(  \mathcal{X}\right)  $.
\end{lemma}
\begin{proof}
From inequality (\ref{4-7}), we have
\begin{align*}
\left\vert \widehat{r}_{n}\left(  x\right)  \right\vert  &  =\left\vert
e_{1}^{t}\mathbf{S}_{n}^{-1}\mathbf{X}^{t}\mathbf{W}\mathcal{Z}\right\vert \\
&  =\left\vert \frac{1}{nf\left(  x\right)  }\sum\nolimits_{i=1}^{n}%
K_{h}\left(  X_{i}-x\right)  \sum_{j=0}^{k}u_{j}\left(  \frac{X_{i}-x}%
{h}\right)  ^{j}Z_{i}\right\vert \left[  1+o_{p}\left(  1\right)  \right]  \\
&  \leq\left(  \sum_{i=1}^{n}\left\vert a\left(  X_{i}\right)
\right\vert \left(  p+1\right)  g^{p}\left(  X_{i}\right)  \right)  \left[
1+o_{p}\left(  1\right)  \right]  \\
&  =c_1 \frac{p}{h}g^{p}\left(  x\right)  \left[  1+o_{p}\left(  1\right)
\right]  \frac{1}{n}card\left\{  i:\left\vert X_{i}-x\right\vert <h\right\}.
\end{align*}
Then, the strong law of large numbers entails
\[
\left\vert \widehat{r}_{n}\left(  x\right)  \right\vert \leq r_{n}\left(
x\right)  c_1\frac{p}{h}\left[  \mathbb{P}\left(  \left\vert X-x\right\vert
<h\right)  \right]  \left[  1+o_{p}\left(  1\right)  \right],
\]
and from the continuity of the density $f$, we have
$$
\frac{1}{2h}  \mathbb{P}\left(
\left\vert X-x\right\vert <h\right)    =f\left(  x\right)  \left[
1+o\left(  1\right)  \right].
$$
Consequently,
\[
\left\vert \frac{\widehat{r}_{n}\left(  x\right)  }{r_{n}\left(  x\right)
}\right\vert <2c_1 pf\left(  x\right)  \left[  1+o_{p}\left(  1\right)
\right],
\]
with $o_{p}\left(  1\right)$ depending on the design $\mathcal{X}$.
We thus write%
\begin{equation}
 \label{4-2}%
\frac{1}{p}\left\vert w_{n}\left(  x\right)  \right\vert =\frac{1}%
{p}\left\vert \frac{\widehat{r}_{n}\left(  x\right)  }{r_{n}\left(  x\right)
}-1\right\vert \leq C\left(  \mathcal{X}\right),
\end{equation}
where $C\left(  \mathcal{X}\right)  $\ is a positive constant under the
conditioning by $\mathcal{X}$. As an immediate consequence, we get%
\begin{equation}
\left(  1+w_{n}\left(  x\right)  \right)  ^{1/p}-1=o_{p}\left(  1\right)
.\label{4-3}%
\end{equation}
From $\left(  \ref{4-2}\right)  $ and $\left(  \ref{4-3}\right)  $ it is clear
that $\Delta_n$ is bounded conditionally to $\mathcal{X}$.
\end{proof}

\noindent Finally, we quote two results from~\cite{JMVA2} (Lemma~5
and Lemma~4 respectively).
\begin{lemma}
\label{lem10}
If $ph\rightarrow0$, there exists a positive constant $c_1$ such
that
$$
g^{p}\left(  x\right)  \leq g^{p}\left(  y\right)  +c_1 g^{p}\left(
y\right)  ph
$$
for $\left\vert x-y\right\vert \leq h$.
\end{lemma}

\begin{lemma}
\label{lem16}
There exists a constant $c_6$ such that $\left\vert u\right\vert <1/2$ entails
$$
\left\vert \left(  1+u\right)  ^{1/p}-1-u/p\right\vert \leq c_6 u^{2}/p.
$$
\end{lemma}

\bibliographystyle{plain}

redpajama_set_name: RedPajamaArXiv