cv                    package:sm                    R Documentation

_C_r_o_s_s-_v_a_l_i_d_a_t_i_o_n _c_r_i_t_e_r_i_o_n _f_o_r _n_o_n_p_a_r_a_m_e_t_r_i_c _d_e_n_s_i_t_y _e_s_t_i_m_a_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

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

_U_s_a_g_e:

     cv(x, h, ...)

_A_r_g_u_m_e_n_t_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 parameters 

     ...: other optional parameters are passed to the `sm.options'
          function, through a mechanism which limits their effect only
          to this call of the function;  those relevant for this
          function are the following: 

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

_D_e_t_a_i_l_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_a_l_u_e:

     The value of the cross-validatory criterion.

_R_e_f_e_r_e_n_c_e_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_e_e _A_l_s_o:

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

_E_x_a_m_p_l_e_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")

