bw.crit {multimode} | R Documentation |
Critical bandwidth
Description
This function computes the critical bandwidth for a specified number of modes.
Usage
bw.crit(data,mod0=1,lowsup=-Inf,uppsup=Inf,n=2^15,tol=10^(-5),full.result=F)
Arguments
data |
Sample for computing the critical bandwidth. |
mod0 |
Number of modes for which the critical bandwidth is calculated. Default |
lowsup |
Lower limit for the random variable support in the computation of the critical bandwidth. Default is |
uppsup |
Upper limit for the random variable support in the computation of the critical bandwidth. Default is |
n |
The number of equally spaced points at which the density is estimated. When n > 512, it is rounded up to a power of 2 as in the |
tol |
Accuracy requested in the computation of the critical bandwidth. Default value of |
full.result |
If this argument is TRUE then it returns the full result list, see below. Default |
Details
With bw.crit
the critical bandwidth for the number of modes specified in mod0
is calculated, e.g., the smallest bandwidth such that the kernel density estimator has at most mod0
modes. If the compact support is unknown, the critical bandwidth introduced by Silverman (1981) is computed and if it is provided that one of Hall and York (2001) is calculated.
Since a dichotomy method is employed for computing the critical bandwidth, the parameter tol
is used to determine a stopping time in such a way that the error committed in the computation of the critical bandwidth is less than tol
.
The NAs will be automatically removed.
Value
Depending on full.result
either a number, the critical bandwidth of the sample for mod0
modes, or an object of class "estmod"
which is a list
containing the following components:
nmodes |
The specified hypothesized value of the number of modes. |
sample.size |
The number of non-missing observations in the sample used for computing the number of modes. |
bw |
Value of the critical bandwidth test statistic. |
lowsup |
Lower limit of the support where the critical bandwidth is computed. |
ippsup |
Upper limit of the support where the critical bandwidth is computed. |
fnx |
The |
fny |
The estimated density values. |
Author(s)
Jose Ameijeiras-Alonso, Rosa M. Crujeiras and Alberto RodrÃguez-Casal
References
Hall, P. and York, M. (2001). On the calibration of Silverman's test for multimodality, Statistica Sinica, 11, 515–536.
Silverman, B. W. (1981). Using kernel density estimates to investigate multimodality, Journal of the Royal Statistical Society. Series B, 43, 97–99.
Examples
# Critical bandwidth of Silverman (1981) for one mode.
set.seed(2016)
data=rnorm(50)
bw.crit(data)
# Critical bandwidth of Hall and York for two modes in the interval (-1.5,1.5).
set.seed(2016)
data=rnorm(50)
bw.crit(data,mod0=2,lowsup=-1.5,uppsup=1.5)