lscv                 package:locfit                 R Documentation

_L_e_a_s_t _S_q_u_a_r_e_s _C_r_o_s_s _V_a_l_i_d_a_t_i_o_n _S_t_a_t_i_s_t_i_c.

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

     The calling sequence for 'lscv' matches those for the 'locfit' or
     'locfit.raw' functions. Note that this function is only designed
     for density estimation in one dimension. The returned object
     contains the least squares cross validation score for the fit.

     The computation of int hat f(x)^2 dx is performed numerically. For
     kernel density estimation, this is unlikely to agree exactly with
     other LSCV routines, which may perform the integration
     analytically.

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

     lscv(x, ..., exact=FALSE)

_A_r_g_u_m_e_n_t_s:

       x: model formula (or numeric vector, if 'exact=T')

     ...: other arguments to 'locfit' or 'lscv.exact' 

   exact: By default, the computation is approximate. If 'exact=TRUE',
          exact computation using 'lscv.exact' is performed. This uses
          kernel density estimation with a constant bandwidth.

_V_a_l_u_e:

     A vector consisting of the LSCV statistic and fitted degrees of
     freedom.

_S_e_e _A_l_s_o:

     'locfit', 'locfit.raw', 'lscv.exact' 'lscvplot'

_E_x_a_m_p_l_e_s:

     # approximate calculation for a kernel density estimate
     data(geyser)
     lscv(~geyser, alpha=cbind(0,1), ev="grid", mg=100, deg=0,
       flim=c(1,6), kern="gauss")
     # same computation, exact
     lscv(geyser,alpha=1,exact=TRUE)

