Mcr: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Donal
imported>Jeremy
Line 12: Line 12:
===Description===
===Description===


MCR 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 either the number of components to extract, ncomp, or the explict 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'''. Optional input ''options'' is described below.
MCR decomposes a matrix '''X''' as '''CS''' such that '''X''' = '''CS''' + '''E''' where '''E''' is minimized in a least squares sense. By default, this is done using the alternating least squares (ALS) algorithm. For details on the ALS algorithm and constraints available in MCR, see the [[als]] reference page.


The output, model, is a standard model structure. The estimated contributionss '''C '''are stored in model.loads{2} and the estimated spectra '''S '''in model.loads{1}. Sum-squared residuals for samples and variables can be found in model.ssqresiduals{1} and model.ssqresiduals{2}, respectively. See the PLS_Toolbox manual for more information on the MCR method and models.
When called with new data and a model structure, MCR performs a prediction (applies the model to the new data) returning the projection of the new data onto the previously recovered loadings (i.e. estimated spectra).


MCR, by default, uses the alternating least squares (ALS) algorithm. For details on the ALS algorithm and constraints available in MCR, see the ALS reference page.
====Inputs====
* '''x''' = the matrix to be decomposed (size ''m'' by ''n'')
* '''ncomp''' or '''c0''' or '''model''' :
** '''ncomp''' = the number of components to extract
** '''c0''' = the explicit initial guess where, 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'''. Optional input ''options'' is described below.
** '''model''' = a previously calculated MCR model structure to apply to the data in input '''x'''.


When called with new data and a model structure, MCR performs a prediction (applies the model to the new data) returning the projection of the new data onto the previously recovered loadings (i.e. estimated spectra).
====Outputs====
 
* '''model''' = a standard model structure containing the results of the analysis. The estimated contributions '''C '''are stored in model.loads{2} and the estimated spectra '''S '''in model.loads{1}. Sum-squared residuals for samples and variables can be found in model.ssqresiduals{1} and model.ssqresiduals{2}, respectively. See the chemometrics tutorial for more information on the MCR method and models.


===Options===
===Options===

Revision as of 13:56, 28 February 2011

Purpose

Multivariate curve resolution with constraints.

Synopsis

model = mcr(x,ncomp,options) %calibrate
model = mcr(x,c0,options) %calibrate with explict initial guess
pred = mcr(x,model,options) %predict

Description

MCR decomposes a matrix X as CS such that X = CS + E where E is minimized in a least squares sense. By default, this is done using the alternating least squares (ALS) algorithm. For details on the ALS algorithm and constraints available in MCR, see the als reference page.

When called with new data and a model structure, MCR performs a prediction (applies the model to the new data) returning the projection of the new data onto the previously recovered loadings (i.e. estimated spectra).

Inputs

  • x = the matrix to be decomposed (size m by n)
  • ncomp or c0 or model :
    • ncomp = the number of components to extract
    • c0 = the explicit initial guess where, 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. Optional input options is described below.
    • model = a previously calculated MCR model structure to apply to the data in input x.

Outputs

  • model = a standard model structure containing the results of the analysis. The estimated contributions C are stored in model.loads{2} and the estimated spectra S in model.loads{1}. Sum-squared residuals for samples and variables can be found in model.ssqresiduals{1} and model.ssqresiduals{2}, respectively. See the chemometrics tutorial for more information on the MCR method and models.

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.
  • preprocessing: { [] } preprocessing to apply to x-block (see PREPROCESS).
  • blockdetails: [ 'compact' | {'standard'} | 'all' ] Extent of predictions and raw residuals included in model. 'standard' = none, 'all' x-block.
  • confidencelimit: [{0.95}] Confidence level for Q limits.
  • alsoptions: ['options'] options passed to ALS subroutine (see ALS).

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

See Also

als, analysis, evolvfa, ewfa, fastnnls, mlpca, parafac, plotloads, preprocess