Returns x and y coordinates of the binned kernel density estimate of the probability density of the data.
bkde(x, kernel = "normal", canonical = FALSE, bandwidth, gridsize = 401L, range.x, truncate = TRUE)
- numeric vector of observations from the distribution whose density is to be estimated. Missing values are not allowed.
- the kernel bandwidth smoothing parameter. Larger values of
bandwidthmake smoother estimates, smaller values of
bandwidthmake less smooth estimates. The default is a bandwidth computed from the variance of
x, specifically the ‘oversmoothed bandwidth selector’ of Wand and Jones (1995, page 61).
- character string which determines the smoothing kernel.
"normal"- the Gaussian density function (the default).
"box"- a rectangular box.
"epanech"- the centred beta(2,2) density.
"biweight"- the centred beta(3,3) density.
"triweight"- the centred beta(4,4) density. This can be abbreviated to any unique abbreviation.
- logical flag: if
TRUE, canonically scaled kernels are used.
- the number of equally spaced points at which to estimate the density.
- vector containing the minimum and maximum values of
xat which to compute the estimate. The default is the minimum and maximum data values, extended by the support of the kernel.
- logical flag: if
TRUE, data with
xvalues outside the range specified by
This is the binned approximation to the ordinary kernel density estimate. Linear binning is used to obtain the bin counts. For each
x value in the sample, the kernel is centered on that
x and the heights of the kernel at each datapoint are summed. This sum, after a normalization, is the corresponding
y value in the output.
a list containing the following components:
- vector of sorted
xvalues at which the estimate was computed.
- vector of density estimates at the corresponding
Density estimation is a smoothing operation. Inevitably there is a trade-off between bias in the estimate and the estimate's variability: large bandwidths will produce smooth estimates that may hide local features of the density; small bandwidths may introduce spurious bumps into the estimate.
Wand, M. P. and Jones, M. C. (1995). Kernel Smoothing. Chapman and Hall, London.
Documentation reproduced from package KernSmooth, version 2.23-10. License: Unlimited