mvr                 package:pls.pcr                 R Documentation

_M_u_l_t_i_v_a_r_i_a_t_e _R_e_g_r_e_s_s_i_o_n

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

     Generic function for multivariate regression. PCR and two types of
     PLS (SIMPLS and kernel-PLS) are implemented. The functions 'pcr'
     and 'pls' are simple wrappers for 'mvr'. Cross-validation can be
     used; a nmber of latent variables to retain is suggested.

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

     mvr(X, Y, ncomp,
         method=c("PCR", "SIMPLS", "kernelPLS"),
         validation=c("none","CV"), grpsize, niter)
     pcr(...)
     pls(..., method)

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

       X: a matrix of observations. 'NA's and 'Inf's are not allowed.

       Y: a vector or matrix of responses. 'NA's and 'Inf's are not
          allowed.

   ncomp: the numbers of latent variables to be assessed in the
          modelling. Default is from one to the rank of 'X'.

  method: the multivariate regression method to be used.

validation: validation method, either "none" or cross-validation
          ("CV").

 grpsize: the group size for the "CV" validation. If not specified,
          this is determined by the 'niter' parameter.

   niter: the number of iterations in the cross-validation. Default:
          10. If both 'niter' and 'grpsize' are specified, 'niter'
          takes precedence.

     ...: arguments for 'mvr'.

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

     An object of class 'mvr' is returned. This has the following
     components: 

    nobj: the number of objects, viz. the number of rows in X and Y.

    nvar: the number of independent variables, viz. the number of
          columns in X.

   npred: the number of Y variables.

  Xmeans: column means of original X data matrix.

       Y: original Y data. Y is represented as a matrix, possibly with
          only one column.

   ncomp: the number of latent variables considered in the PCR
          regression.

  method: the regression method used.

training: a list with the following components:

     _B an array of regression coefficients for all items in 'ncomp'.
          The dimensions of 'B' are 'c(nvar, npred, length(ncomp))'
          with 'nvar' the number of 'X' variables and 'npred' the
          number of variables to be predicted in 'Y'.

     _Y_p_r_e_d predicted values for the training data.

     _R_M_S Root-mean-square error of the training data for all items in
          'ncomp'. 

     _R_2 coefficient of multiple determination for the training data.

     _X_s_c_o_r_e_s X-scores for objects.

     _X_l_o_a_d X-loadings for objects.

     _Y_s_c_o_r_e_s Y-scores for objects: only in case of a PLS model with
          more than one Y variable.

     _Y_l_o_a_d Y-loadings for objects: only in case of a PLS model with
          more than one Y variable. 

 validat: a list with the following components:

     _Y_p_r_e_d predicted values for the validation stage.

     _n_L_V number of latent variables suggested by cross-validation. The
          least complex model within one standard error of the best is
          chosen.

     _n_i_t_e_r the number of groups in the cross-validation. If this number
          equals the number of objects, this is leave-one-out
          validation.

     _R_M_S Root-mean-square error from cross-validation for all items in
          'ncomp'. 

     _R_M_S._s_d standard error of the root-mean-square estimate. 

     _R_2 coefficient of multiple determination from cross-validation. 

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

     'pcr.model', 'simpls', 'kernelpls', 'plot.mvr', 'summary.mvr'

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

     data(NIR)
     attach(NIR)
     NIR.pcr <- mvr(Xtrain, Ytrain, 1:6, validation="CV")
     NIR.simpls <- mvr(Xtrain, Ytrain, 1:6, validation="CV", method="SIMPLS")
     NIR.kernelpls <- mvr(Xtrain, Ytrain, 1:6, validation="CV", method="kernelPLS")

     data(sensory)
     Pn <- scale(sensory$Panel)
     Ql <- scale(sensory$Quality)
     sens.pcr <- mvr(Ql, Pn, 1:5)
     sens.simpls <- mvr(Ql, Pn, 1:5, method="SIMPLS")
     sens.kernelpls <- mvr(Ql, Pn, 1:5, method="kernelPLS")

