baseline.rfbaseline: Robust Baseline Estimation

View source: R/baseline.rfbaseline.R

baseline.rfbaselineR Documentation

Robust Baseline Estimation

Description

Wrapper for Andreas F. Ruckstuhl, Matthew P. Jacobson, Robert W. Field, James A. Dodd's algorithm based on LOWESS and weighted regression

Usage

baseline.rfbaseline(spectra, span = 2/3, NoXP = NULL, maxit = c(2, 2),
  b = 3.5, weight = NULL, Scale = function(r) median(abs(r))/0.6745,
  delta = NULL, SORT = FALSE, DOT = FALSE, init = NULL)

Arguments

spectra

Matrix with spectra in rows

span

Amount of smoothing (by fraction of points)

NoXP

Amount of smoothing (by number of points)

maxit

Maximum number of iterations in robust fit

b

Tuning constant in the biweight function

weight

Optional weights to be given to individual observations

Scale

S function specifying how to calculate the scale of the residuals

delta

Nonnegative parameter which may be used to save computation. (See rfbaseline

SORT

Boolean variable indicating whether x data must be sorted.

DOT

Disregard outliers totally (boolean)

init

Values of initial fit

Details

Most of the code is the original code as given by the authors. The ability to sort by X-values has been removed and ability to handle multiple spectra has been added

Value

baseline

Matrix of baselines corresponding to spectra spectra

corrected

Matrix of baseline corrected spectra

Author(s)

Kristian Hovde Liland and Bjørn-Helge Mevik

References

Andreas F. Ruckstuhl, Matthew P. Jacobson, Robert W. Field, James A. Dodd: Baseline subtraction using robust local regression estimation

Examples

data(milk)
bc.rbe <- baseline(milk$spectra[1,, drop=FALSE], method='rfbaseline',
  span=NULL, NoXP=1000)
## Not run: 
	plot(bc.rbe)

## End(Not run)

khliland/baseline documentation built on Nov. 24, 2023, 9:28 a.m.