\HeaderA{get.h}{Estimate the critical bandwidth for specific number of modes}{get.h}
\keyword{distribution}{get.h}
\begin{Description}\relax
get.h finds the critical bandwidth for specific number of modes.  That is, it finds the smallest bandwidth for which "m" modes are present for a kernel density estimator.
\end{Description}
\begin{Usage}
\begin{verbatim}
get.h(x, m = 1, prec = 0.001, hmin = 0, hmax = 1)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] the data vector in which to find the critical bandwidth 
\item[\code{m}] the number of modes for the critical bandwidth 
\item[\code{prec}] the precision for the resulting bandwidth 
\item[\code{hmin}] the minimum value to start searching for the critical bandwidth, h 
\item[\code{hmax}] the maximum value to start searching for the critical bandwidth, h 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
get.h uses the Gaussian kernel to estimate the density of a data vector given by x.  The bandwidth determines the spread of each data point.  Thus a larger bandwidth leads to a smoother density estaimate.  get.h finds the smallest bandwidth in which "m" modes are still present.
\end{Details}
\begin{Value}
\begin{ldescription}
\item[\code{h}] the critical bandwidth, rescaled for the standardized x-values for direct comparison 
\end{ldescription}
\end{Value}
\begin{Author}\relax
Kevin Rader
\end{Author}
\begin{References}\relax
B.W. Silverman (1981),Using Kernel Density Estimates to
Investigate Multimodatlity. J.R. Statist. Soc. B,43,1,97-99.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{get.p}{get.p}}, \code{\LinkA{emp.f}{emp.f}}, \code{\LinkA{get.num.modes}{get.num.modes}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
 set.seed(12345)
 x <- c(rnorm(20,0),rnorm(20,3))
 get.h(x)
\end{ExampleCode}
\end{Examples}

