linear_combination: Spectral mixture analysis: Linear combination of spectra

Description Usage Arguments Value

View source: R/linear_combination.R

Description

Use linear regression resp. non negative linear regression (package nnls) without intercept to estimate coefficients for a linear combination of reference spectra to represent one or multiple target spectra. For a sparse solution and/or correlated references see omp.

Usage

1
2
3
4
5
6
linear_combination(
  targets,
  references,
  references_ids = NULL,
  nonnegative = FALSE
)

Arguments

targets

a hyperSpec object.

references

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

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.

nonnegative

logical; set TRUE to restrict coefficients to be positive.

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.


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