Description Usage Arguments Value
View source: R/linear_combination.R
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
.
1 2 3 4 5 6 | linear_combination(
targets,
references,
references_ids = NULL,
nonnegative = FALSE
)
|
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. |
a list containing the following members:
coefficient matrix
the references object as supplied
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.