Lwrpred: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Jeremy
imported>Scott
No edit summary
Line 20: Line 20:
* '''''options''''' = a structure array with the following fields:
* '''''options''''' = a structure array with the following fields:
* '''display''': [ 'off' | {'on'} ] governs level of display.
* '''display''': [ 'off' | {'on'} ] governs level of display.
* '''alpha''': [ 0-1 ]  Weighting of y-distances in selection of local points. 0 = do not consider y-distances {default}, 1 = consider ONLY y-distances,
* '''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.
* '''iter''': [ {5} ]  Iterations in determining local points. Used only when alpha > 0 (i.e. when using y-distance scaling),
* '''iter''': [ {5} ]  Iterations in determining local points. Used only when alpha > 0 (i.e. when using y-distance scaling).
* '''preprocessing''': { 2 2 }  Two element cell array defining preprocessing to use on data. First element of cell defines x-block preprocessing, second element defines y-block preprocessing. Options are:
* '''preprocessing''': { 2 2 }  Two element cell array defining preprocessing to use on data. First element of cell defines x-block preprocessing, second element defines y-block preprocessing. Options are:
::  '''0''' = no scaling or centering
::  '''0''' = no scaling or centering
::  '''1''' = mean center only
::  '''1''' = mean center only
::  '''2''' = autoscale (default)
::  '''2''' = autoscale (default)
::  '''For''' example: {1 2} performs mean centering on x-block and autoscaling on y-block,
::  '''For''' example: {1 2} performs mean centering on x-block and autoscaling on y-block.
* '''algorithm''': [ {'globalpcr'} | 'pcr' | 'pls' ]  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.
* '''algorithm''': [ {'globalpcr'} | 'pcr' | 'pls' ]  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.
* '''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'.
* '''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'.

Revision as of 15:05, 7 October 2008

Purpose

Predictions based on locally weighted regression models.

Synopsis

ypred = lwrpred(xnew,xold,yold,lvs,npts,out)
[ypred,extrap] = lwrpred(xnew,xold,yold,lvs,npts,out)

Description

LWRPRED makes new sample predictions ypred for a new matrix of independent variables xnew based on an existing data set of independent variables xold, and a vector of dependent variables yold. Predictions are made using a locally weighted regression model defined by the number principal components used to model the independent variables lvs and the number of points defined as local npts.

Optional input out suppresses printing of the results when set to 0 {default = 1}. Additional output (extrap), a vector equal in length to number of samples in xnew, is non-zero when the given sample was predicted by extrapolating outside of the range of y-values which were used in the model. The value represents the distance (in y-units) extrapolated outside of the modeled samples. For example, a value of -0.3 indicates that the given sample was predicted by extrapolating 0.3 y-units below the lowest modeled sample in yold.

Note: Be sure to use the same scaling on new and old samples i.e. xnew must be scaled the same as xold!

Options

  • options = a structure array with the following fields:
  • display: [ 'off' | {'on'} ] governs level of display.
  • 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.
  • iter: [ {5} ] Iterations in determining local points. Used only when alpha > 0 (i.e. when using y-distance scaling).
  • preprocessing: { 2 2 } Two element cell array defining preprocessing to use on data. First element of cell defines x-block preprocessing, second element defines y-block preprocessing. Options are:
0 = no scaling or centering
1 = mean center only
2 = autoscale (default)
For example: {1 2} performs mean centering on x-block and autoscaling on y-block.
  • algorithm: [ {'globalpcr'} | 'pcr' | 'pls' ] 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.
  • 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'.

See Also

pls, polypls