Learn R Programming

baseline (version 1.3-5)

baseline.irls: Iterative Restricted Least Squares

Description

An algorithm with primary smoothing and repeated baseline suppressions and regressions with 2nd derivative constraint

Usage

baseline.irls(spectra, lambda1 = 5, lambda2 = 9, maxit = 200, wi = 0.05)

Value

baseline

Matrix of baselines corresponding to spectra spectra

corrected

Matrix of baseline corrected spectra

smoothed

Matrix of primary smoothed spectra

Arguments

spectra

Matrix with spectra in rows

lambda1

2nd derivative constraint for primary smoothing

lambda2

2nd derivative constraint for secondary smoothing

maxit

Maximum number of iterations

wi

Weighting of positive residuals

Author

Kristian Hovde Liland and Bjørn-Helge Mevik

Examples

Run this code
data(milk)
bc.irls <- baseline(milk$spectra[1,, drop=FALSE], method='irls')
if (FALSE) {
	plot(bc.irls)
}

Run the code above in your browser using DataLab