Lwr: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Donal
imported>Donal
No edit summary
Line 66: Line 66:
* '''alpha''': [ {0.75} ], (1-alpha) [0-1] Weighting of y-distances in selection of local points. 0 = do not consider y-distances {default}, 1 = consider ONLY y-distances. With any positive alpha, the algorithm will tend to select samples which are close in both the PC space but which also have similar y-values. This is accomplished by repeating the prediction multiple times. In the first iteration, the selection of samples is done only on the PC space. Subsequent iterations take into account the comparison between predicted y-value of the new sample and the measured y-values of the calibration samples.
* '''alpha''': [ {0.75} ], (1-alpha) [0-1] Weighting of y-distances in selection of local points. 0 = do not consider y-distances {default}, 1 = consider ONLY y-distances. With any positive alpha, the algorithm will tend to select samples which are close in both the PC space but which also have similar y-values. This is accomplished by repeating the prediction multiple times. In the first iteration, the selection of samples is done only on the PC space. Subsequent iterations take into account the comparison between predicted y-value of the new sample and the measured y-values of the calibration samples.
The default options can be retreived using: options = lwr('options');.
The default options can be retreived using: options = lwr('options');.
===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===
===See Also===


[[analysis]], [[lwrpred]], [[modelstruct]], [[pls]], [[pcr]], [[preprocess]]
[[analysis]], [[lwrpred]], [[modelstruct]], [[pls]], [[pcr]], [[preprocess]]

Revision as of 13:52, 25 January 2010

Purpose

LWR locally weighted regression for multivariate Y.

Synopsis

model = lwr(x,y,ncomp,npts,options); %identifies model (calibration step)
pred = lwr(x,model,options); %makes predictions with a new X-block
options = lwr(options); %returns a default options structure

Description

LWR calculates a single locally weighted regression model using the given number of principal components ncomp to predict a dependent variable y from a set of independent variables x.

Predictions are made using a locally weighted regression model defined by the number principal components used to model the independent variables (ncomp), and the number of points defined as local (npts).

Alternatively, LWR can be used in 'predicton mode' to apply a previously built LWR model in model to an external set of test data in x (2-way array class "double" or "dataset"), in order to generate y-values for these data.

Furthermore, if matching x-block and y-block measurements are available for an external test set, then LWR can be used in 'validation mode' to predict the y-values of the test data from the model model and x, and allow comparison of these predicted y-values to the known y-values y.

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

Inputs

  • x = X-block (predictor block) class "double" or "dataset"
  • y = Y-block (predicted block) class "double" or "dataset"
  • ncomp = the number of latent variables to be calculated (positive integer scalar)
  • npts = the number of points to use in local regression (positive integer scalar)
  • model = previously generated lwr model

Outputs

  • model = a standard model structure model with the following fields (see MODELSTRUCT):
    • modeltype: 'LWR',
    • 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.
    • 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.
  • 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.

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: [ 'globalpcr' | {'pcr'} | 'pls' ] LWR algorithm to use. Method of regression after samples are selected. 'globalpcr' performs PCR based on the PCs calculated from the entire calibration data set but a regression vector calculated from only the selected samples. 'pcr' and 'pls' calculate a local PCR or PLS model based only on the selected samples.
  • blockdetails: [ {'standard'} | 'all' ], extent of predictions and residuals included in model, 'standard' = only y-block, 'all' x- and y-blocks.
  • confidencelimit: [ {'0.95'} ], confidence level for Q and T2 limits, a value of zero (0) disables calculation of confidence limits,
  • reglvs: [] Used only when algorithm is 'pcr' or 'pls', this is the number of latent variables/principal components to use in the regression model, if different from the number used to select calibration samples. [] (Empty) implies LWRPRED should use the same number of latent variables in the regression as were used to select samples. NOTE: This option is NOT used when algorithm is 'globalpcr'.
  • iter: [{5}] Iterations in determining local points. Used only when alpha > 0 (i.e. when using y-distance scaling).
  • alpha: [ {0.75} ], (1-alpha) [0-1] Weighting of y-distances in selection of local points. 0 = do not consider y-distances {default}, 1 = consider ONLY y-distances. With any positive alpha, the algorithm will tend to select samples which are close in both the PC space but which also have similar y-values. This is accomplished by repeating the prediction multiple times. In the first iteration, the selection of samples is done only on the PC space. Subsequent iterations take into account the comparison between predicted y-value of the new sample and the measured y-values of the calibration samples.

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

See Also

analysis, lwrpred, modelstruct, pls, pcr, preprocess