Learn R Programming

mdatools (version 0.9.4)

selectCompNum.pls: Select optimal number of components for PLS model

Description

Allows user to select optimal number of components for PLS model

Usage

# S3 method for pls
selectCompNum(model, ncomp = NULL,
  selcrit = model$ncomp.selcrit, ...)

Arguments

model

PLS model (object of class pls)

ncomp

number of components to select

selcrit

criterion for selecting optimal number of components ('min' for first local minimum of RMSECV and 'wold' for Wold's rule.)

...

other parameters if any

Value

the same model with selected number of components

Details

If number of components is not specified, the cross-validation statistics will be used. It can be either first local minimum of RMSECV (`selcrit='min'`) or Wold's rule (`selcrit='wold'`) based on ratio of PRESS values and threshold of 0.95.

See examples in help for pls function.