lsplsCv                package:lspls                R Documentation

_C_r_o_s_s-_V_a_l_i_d_a_t_e _L_S-_P_L_S _M_o_d_e_l_s

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

     Calculate cross-validated predictions for LS-PLS models.

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

     lsplsCv(formula, ncomp, data, subset, na.action, segments = 10,
             segment.type = c("random", "consecutive", "interleaved"),
             length.seg, model = TRUE, ...)

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

 formula: model formula.  See Details.

   ncomp: list or vector of positive integers, giving the number of
          components to use for each PLS matrix.  See Details.

    data: an optional data frame with the data to fit the model from.

  subset: an optional vector specifying a subset of observations to be
          used in the fitting process.

na.action: a function which indicates what should happen when the data
          contain missing values.

segments: the number of segments to use, or a list with segments (see
          Details).

segment.type: the type of segments to use.  Ignored if 'segments' is a
          list.

length.seg: Positive integer.  The length of the segments to use.  If
          specified, it overrides 'segments' unless 'segments' is a
          list.

   model: logical.  If 'TRUE', the model frame is returned.

     ...: additional arguments, passed to the underlying
          cross-validation function.

_D_e_t_a_i_l_s:

     The function performs a cross-validation, using the model and
     segments specified in the call.  It returns an object of class
     '"lsplsCv"', which has a plot method (see 'plot.lsplsCv').  See
     lspls-package for typical usage and more about LS-PLS models.

     See 'lspls' for details about specifying the model with 'formula'
     and 'ncomp'.  Note that 'lsplsCv' cross-validates models with from
     0 components to the numbers of components specified with 'ncomp'.

     If 'segments' is a list, the arguments 'segment.type' and
     'length.seg' are ignored.  The elements of the list should be
     integer vectors specifying the indices of the segments.  See
     'cvsegments' for details.

     Otherwise, segments of type 'segment.type' are generated.  How
     many segments to generate is selected by specifying the number of
     segments in 'segments', or giving the segment length in
     'length.seg'.  If both are specified, 'segments' is ignored.

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

     An object of class '"lsplsCv"', with components 

    pred: the cross-validated predictions.  An array with one dimension
          for the observations, one for the responses, and one for each
          of the PLS matrices.

segments: the list of segments used in the cross-validation.

na.action: if observations with missing values were removed,
          'na.action' contains a vector with their indices.

   ncomp: the list of number of components used in the model.

    call: the function call.

   terms: the model terms.

   model: if 'model = TRUE', the model frame.

_N_o_t_e:

     Currently, 'lsplsCv' handles the formula and the data, and calls
     'orthlsplsCv' for the actual cross-validation.  The formula
     interface is experimental, and might change in future versions.

_A_u_t_h_o_r(_s):

     Bjrn-Helge Mevik

_R_e_f_e_r_e_n_c_e_s:

     Jrgensen, K., Segtnan, V. H., Thyholt, K., Ns, T. (2004)  A
     Comparison of Methods for Analysing Regression Models with Both
     Spectral and Designed Variables. _Journal of Chemometrics_,
     *18*(10), 451-464.

     Jrgensen, K., Mevik, B.-H., Ns, T.  Combining Designed
     Experiments with Several Blocks of Spectroscopic Data. (Submitted)

     Mevik, B.-H., Jrgensen, K., Mge, I., Ns, T.  LS-PLS: Combining
     Categorical Design Variables with Blocks of Spectroscopic
     Measurements. (Submitted)

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

     'lspls', 'plot.lsplsCv', 'cvsegments', 'orthlsplsCv',
     lspls-package

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

     ##FIXME

