Emscorr: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Neal
No edit summary
imported>Neal
No edit summary
Line 29: Line 29:
::initwt: [ ]  Empty or ''N''x1 vector of initial weights (0<=w<=1). Low weights are used for channels not to be included in the fit.
::initwt: [ ]  Empty or ''N''x1 vector of initial weights (0<=w<=1). Low weights are used for channels not to be included in the fit.
::condnum: [1e6]  Maximum condition number for <tt>'''Z''''*'''Z''''</tt> used in the least squares estimates (see Algorithm).
::condnum: [1e6]  Maximum condition number for <tt>'''Z''''*'''Z''''</tt> used in the least squares estimates (see Algorithm).
::xrefS: [{'no'} | 'yes']  Indicates whether input (xref) includes spectra contained in (options.s). If <tt>'yes'</tt> then the spectra in (options.s) are centered and an SVD estimate of (options.s) is used in EMSCORR.
::xrefS: [{'no'} | 'yes']  Indicates whether input (xref) includes spectra contained in (options.s). If <tt>'yes'</tt> then the spectra in (options.s) are centered and an SVD estimate of (options.s) is used in EMSCORR instead of (options.s).
      robust: [{'none'} | 'lsq2top' ] Governs the use of robust least squares
::robust: [ {'none'} | 'lsq2top' ] Governs the use of robust least squares. If 'lsq2top' is used then (options.trbflag), (options.tsqlim) and (options.stopcrit) are also used (see LSQ2TOP for descriptions of these fields).
                if 'lsq2top' is used then "trbflag", "tsqlim", and "stopcrit" are
::res: [ ] Positive scalar (required with <tt>options.lsq2top = 'yes'</tt>). It is the input (res) to the LSQ2TOP function.  
                also used (see LSQ2TOP for descriptions of these fields).
::trbflag: [ 'top' | 'bottom' | {'middle'} ] Used only when <tt>options.lsq2top = 'yes'</tt>.
          res: [] Scalar (required with "lsq2top") this is input (res) to
::tsqlim: [ 0.99 ]   Used only when <tt>options.lsq2top = 'yes'</tt>.
                the LSQ2TOP function.  
::stopcrit: [1e-4 1e-4 1000 360] Used only when <tt>options.lsq2top = 'yes'</tt>.
      trbflag: [ 'top' | 'bottom' | {'middle'}] Used only with lsq2top.
::axisscale: [ ] 1x''N'' axis scale for the spectral mode, if empty <tt>[1:N]</tt> is used.
      tsqlim: [ 0.99 ] Used only with lsq2top.
::mag: [ {'yes'} | 'no' ], performs slope correction when set to 'yes'.
    stopcrit: [1e-4 1e-4 1000 360] Used only with lsq2top.
    axisscale: [] 1 by N axis scale for the spectral mode, if empty [1:N] is used.
          mag: [ {'yes'} | 'no' ], performs slope correction when set to 'yes'


====Outputs====
====Outputs====
Line 59: Line 56:
===See Also===
===See Also===


[[baselinew]], [[deresolv]], [[
[[mscorr]], [[stdfir]], [[emscorrdemo2]]


[[Category:EMSC_Toolbox]]
[[Category:EMSC_Toolbox]]

Revision as of 12:31, 16 October 2008

Purpose

Extended multiplicative scatter correction (EMSC) preprocessing.

Synopsis

[sx,fx,xref,reg,res] = emscorr(x,xref,options)

Description

EMSCORR attempts to remove additive and multiplicative scattering effects in spectra. This can be thought of as a filter where some portions of the signal are passed and some are rejected. Each row of input (x) is regressed against input (xref) and the results are used to "correct" (x). If (xref) is not input then mean(x) is used.

There are several options to allow for weighted least squares (i.e., to de-weight channels that should not be included in the regression), for using different spectra to be filtered out, and for using spectra not to filtered out.

Inputs

x = is a MxN matrix (class "double") of M spectra measured at N channels.

Optional Inputs

xref = 1xN reference spectrum to regress against. If not input, mean(x) is used.
options = structure array with the following fields:
order: [ {2} ] Order of the polynomial filter (positive integer).
logax: [ {'no'} | 'yes' ] Use the log of the axisscale, x.axisscale{2} as a basis vector to regress against. If the axisscale is not present log(1:N) is used. When (options.logax) is used, (options.order) is typically set to zero.
s: [ ] KxN spectra to not filter out.
p: [ ] KpxN spectra to filter out.
algorithm: [ {'cls'} | 'ils' ] Governs correction model method.
'cls' uses Classical Least Squares i.e., EMSC.
'ils' uses Inverse Least Squares i.e., EISC.
win: [ ] An odd scalar that defines the window width (number of variables) for piece-wise correction. If empty {the default} piece-wise is not used. Note that piece-wise correction can be slow.
initwt: [ ] Empty or Nx1 vector of initial weights (0<=w<=1). Low weights are used for channels not to be included in the fit.
condnum: [1e6] Maximum condition number for Z'*Z' used in the least squares estimates (see Algorithm).
xrefS: [{'no'} | 'yes'] Indicates whether input (xref) includes spectra contained in (options.s). If 'yes' then the spectra in (options.s) are centered and an SVD estimate of (options.s) is used in EMSCORR instead of (options.s).
robust: [ {'none'} | 'lsq2top' ] Governs the use of robust least squares. If 'lsq2top' is used then (options.trbflag), (options.tsqlim) and (options.stopcrit) are also used (see LSQ2TOP for descriptions of these fields).
res: [ ] Positive scalar (required with options.lsq2top = 'yes'). It is the input (res) to the LSQ2TOP function.
trbflag: [ 'top' | 'bottom' | {'middle'} ] Used only when options.lsq2top = 'yes'.
tsqlim: [ 0.99 ] Used only when options.lsq2top = 'yes'.
stopcrit: [1e-4 1e-4 1000 360] Used only when options.lsq2top = 'yes'.
axisscale: [ ] 1xN axis scale for the spectral mode, if empty [1:N] is used.
mag: [ {'yes'} | 'no' ], performs slope correction when set to 'yes'.

Outputs

sx = the corrected spectra.
fx = the signal that was filtered out.
xref = the reference spectrum.
reg = the regression coefficients. For non-windowed filtering, (reg) is [number of coefficients] x M. The number of coefficients corresponds to the number of basis vectors included in the correction. The coefficients are ordered according to the following: xbase = [xref, 1 x x2 ..., options.p, options.s]. If a windowed filter is used, (reg) is [number of coefficients] x N x M where mode 2 corresponds to the windows.
res = MxN matrix of residuals.

Algorithm

Example

>>This is an example
Error: does not exist

See Also

mscorr, stdfir, emscorrdemo2