# Estimating the smooth and the derivatives of a noisy and discretely sampled function.
n <- 200
x <- sort(runif(n))
y <- exp(-0.2 * sin(2*pi*x)) + rnorm(n, sd=0.05)
ans <- features(x, y)
plot(ans)
ans.sm <- features(x, y, smoother="smooth.spline")
plot(ans.sm)
Run the code above in your browser using DataLab