Difference between revisions of "Vipnway"

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Scott
(Created page with "===Purpose=== Calculate Variable Importance in Projection from NPLS model. ===Synopsis=== :vip_scores = vipnway(model) ===Description=== Variable Importance in Projection...")
 
imported>Scott
Line 17: Line 17:
 
====Outputs====
 
====Outputs====
  
* '''model''' = a standard model structure model with the following fields (see [[Standard Model Structure]]):
+
* '''vip_scores''' = a cell array with dimensions of: [modes 2 to n X # of columns in Y]. The first row in the cell array corresponds to VIP Scores for mode 2. The second row corresponds to VIP Scores for mode 3.
** '''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 T<sup>2</sup> 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.
 
 
 
* '''pred''' a structure, similar to '''model''', that contains scores, predictions, etc. for the new data.
 
 
 
* '''valid''' 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:
 
 
 
* '''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'} | 'dspls' | 'robustpls' ], PLS algorithm to use: NIPALS, SIMPLS {default},  Direct Scores, or robust pls (with automatic outlier detection).
 
* '''orthogonalize''': [ {'off'} | 'on' ] Orthogonalize model to condense y-block variance into first latent variable; 'on' = produce orthogonalized model. Regression vector and predictions are NOT changed by this option, only the loadings, weights, and scores. See [[orthogonalizepls]] for more information.
 
* '''blockdetails''': [  'compact' | {'standard'} | 'all' ] level of detail (predictions, raw residuals, and calibration data) included in the model.
 
:* ‘Standard’ = the predictions and raw residuals for the X-block as well as the X-block itself are not stored in the model to reduce its size in memory. Specifically, these fields in the model object are left empty: 'model.pred{1}', 'model.detail.res{1}', 'model.detail.data{1}'.
 
:* ‘Compact’ = for this function, 'compact' is identical to 'standard'.
 
:* 'All' = keep predictions, raw residuals for both X- & Y-blocks as well as the X- & Y-blocks themselves.
 
*'''confidencelimit''': [ {'0.95'} ], confidence level for Q and T2 limits, a value of zero (0) disables calculation of confidence limits,
 
*'''weights''': [ {'none'} | 'hist' | 'custom' ]  governs sample weighting. 'none' does no weighting. 'hist' performs histogram weighting in which large numbers of samples at individual y-values are down-weighted relative to small numbers of samples at other values. 'custom' uses the weighting specified in the weightsvect option.
 
*'''weightsvect''': [ ] Used only with custom weights. The vector specified must be equal in length to the number of samples in the y block and each element is used as a weight for the corresponding sample. If empty, no sample weighting is done.
 
* '''roptions''': structure of options to pass to rsimpls (robust PLS engine from the Libra Toolbox).
 
** '''alpha''': [ {0.75} ], (1-alpha) measures the number of outliers the algorithm should resist. Any value between 0.5 and 1 may be specified. These options are only used when algorithm is 'robustpls'.
 
 
 
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 as defined for the [[nippls]] function. This is provided for backwards compatibility. It is recommended that users call the [[simpls]] or [[nippls]] functions directly.
 
 
 
There is also a difference in the scores and loadings returned by the old version and the new (default) version. The old version (outputversion=2) keeps the variance in the loadings and the scores are normalized. The new version (outputversion=3) keeps the variance in the scores and has normalized loadings. The older format is related to the usage in the original algorithm publications. The newer format is used in order to maintain a standardized format across all PLS algorithms (robust PLS, and DSPLS).
 
 
 
===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'.
 
 
 
Option 'robustpls' enables a robust method for Partial Least Squares Regression based on the SIMPLS algorithm. This uses the function 'rsimpls' from the well-known LIBRA Toolbox, developed by Mia Hubert's research group at the Katholieke Universiteit Leuven (kuleuven.be). The RSIMPLS method is described in:  Hubert, M., and Vanden Branden, K. (2003), "Robust Methods for Partial Least Squares Regression", Journal of Chemometrics, 17, 537-549.
 
  
 
===See Also===
 
===See Also===
  
[[analysis]], [[crossval]], [[mlr]], [[modelstruct]], [[nippls]], [[pcr]], [[plsda]], [[preprocess]], [[ridge]], [[simpls]]
+
[[selectvars]], [[genalg]], [[ipls]], [[plotloads]], [[pls]], [[plsda]], [[sratio]], [[rpls]], [[vip]]

Revision as of 17:06, 18 December 2018

Purpose

Calculate Variable Importance in Projection from NPLS model.

Synopsis

vip_scores = vipnway(model)

Description

Variable Importance in Projection (VIP) scores estimate the importance of each variable in the projection used in a NPLS model and is often used for variable selection. A variable with a VIP Score close to or greater than 1 (one) can be considered important in given model. Variables with VIP scores significantly less than 1 (one) are less important and might be good candidates for exclusion from the model. It works for X n-way and Y up to two-way and it assume samples are in the first mode.

Inputs

  • model = A NPLS model structure from a NPLS model.

Outputs

  • vip_scores = a cell array with dimensions of: [modes 2 to n X # of columns in Y]. The first row in the cell array corresponds to VIP Scores for mode 2. The second row corresponds to VIP Scores for mode 3.

See Also

selectvars, genalg, ipls, plotloads, pls, plsda, sratio, rpls, vip