

   SSeelleecctt aa BBaannddwwiiddtthh ffoorr KKeerrnneell DDeennssiittyy EEssttiimmaattiioonn

        dpik(x, scalest="minim", level=2, kernel="normal",
             canonical=F, gridsize=401, range.x=range(x),
             truncate=F)

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

          x: vector containing the sample on which the kernel
             density estimate is to be constructed.

    scalest: estimate of scale.

             `"stdev"' - standard deviation is used.

             `"iqr"' - inter-quartile range divided by 1.349 is
             used.

             `"minim"' - minimum of `"stdev"' and `"iqr"' is
             used.

      level: number of levels of functional estimation used in
             the plug-in rule.

     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 ker-
             nels are used

   gridsize: the number of equally-spaced points over which
             binning is performed to obtain kernel functional
             approximation.

    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::

        Use direct plug-in methodology to select the bandwidth
        of a kernel density estimate.

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

        the selected bandwidth.

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

        The direct plug-in approach, where unknown functionals
        that appear in expressions for the asymptotically opti-
        mal bandwidths are replaced by kernel estimates, is
        used.  The normal distribution is used to provide an
        initial estimate.

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

        This method for selecting the bandwidth of a kernel
        density estimate was proposed by Sheather and Jones
        (1991) and is described in Section 3.6 of Wand and
        Jones (1995).

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

        Sheather, S. J. and Jones, M. C. (1991).  A reliable
        data-based bandwidth selection method for kernel den-
        sity estimation.  Journal of the Royal Statistical
        Society, Series B, 53, 683-690.

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

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

        `bkde', `density', `ksmooth'

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

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

