gsim.cv             package:plsgenomics             R Documentation

_D_e_t_e_r_m_i_n_a_t_i_o_n _o_f _t_h_e _r_i_d_g_e _r_e_g_u_l_a_r_i_z_a_t_i_o_n _p_a_r_a_m_e_t_e_r _a_n_d _t_h_e _b_a_n_d_w_i_d_t_h _t_o _b_e _u_s_e_d _f_o_r
_c_l_a_s_s_i_f_i_c_a_t_i_o_n _w_i_t_h _G_S_I_M _f_o_r _b_i_n_a_r_y _d_a_t_a

_D_e_s_c_r_i_p_t_i_o_n:

     The function 'gsim.cv' determines the best ridge regularization
     parameter and bandwidth to be used for classification with GSIM as
     described in Lambert-Lacroix and Peyre (2005).

_U_s_a_g_e:

     gsim.cv(Xtrain, Ytrain,LambdaRange,hARange,hB=NULL, NbIterMax=50)

_A_r_g_u_m_e_n_t_s:

  Xtrain: a (ntrain x p) data matrix of predictors. 'Xtrain' must be a
          matrix.  Each row corresponds to an observation and each
          column to a predictor variable.

  Ytrain: a ntrain vector of responses. 'Ytrain' must be a vector. 
          'Ytrain' is a {1,2}-valued vector and contains the response
          variable for each observation.

LambdaRange: the vector of positive real value from which the best
          ridge regularization parameter has to be chosen by
          cross-validation.

 hARange: the vector of strictly positive real value from which the
          best bandwidth has to be chosen by cross-validation for GSIM
          step A.

      hB: a strictly positive real value. 'hB' is the bandwidth for 
          GSIM step B. if 'hB' is equal to NULL, then hB value is
          chosen using a plug-in method.

NbIterMax: a positive integer. 'NbIterMax' is the maximal number of
          iterations in the Newton-Rapson parts.

_D_e_t_a_i_l_s:

     The cross-validation procedure described in Lambert-Lacroix and
     Peyre (2005) is used to determine the best ridge regularization
     parameter and bandwidth to be used for classification with GSIM
     for binary data (for categorical data see  'mgsim' and
     'mgsim.cv'). At each cross-validation run, 'Xtrain' is split into
     a pseudo training set (ntrain - 1 samples) and a pseudo test set
     (1 sample) and the classification error rate is determined for
     each value of ridge regularization parameter and bandwidth.
     Finally, the function  'gsim.cv' returns the values of the ridge
     regularization parameter and  bandwidth for which the mean
     classification error rate is minimal.

_V_a_l_u_e:

     A list with the following components: 

  Lambda: the optimal regularization parameter.

      hA: the optimal bandwidth parameter.

_A_u_t_h_o_r(_s):

     Sophie Lambert-Lacroix (<URL:
     http://www-lmc.imag.fr/lmc-sms/Sophie.Lambert>)  and  Julie Peyre
     (<URL: http://www-lmc.imag.fr/lmc-sms/Julie.Peyre/>).

_R_e_f_e_r_e_n_c_e_s:

     S. Lambert-Lacroix and Julie Peyre (2005). Local likelyhood
     regression in  generalized linear single-index models with
     applications to microarray data,  TR0563 IAP Statistics network
     (<URL: http://www.stat.ucl.ac.be/IAP/>).

_S_e_e _A_l_s_o:

     'mgsim', 'gsim', 'gsim.cv'.

_E_x_a_m_p_l_e_s:

     # load plsgenomics library
     library(plsgenomics)

     # load Colon data
     data(Colon)
     IndexLearn <- c(sample(which(Colon$Y==2),12),sample(which(Colon$Y==1),8))

     Xtrain <- Colon$X[IndexLearn,]
     Ytrain <- Colon$Y[IndexLearn]
     Xtest <- Colon$X[-IndexLearn,]

     # preprocess data
     resP <- preprocess(Xtrain= Xtrain, Xtest=Xtest,Threshold = c(100,16000),Filtering=c(5,500),log10.scale=TRUE,row.stand=TRUE)

     # Determine optimum h and lambda
     hl <- gsim.cv(Xtrain=resP$pXtrain,Ytrain=Ytrain,hARange=c(7,20),LambdaRange=c(0.1,1),hB=NULL)

     # perform prediction by GSIM  
     res <- gsim(Xtrain=resP$pXtrain,Ytrain=Ytrain,Xtest=resP$pXtest,Lambda=hl$Lambda,hA=hl$hA,hB=NULL)
     res$Cvg
     sum(res$Ytest!=Colon$Y[-IndexLearn])

