# Curve Resolution Models API Reference

## Functions

`ChemometricsTools.BTEM`

— Function.`BTEM(X, bands = nothing; Factors = 3, particles = 50, maxiters = 1000)`

Returns a single recovered spectra from a 2-Array `X`

, the selected `bands`

, number of `Factors`

, using a Particle Swarm Optimizer. *Note: This is not the function used in the original paper. This will be updated... it was written from memory. Also the original method uses Simulated Annealing not PSO.* Band-Target Entropy Minimization (BTEM): An Advanced Method for Recovering Unknown Pure Component Spectra. Application to the FTIR Spectra of Unstable Organometallic Mixtures. Wee Chew,Effendi Widjaja, and, and Marc Garland. Organometallics 2002 21 (9), 1982-1990. DOI: 10.1021/om0108752

`ChemometricsTools.BTEMobjective`

— Method.`BTEMobjective( a, X )`

Returns the scalar BTEM objective function obtained from the linear combination vector `a`

and loadings `X`

. *Note: This is not the function used in the original paper. This will be updated... it was written from memory.*

`ChemometricsTools.FNNLS`

— Method.`FNNLS( A, b; LHS = false, maxiters = 500 )`

Uses an implementation of Bro et. al's Fast Non-Negative Least Squares on the matrix `A`

and vector `b`

. Returns regression coefficients in the form of a vector.

Bro, R., de Jong, S. (1997) A fast non-negativity-constrained least squares algorithm. Journal of Chemometrics, 11, 393-401.

`ChemometricsTools.ITTFA`

— Method.```
ITTFA(X; Factors = 1, maxiters = 500, threshold = 1e-8,
nonnegativity = true)
```

This function performs a Iterative Target Transform Factor Analysis (ITTFA). It's untested. Use at your own risk.

Chemometric characterization of batch reactions. ISA Transactions 38(3):211-216. July 1999. DOI: 10.1016/S0019-0578(99)00022-1

`ChemometricsTools.MCRALS`

— Function.`MCRALS(X, C, S = nothing; norm = (false, false), Factors = 1, maxiters = 20, constraintiters = 500, nonnegative = (false, false), unimodalS = false, fixedunimodal = false )`

Performs Multivariate Curve Resolution using Alternating Least Squares on `X`

taking initial estimates for either `S`

or `C`

. The number of maximum iterations for the ALS updates can be set `maxiters`

. S or C can be constrained by their `norm`

(true/false,true/false), or by nonnegativity by using `nonnegative`

arguments (true/false,true/false). S can also be constrained by unimodality(`unimodalS`

). Two unimodal algorithms exist the `fixedunimodal`

(true), and the quadratic (false). The number of resolved `Factors`

can also be set. The number of maximum iterations for constraints can be set by `constraintiters`

.

Tauler, R. Izquierdo-Ridorsa, A. Casassas, E. Simultaneous analysis of several spectroscopic titrations with self-modelling curve resolution.Chemometrics and Intelligent Laboratory Systems. 18, 3, (1993), 293-300.

`ChemometricsTools.NMF`

— Method.`NMF(X; Factors = 1, tolerance = 1e-7, maxiters = 200)`

Performs a variation of non-negative matrix factorization on Array `X`

and returns the a 2-Tuple of (Concentration Profile, Spectra) *Note: This is not a coordinate descent based NMF. This is a simple fast version which works well enough for chemical signals*

Algorithms for non-negative matrix factorization. Daniel D. Lee. H. Sebastian Seung. NIPS'00 Proceedings of the 13th International Conference on Neural Information Processing Systems. 535-54

`ChemometricsTools.SIMPLISMA`

— Method.`SIMPLISMA(X; Factors = 1, alpha = 0.05, includedvars = 1:size(X)[2], SecondDeriv = true)`

Performs SIMPLISMA on Array `X`

using either the raw spectra or the Second Derivative spectra. alpha can be set to reduce contributions of baseline, and a list of included variables in the determination of pure variables may also be provided. Returns a tuple of the following form: (Concentraion Profile, Pure Spectral Estimates, Pure Variables)

W. Windig, Spectral Data Files for Self-Modeling Curve Resolution with Examples Using the SIMPLISMA Approach, Chemometrics and Intelligent Laboratory Systems, 36, 1997, 3-16.

`ChemometricsTools.UnimodalFixedUpdate`

— Method.`UnimodalFixedUpdate(x)`

This function performs a unimodal least squares update at a fixed maximum for a vector x. This is faster then UnimodalUpdate() but, is less accurate.

Bro R., Sidiropoulos N. D.. Least Squares Algorithms Under Unimodality and Non-Negativity Constraints

`ChemometricsTools.UnimodalLeastSquares`

— Method.`UnimodalLeastSquares(x)`

This function performs a unimodal least squares regression for a matrix A and b (X and Y).

Bro R., Sidiropoulos N. D.. Least Squares Algorithms Under Unimodality and Non-Negativity Constraints.Journal of Chemometrics, June 3, 1997

`ChemometricsTools.UnimodalUpdate`

— Method.`UnimodalUpdate(x)`

This function performs a unimodal least squares update for a vector x. This is slower then UnimodalUpdate() but, is more accurate.

Bro R., Sidiropoulos N. D.. Least Squares Algorithms Under Unimodality and Non-Negativity Constraints. Journal of Chemometrics, June 3, 1997