Learn R Programming

ChemometricsWithR (version 0.1.13)

MCR: Functions for Multivariate Curve Resolution

Description

Multivariate Curve Resolution, or MCR, decomposes a bilinear matrix into its pure components. A classical example is a matrix consisting of a series of spectral measurements on a mixture of chemicals for following the reaction. At every time point, a spectrum is measured that is a linear combination of the pure spectra. The goal of MCR is to resolve the pure spectra and concentration profiles over time.

Usage

mcr(x, init, what = c("row", "col"), convergence = 1e-08,
    maxit = 50)
opa(x, ncomp)
efa(x, ncomp)

Arguments

x

Data matrix

init

Initial guess for pure compounds

what

Whether the pure compounds are rows or columns of the data matrix

convergence

Convergence criterion

maxit

Maximal number of iterations

ncomp

Number of pure compounds

Value

Function mcr returns a list containing

C

An estimate of the pure "concentration profiles"

S

An estimate of the pure "spectra"

resids

The residuals of the final decomposition

rms

Root-mean-square values of the individual iterations

Function opa returns a list containing
pure.compounds:

A matrix containing ncomp pure compounds, usually spectra at specific time points

selected:

The wavelengths leading to the estimates of the pure concentration profiles

Function efa returns a list containing
pure.compounds:

A matrix containing ncomp pure compounds, usually concentration profiles at specific wavelengths

forward:

The development of the singular values of the reduced data matrix when increasing the number of columns in the forward direction

backward:

The development of the singular values of the reduced data matrix when increasing the number of columns in the backwarddirection

Usually, opa and efa are employed in opposite ways: if opa is used to find the "purest" row of a data matrix, one would typically employ efa to find the "purest" column, and vice versa.

Details

MCR uses repeated application of least-squares regression to find pure profiles and spectra. The method is iterative; both EFA and OPA are methods to provide initial guesses.

References

R. Wehrens. "Chemometrics with R - Multivariate Data Analysis in the Natural Sciences and Life Sciences". Springer, Heidelberg, 2011.

Examples

Run this code
# NOT RUN {
if (require("ChemometricsWithRData")) {
  data(bdata, package = "ChemometricsWithRData")
  D1.efa <- efa(bdata$d1, 3)
  matplot(D1.efa$forward, type = "l")
  matplot(D1.efa$backward, type = "l")
  matplot(D1.efa$pure.comp, type = "l")

  D1.opa <- opa(bdata$d1, 3)
  matplot(D1.opa$pure.comp, type = "l")

  D1.mcr.efa <- mcr(bdata$d1, D1.efa$pure.comp, what = "col")
  matplot(D1.mcr.efa$C, type = "l", main = "Concentration profiles")
  matplot(t(D1.mcr.efa$S), type = "l", main = "Pure spectra")
  }
# }

Run the code above in your browser using DataLab