whit1: Weighted Whittaker smoothing with a first order finite...

Description Usage Arguments Value Author(s) References Examples

View source: R/whit1.R

Description

This function smoothes signals with a finite difference penalty of order 1.

Usage

1
whit1(y, lambda, w)

Arguments

y

signal to be smoothed: a vector

lambda

smoothing parameter: larger values lead to more smoothing

w

weights: a vector of same length as y. Default weights are equal to one

Value

smoothed signal: a vector

Author(s)

Paul Eilers, Jan Gerretzen

References

Eilers, P.H.C. (2004) "Parametric Time Warping", Analytical Chemistry, 76 (2), 404 – 411.

Eilers, P.H.C. (2003) "A perfect smoother", Analytical Chemistry, 75, 3631 – 3636.

Examples

1
2
3
4
5
6
  data(gaschrom)
  plot(gaschrom[1,], type = "l", ylim = c(0, 100))
  lines(whit1(gaschrom[1,], lambda = 1e1), col = 2)
  lines(whit1(gaschrom[1,], lambda = 1e2), col = 3)
  lines(whit1(gaschrom[1,], lambda = 1e3), col = 4)
  

ptw documentation built on Jan. 19, 2022, 5:07 p.m.