Learn R Programming

features (version 2015.12-1)

plot: Plotting the smoothed fucntion and its derivatives.

Description

Plots of the smoothed function and its first 2 derivatives.

Usage

"plot"(x, ...)

Arguments

x
an object of class(features) that is returned by the features() function.
...
Additional arguments to be passed to the plot() function

Value

A plot is shown in a 2 x 2 layout, where the top 2 frames are the same and they depict the raw data and the smoothed function. The bottom left panel shows the smoothed first derivative, and the bottom right panel depicts the smoothed second derivative.

Examples

Run this code
# 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