This function computes the number of modes in a kernel density estimator using the Gaussian kernel and a given bandwidth parameter.
Usage
nmodes(data,bw,lowsup=-Inf,uppsup=Inf,n=2^15)
Arguments
data
Sample for computing a kernel density estimator and determine the number of modes.
bw
Bandwidth parameter for kernel density estimation.
lowsup
Lower limit for the random variable support. Just the number of modes greater than lowsup are taken into account. Default is -Inf.
uppsup
Upper limit for the random variable support. Just the number of modes greater than lowsup are taken into account. Default is Inf.
n
The number of equally spaced points at which the density is to be estimated. When n > 512, it is rounded up to a power of 2 as in the density function. Default n=2^15.
Value
Number of modes for the bandwidth provided in bw.
Details
The number of modes in the interval provided by lowsup and uppsup is computed. For this calculation, a kernel density estimator with Gaussian kernel and bandwidth bw is used.