PLS_Toolbox Documentation: pls< plotscores plsda >

pls

Purpose

Partial least squares regression for univariate or multivariate y-block.

Synopsis

 

model = pls(x,y,ncomp,options)      %calibration

pred  = pls(x,model,options)        %prediction

valid = pls(x,y,model,options)      %validation

options = pls('options')

Description

PLS calculates a single partial least squares regression model using the given number of components ncomp to predict y from measurements x.

To construct a PLS model, the inputs are x the predictor block (2-way array class "double" or class "datadet"), y the predicted block (2-way array class "double" or class "datadet"), ncomp the number of components to to be calculated (positive integer scalar), and the optional structure, options. The output is a standard model structure model with the following fields (see MODELSTRUCT):

     modeltype:  'PLS',

    datasource:  structure array with information about input data,

          date:   date of creation,

          time:   time of creation,

          info:   additional model information,

                      reg:   regression vector,

         loads:   cell array with model loadings for each mode/dimension,

          pred:   2 element cell array with model predictions for each input block (when options.blockdetail='normal' x-block predictions are not saved and this will be an empty array) and the y-block predictions.

                      wts:   double array with X-block weights,

          tsqs:  cell array with T2 values for each mode,

  ssqresiduals:  cell array with sum of squares residuals for each mode,

   description:   cell array with text description of model, and

        detail:  sub-structure with additional model details and results.

To make predictions the inputs are x the new predictor x-block (2-way array class "double" or "dataset"), and model the PLS model. The output pred is a structure, similar to model, that contains scores, predictions, etc. for the new data.

If new y-block measurements are also available then the inputs are x the new predictor x-block (2-way array class "double" or "dataset"), y the new predicted block (2-way array class "double" or "dataset"), and model the PLS model. The output valid is a structure, similar to model, that contains scores, predictions, and additional y-block statistics etc. for the new data.

Note: Calling pls with no inputs starts the graphical user interface (GUI) for this analysis method.

Options

             options =   a structure array with the following fields:

                     name:   'options', name indicating that this is an options structure,

              display:  [ 'off' | {'on'} ], governs level of display to command window,

                    plots  [ 'none' | {'final'} ], governs level of plotting,

  outputversion:  [ 2 | {3} ], governs output format (see below),

  preprocessing:  {[] []}, two element cell array containing preprocessing structures (see PREPROCESS) defining preprocessing to use on the x- and y-blocks (first and second elements respectively)

     algorithm:  [ 'nip' | {'sim'} ], PLS algorithm to use: NIPALS or SIMPLS {default}, and

    blockdetails:  [ {'standard'} | 'all' ], extent of predictions and residuals included in model, 'standard' = only y-block, 'all' x- and y-blocks.

The default options can be retreived using: options = pls('options');.

OUTPUTVERSION

By default (options.outputversion = 3) the output of the function is a standard model structure model. If options.outputversion = 2, the output format is:

 

[b,ssq,p,q,w,t,u,bin] = pls(x,y,ncomp,options)

where the outputs are

                         b =   matrix of regression vectors or matrices for each number of principal components up to ncomp,

                     ssq =   the sum of squares information,

                         p =   x-block loadings,

                         q =   y-block loadings,

                         w =   x-block weights,

                         t =   x-block scores

                         u =   y-block scores, and

                     bin =   inner relation coefficients.

Note: The regression matrices are ordered in b such that each Ny (number of y-block variables) rows correspond to the regression matrix for that particular number of principal components.

Algorithm

Note that unlike previous versions of the PLS function, the default algorithm (see Options, above) is the faster SIMPLS algorithm. If the alternate NIPALS algorithm is to be used, the options.algorithm field should be set to 'nip'.

See Also

analysis, crossval, modelstruct, nippls, pcr, plsda, preprocess, ridge, simpls


< plotscores plsda >