omp: Spectral mixture analysis: Orthogonal Matching Pursuit (OMP)

Description Usage Arguments Details Value References

View source: R/omp.R

Description

Use the Orthogonal Matching Pursuit to estimate sparse coefficients for a linear combination of reference spectra to represent one or multiple target spectra.

Usage

1
2
3
4
5
6
7
8
omp(
  targets,
  references,
  tol = 0.2,
  references_ids = NULL,
  parallel = FALSE,
  ncores = 4
)

Arguments

targets

a hyperSpec object.

references

a hyperSpec object containing the spectra to be combined in in a linear manner.

tol

The tolerance value to terminate the algorithm, see ompr. As the function is run with method = "SSE", the algorithm stops if the relative change in the sum of squared errors is equal to or less than tol.

references_ids

either a single string or numeric specifying the column with names for the references in the object 'references', or a character vector with a name per reference spectrum.

parallel

logical; If this is TRUE, parApply is used. Please be aware that the function handles starting and stoping of the cluster (type = "PSOCK").

ncores

number of logical cores to use for parallel processing. Be aware that more is not necessarily better, as starting new processes adds overhead which potentially is bigger than the time savings from parallel processing.

Details

This is a wrapper around ompr. The function is run with method = "SSE".

Value

a list containing the following members:

coefficients

coefficient matrix

basis

the references object as supplied

fit

the return value of the multivariate call to 'stats::lm()' or a list of return values of the outputs of 'nnls::nnls()' for each target spectrum.

References

Pati, Y. C., R. Rezaiifar, Y. C. Pati R. Rezaiifar, and P. S. Krishnaprasad. “Orthogonal Matching Pursuit: Recursive Function Approximation with Applications to Wavelet Decomposition.” In Proceedings of the 27 Th Annual Asilomar Conference on Signals, Systems, and Computers, 40–44, 1993.


konradmayer/hyperSpec.utils documentation built on May 2, 2021, 4:17 a.m.