Uses direct plug-in methodology to select the bin width of a histogram.
dpih(x, scalest = "minim", level = 2L, gridsize = 401L, range.x = range(x), truncate = TRUE)
- numeric vector containing the sample on which the histogram is to be constructed.
- estimate of scale.
"stdev"- standard deviation is used.
"iqr"- inter-quartile range divided by 1.349 is used.
"minim"- minimum of
- number of levels of functional estimation used in the plug-in rule.
- number of grid points used in the binned approximations to functional estimates.
- range over which functional estimates are obtained. The default is the minimum and maximum data values.
TRUEthen observations outside of the interval specified by
range.xare omitted. Otherwise, they are used to weight the extreme grid points.
The direct plug-in approach, where unknown functionals that appear in expressions for the asymptotically optimal bin width and bandwidths are replaced by kernel estimates, is used. The normal distribution is used to provide an initial estimate.
the selected bin width.
This method for selecting the bin width of a histogram is described in Wand (1995). It is an extension of the normal scale rule of Scott (1979) and uses plug-in ideas from bandwidth selection for kernel density estimation (e.g. Sheather and Jones, 1991).
Scott, D. W. (1979). On optimal and data-based histograms. Biometrika, 66, 605--610.
Sheather, S. J. and Jones, M. C. (1991). A reliable data-based bandwidth selection method for kernel density estimation. Journal of the Royal Statistical Society, Series B, 53, 683--690.
Wand, M. P. (1995). Data-based choice of histogram binwidth. The American Statistician, 51, 59--64.
Documentation reproduced from package KernSmooth, version 2.23-10. License: Unlimited