Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

baseline.als

Asymmetric Least Squares


Description

Baseline correction by 2nd derivative constrained weighted regression. Original algorithm proposed by Paul H. C. Eilers and Hans F.M. Boelens

Usage

baseline.als(spectra, lambda = 6, p = 0.05, maxit = 20)

Arguments

spectra

Matrix with spectra in rows

lambda

2nd derivative constraint

p

Weighting of positive residuals

maxit

Maximum number of iterations

Details

Iterative algorithm applying 2nd derivative constraints. Weights from previous iteration is p for positive residuals and 1-p for negative residuals.

Value

baseline

Matrix of baselines corresponding to spectra spectra

corrected

Matrix of baseline corrected spectra

wgts

Matrix of final regression weights

Author(s)

Kristian Hovde Liland and Bjørn-Helge Mevik

References

Paul H. C. Eilers and Hans F.M. Boelens: Baseline Correction with Asymmetric Least Squares Smoothing

Examples

data(milk)
bc.als <- baseline(milk$spectra[1,, drop=FALSE], lambda=10, method='als')
## Not run: 
plot(bc.als)

## End(Not run)

baseline

Baseline Correction of Spectra

v1.3-1
GPL-2
Authors
Kristian Hovde Liland [aut, cre], Bjørn-Helge Mevik [aut], Roberto Canteri [ctb]
Initial release
2020-09-10

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.