PLS_beta_kfoldcv_formula.Rd
This function implements kfold cross validation on complete or incomplete datasets for partial least squares beta regression models (formula specification of the model).
PLS_beta_kfoldcv_formula(formula,data=NULL,nt=2,limQ2set=.0975, modele="pls", family=NULL, K=nrow(dataX), NK=1, grouplist=NULL, random=FALSE, scaleX=TRUE, scaleY=NULL, keepcoeffs=FALSE, keepfolds=FALSE, keepdataY=TRUE, keepMclassed=FALSE, tol_Xi=10^(12), weights,subset,start=NULL,etastart,mustart,offset,method,control= list(), contrasts=NULL,sparse=FALSE,sparseStop=TRUE,naive=FALSE,link=NULL, link.phi=NULL,type="ML",verbose=TRUE)
formula  an object of class " 

data  an optional data frame, list or environment (or object coercible by 
nt  number of components to be extracted 
limQ2set  limit value for the Q2 
modele  name of the PLS glm or PLS beta model to be fitted ( 
family  a description of the error distribution and link function to be used in the model. This can be a character string naming a family function, a family function or the result of a call to a family function. (See 
K  number of groups 
NK  number of times the group division is made 
grouplist  to specify the members of the 
random  should the 
scaleX  scale the predictor(s) : must be set to TRUE for 
scaleY  scale the response : Yes/No. Ignored since non always possible for glm responses. 
keepcoeffs  shall the coefficients for each model be returned 
keepfolds  shall the groups' composition be returned 
keepdataY  shall the observed value of the response for each one of the predicted value be returned 
keepMclassed  shall the number of miss classed be returned (unavailable) 
tol_Xi  minimal value for Norm2(Xi) and \(\mathrm{det}(pp' \times pp)\) if there is any missing value in the 
weights  an optional vector of 'prior weights' to be used in the fitting process. Should be 
subset  an optional vector specifying a subset of observations to be used in the fitting process. 
start  starting values for the parameters in the linear predictor. 
etastart  starting values for the linear predictor. 
mustart  starting values for the vector of means. 
offset  this can be used to specify an a priori known component to be included in the linear predictor during fitting. This should be 
method 

control  a list of parameters for controlling the fitting process. For 
contrasts  an optional list. See the 
sparse  should the coefficients of nonsignificant predictors (< 
sparseStop  should component extraction stop when no significant predictors (< 
naive  Use the naive estimates for the Degrees of Freedom in plsR? Default is 
link  character specification of the link function in the mean model (mu). Currently, " 
link.phi  character specification of the link function in the precision model (phi). Currently, " 
type  character specification of the type of estimator. Currently, maximum likelihood (" 
verbose  should info messages be displayed ? 
Predicts 1 group with the K1
other groups. Leave one out cross validation is thus obtained for K==nrow(dataX)
.
There are seven different predefined models with predefined link functions available :
"pls"
ordinary pls models
"plsglmGamma"
glm gaussian with inverse link pls models
"plsglmgaussian"
glm gaussian with identity link pls models
"plsglminversegamma"
glm binomial with square inverse link pls models
"plsglmlogistic"
glm binomial with logit link pls models
"plsglmpoisson"
glm poisson with log link pls models
"plsglmpolr"
glm polr with logit link pls models
Using the "family="
option and setting "modele=plsglmfamily"
allows changing the family and link function the same way as for the glm
function. As a consequence userspecified families can also be used.
gaussian
familyaccepts the links (as names) identity
, log
and inverse
.
binomial
familyaccepts the links logit
, probit
, cauchit
, (corresponding to logistic, normal and Cauchy CDFs respectively) log
and cloglog
(complementary loglog).
Gamma
familyaccepts the links inverse
, identity
and log
.
poisson
familyaccepts the links log
, identity
, and sqrt
.
inverse.gaussian
familyaccepts the links 1/mu^2
, inverse
, identity
and log
.
quasi
familyaccepts the links logit
, probit
, cloglog
, identity
, inverse
, log
, 1/mu^2
and sqrt
.
power
can be used to create a power link function.
A typical predictor has the form response ~ terms where response is the (numeric) response vector and terms is a series of terms which specifies a linear predictor for response. A terms specification of the form first + second indicates all the terms in first together with all the terms in second with any duplicates removed.
A specification of the form first:second indicates the the set of terms obtained by taking the interactions of all terms in first with all terms in second. The specification first*second indicates the cross of first and second. This is the same as first + second + first:second.
The terms in the formula will be reordered so that main effects come first, followed by the interactions, all secondorder, all thirdorder and so on: to avoid this pass a terms object as the formula.
NonNULL weights can be used to indicate that different observations have different dispersions (with the values in weights being inversely proportional to the dispersions); or equivalently, when the elements of weights are positive integers w_i, that each response y_i is the mean of w_i unitweight observations.
list of NK
. Each element of the list sums up the results for a group division:
list of K
matrices of size about nrow(dataX)/K * nt
with the predicted values for a growing number of components
…
list of K
matrices of size about nrow(dataX)/K * nt
with the predicted values for a growing number of components
list of NK
. Each element of the list sums up the informations for a group division:
list of K
vectors of length about nrow(dataX)
with the numbers of the rows of dataX
that were used as a training set
…
list of K
vectors of length about nrow(dataX)
with the numbers of the rows of dataX
that were used as a training set
list of NK
. Each element of the list sums up the results for a group division:
list of K
matrices of size about nrow(dataX)/K * 1
with the observed values of the response
…
list of K
matrices of size about nrow(dataX)/K * 1
with the observed values of the response
the call of the function
Frédéric Bertrand, Nicolas Meyer, Michèle BeauFaller, Karim El Bayed, IzzieJacques Namer, Myriam MaumyBertrand (2013). Régression Bêta PLS. Journal de la Société Française de Statistique, 154(3):143159. http://publicationssfds.math.cnrs.fr/index.php/JSFdS/article/view/215
Work for complete and incomplete datasets.
kfolds2coeff
, kfolds2Pressind
, kfolds2Press
, kfolds2Mclassedind
, kfolds2Mclassed
and kfolds2CVinfos_beta
to extract and transform results from kfold cross validation.
# NOT RUN { data("GasolineYield",package="betareg") bbb < PLS_beta_kfoldcv_formula(yield~.,data=GasolineYield,nt=3,modele="plsbeta") kfolds2CVinfos_beta(bbb) # }