\HeaderA{get.p}{Test if the kernel density estimate given by x and h0 has at most m modes}{get.p}
\keyword{distribution}{get.p}
\begin{Description}\relax
This function returns the p-value of rejecting the null hypothesis that the kernel density estimate given by x and h0 has at most m modes.
\end{Description}
\begin{Usage}
\begin{verbatim}
get.p(x,h0,m=1,num.sim=200)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] the data vector 
\item[\code{h0}] the bandwidth for the gaussian kernel density estimate for the standardized data
\item[\code{m}] the number iof modes we are trying to reject is the maximum 
\item[\code{num.sim}] the number of bootstrap simulations to determine this p-value 
\end{ldescription}
\end{Arguments}
\begin{Value}
returns the p-value of the test
\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.h}{get.h}}, \code{\LinkA{emp.f}{emp.f}}, \code{\LinkA{get.num.modes}{get.num.modes}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
 set.seed(12345)
 x1<-matrix(rnorm(50),ncol=1)
 x2<-matrix(c(rnorm(25,mean=-2),rnorm(25,mean=2)),ncol=1)
 h1<-get.h(x1,m=1,prec=0.001)
 h2<-get.h(x2,m=1,prec=0.001)
 p1<-get.p(x1,h1,1,100)
 p2<-get.p(x2,h2,1,100)
 c(p1,p2)
\end{ExampleCode}
\end{Examples}

