  Substances such as chemical compounds are invisible to human eyes, they are
usually captured by sensing equipments with their spectral fingerprints. Though
spectra of pure chemicals can be identified by visual inspection, the spectra
of their mixtures take a variety of complicated forms. Given the knowledge of
spectral references of the constituent chemicals, the task of data fitting is
to retrieve their weights, and this usually can be obtained by solving a least
squares problem. Complications occur if the basis functions (reference spectra)
may not be used directly to best fit the data. In fact, random distortions
(spectral variability) such as shifting, compression, and expansion have been
observed in some source spectra when the underlying substances are mixed. In
this paper, we formulate mathematical model for such nonlinear effects and
build them into data fitting algorithms. If minimal knowledge of the
distortions is available, a deterministic approach termed {\it augmented least
squares} is developed and it fits the spectral references along with their
derivatives to the mixtures. If the distribution of the distortions is known a
prior, we consider to solve the problem with maximum likelihood estimators
which incorporate the shifts into the variance matrix. The proposed methods are
substantiated with numerical examples including data from Raman spectroscopy
(RS), nuclear magnetic resonance (NMR), and differential optical absorption
spectroscopy (DOAS) and show satisfactory results.
