\HeaderA{width.SJ}{Bandwidth Selection by Pilot Estimation of Derivatives}{width.SJ}
\keyword{dplot}{width.SJ}
\begin{Description}\relax
Uses the method of Sheather \& Jones (1991) to select the bandwidth of
a Gaussian kernel density estimator.
\end{Description}
\begin{Usage}
\begin{verbatim}
width.SJ(x, nb = 1000, lower, upper, method = c("ste", "dpi"))
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] a numeric vector

\item[\code{nb}] number of bins to use.

\item[\code{upper, lower}] range over which to search for solution if \code{method = "ste"}.

\item[\code{method}] Either \code{"ste"} ("solve-the-equation") or \code{"dpi"}
("direct plug-in").

\end{ldescription}
\end{Arguments}
\begin{Value}
a bandwidth.
\end{Value}
\begin{References}\relax
Sheather, S. J. and Jones, M. C. (1991) A reliable data-based bandwidth
selection method for kernel density estimation.
\emph{Journal of the Royal Statistical Society series B}
\bold{53}, 683--690.

Scott, D. W. (1992)
\emph{Multivariate Density Estimation: Theory, Practice, and  Visualization.}
Wiley.

Wand, M. P. and Jones, M. C. (1995)
\emph{Kernel Smoothing.}
Chapman \& Hall.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{ucv}{ucv}}, \code{\LinkA{bcv}{bcv}}, \code{\LinkA{density}{density}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
attach(geyser)
width.SJ(duration, method = "dpi")
width.SJ(duration)
detach()

width.SJ(galaxies, method = "dpi")
width.SJ(galaxies)
\end{ExampleCode}
\end{Examples}

