powered by
Baseline correction by 2nd derivative constrained weighted regression. Original algorithm proposed by Paul H. C. Eilers and Hans F.M. Boelens
baseline.als(spectra, lambda = 6, p = 0.05, maxit = 20)
Matrix of baselines corresponding to spectra spectra
spectra
Matrix of baseline corrected spectra
Matrix of final regression weights
Matrix with spectra in rows
2nd derivative constraint
Weighting of positive residuals
Maximum number of iterations
Kristian Hovde Liland and Bjørn-Helge Mevik
Iterative algorithm applying 2nd derivative constraints. Weights from previous iteration is p for positive residuals and 1-p for negative residuals.
p
1-p
Paul H. C. Eilers and Hans F.M. Boelens: Baseline Correction with Asymmetric Least Squares Smoothing
data(milk) bc.als <- baseline(milk$spectra[1,, drop=FALSE], lambda=10, method='als') if (FALSE) { plot(bc.als) }
Run the code above in your browser using DataLab