Last chance! 50% off unlimited learning
Sale ends in
whittaker(y, lambda = 1600, d = 2)
The smoother attempts to both fit a curve that represents the raw data, but is penalized if subsequent points vary too much. Mathematically it is a large, but sparse optimization problem that can be expressed in a few lines of Matlab or R code.
Wilson, D. I. (2006). The Black Art of Smoothing. Electrical and Automation Technology, June/July issue.
savgol
, ptw::whit2
# *** Sinosoid test function ***
ts <- sin(2*pi*(1:1000)/200)
t1 <- ts + rnorm(1000)/10
t3 <- whittaker(t1, lambda = 1000)
plot(1:1000, t1, col = "grey")
lines(1:1000, ts, col="blue")
lines(1:1000, t3, col="red")
Run the code above in your browser using DataLab