  Consider the nonparametric regression model Y=m(X)+E, where the function m is
smooth but unknown, and E is independent of X. An estimator of the density of
the error term E is proposed and its weak consistency is obtained. The
contribution of this paper is twofold. First, we evaluate the impact of the
estimation of the regression function on the error density estimator. Secondly,
the optimal choices of the first and second step bandwidths used for estimating
the regression function and the error density are proposed. Further, we
investigate the asymptotic normality of the error density estimator and
evaluate its performances in simulated examples.
