![]() |
![]() |
|
PLS_Toolbox Documentation: als | < alignmat | analysis > |
als
Purpose
Alternating Least Squares computational engine for multivariate curve resolution (MCR).
Synopsis
[c,s] = als(x,c0,options);
Description
ALS decomposes a matrix X as CS such that X = CS + E where E is minimized in a least squares sense.
Inputs are the matrix to be decomposed x (size m by n), and the initial guess c0. If c0 is size m by k, where k is the number of factors, then it is assumed to be the initial guess for C. If c0 is size k by n then it is assumed to be the initial guess for S (If m=n then, c0 is assumed to be the initial guess for C).
An optional input options is described below.
The outputs are the estimated matrix c (m by k) and s (k by n). Usually c is a matrix of concentrations and s is a matrix of spectra. The function
[c,s] = als(x,c0)
will decompose x using an non-negatively constrained alternating least squares calculation. To include other constraints, use the options described below.
Note that if no non-zero equality constraints are imposed on a factor the spectra are normalized to unit length. This can lead to significant scaling differences between factors that have non-zero equality constraints and those that do not.
Options
Examples
To decompose a matrix x without non-negativity constraints use:
options = als('options');
options.ccon = 'none';
options.scon = 'none';
[c,s] = als(x,c0,options);
The following shows an example of using soft-constraints on the second spectral component of a three-component solution assuming that the variable softs contains the spectrum to which component two should be constrained.
[m,n] = size(x);
options = als('options');
options.sc = NaN*ones(3,n); %all 3 unconstrained
options.sc(2,:) = softs; %constrain component 2
options.scwts = 0.5; %consider as ½ of total signal in X
[c,s] = als(x,c0,options);
See Also
< alignmat | analysis > |