

   CCrroossss--vvaalliiddaattiioonn ccrriitteerriioonn ffoorr nnoonnppaarraammeettrriicc ddeennssiittyy eessttiimmaa--
   ttiioonn

        cv(x, h, h.weights=NA)

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

          x: vector, or two-column matrix, of data.

          h: a smoothing parameter.  In the two-dimensional
             case this is multiplied by the standard deviation
             of each component to produce two smoothing parame-
             ters

   h.weights: a vector of weights which multiply the smoothing
             parameter(s) used in the kernel function at each
             observation.

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

        This function computes a cross-validatory criterion,
        based on integrated squared error, for use in selecting
        a smoothing parameter in nonparametric density estima-
        tion.

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

        see Section 2.4.3 of the reference below.  The function
        is called automatically by `hcv' and does not usually
        need to be called independently.

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

        The value of the cross-validatory criterion.

   SSiiddee EEffffeeccttss::

        None

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

        Bowman, A.W. and Azzalini, A. (1997). Applied Smoothing
        Techniques for Data Analysis: the Kernel Approach with
        S-Plus Illustrations.  Oxford University Press, Oxford.

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

        `hcv', `hsj', `hnorm', `sj'

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

        x      <- rnorm(50)
        hgrid  <- seq(0.1, 1, length = 10)
        cvgrid <- vector("numeric", length = length(hgrid))
        for (i in 1:10) cvgrid[i] <- cv(x, hgrid[i])
        plot(hgrid, cvgrid, type="l")

