PLS_Toolbox Documentation: glsw | < getdatasource | gram > |
glsw
Purpose
Calculate or apply Generalized Least Squares weighting.
Synopsis
modl = glsw(x,a); %GLS on matrix
modl = glsw(x1,x2,a); %GLS between two data sets
modl = glsw(x,y,a); %GLS on matrix in groups based on y
xt = glsw(newx,modl,options); %apply correction
Description
Uses Generalized Least Squares to down-weight variable features identified from the singular value decomposition of a data matrix. The input data usually represents measured populations which should otherwise be the same (e.g. the same samples measured on two different analyzers or using two different solvents) and can be input in one of several forms, as explained below.
If the SVD of the input matrix x is X=USVT then the deweighting matrix is estimated with the following pseudo-inverse W= Udiag(sqrt(1/(diag(S)/a2+1)))VT, where the center term defines Sinv. The adjustable parameter a is used to scale the singular values prior to calculating their inverse. As a gets larger, the extent of deweighting decreases (because Sinv approaches 1). As a gets smaller (e.g. 0.1 to 0.001) the extent of deweighting increases (because Sinv approaches 0) and the deweighting includes increasing amounts of the the directions represented by smaller singular values.
A good initial guess for a is 1x10-2 but will vary depending on the covariance structure of X and the specific application.
For calibration, inputs can be provided by one of three methods:
An options structure can be used in place of (a) for any call or as the third output in an apply call. This structure consists of any of the fields:
When applying a GLSW model the inputs are newx, the x-block to be deweighted, and modl, a GLSW model structure.
Outputs are modl, a GLSW model structure, and xt, the deweighted x-block.
See Also
osccalc, pca, pls, preprocess
< getdatasource | gram > |