

   CCoommppuuttee aa BBiinnnneedd KKeerrnneell DDeennssiittyy EEssttiimmaattee

        bkde (x,kernel="normal",canonical=F,bandwidth,
              gridsize=401,range.x=range(x),truncate=T)

   AArrgguummeennttss::

          x: vector of observations from the distribution whose
             density is to be estimated.  Missing values are
             not allowed.

   bandwidth: the kernel bandwidth smoothing parameter.  Larger
             values of `bandwidth' make smoother estimates,
             smaller values of `bandwidth' make less smooth
             estimates.

     kernel: character string which determines the smoothing
             kernel.  `kernel' can be: `"normal"' - the Gaus-
             sian 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.

   canonical: logical flag: if TRUE, canonically scaled kernels
             are used.

   gridsize: the number of equally spaced points at which to
             estimate the density.

    range.x: vector containing the minimum and maximum values
             of `x' at which to compute the estimate.  The
             default is the minimum and maximum data values.

   truncate: logical flag: if `TRUE', data with `x' values out-
             side the range specified by `range.x' are ignored.

   DDeessccrriippttiioonn::

        Returns x and y coordinates of the binned kernel den-
        sity estimate of the probability density of the data.

   VVaalluuee::

        a list containing the following components:

          x: vector of sorted `x' values at which the estimate
             was computed.

          y: vector of density estimates at the corresponding
             `x'.

   DDeettaaiillss::

        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 ker-
        nel is centered on that `x' and the heights of the ker-
        nel at each datapoint are summed.  This sum, after a
        normalization, is the corresponding `y' value in the
        output.

   BBAACCKKGGRROOUUNNDD::

        Density estimation is a smoothing operation.
        Inevitably there is a trade-off between bias in the
        estimate and the estimate's variability: large band-
        widths will produce smooth estimates that may hide
        local features of the density; small bandwidths may
        introduce spurious bumps into the estimate.

   RReeffeerreenncceess::

        Wand, M. P. and Jones, M. C. (1995).  Kernel Smoothing.
        Chapman and Hall, London.

   SSeeee AAllssoo::

        `density', `dpik', `hist', `ksmooth'.

   EExxaammpplleess::

        data(geyser)
        x <- geyser$duration
        est <- bkde(x,bandwidth=0.25)
        plot(est,type="l")

