

cv(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 estima-
     tion.

_U_s_a_g_e_:

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

_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 parame-
          ters

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.

_S_i_d_e _E_f_f_e_c_t_s_:

     None

_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")

