kin.ssFilter | R Documentation |
Applies smoothing spline filtering to a signal using smooth.spline
.
kin.ssFilter(x, y, x2 = NULL, spar = 0.05, deriv = 0)
x |
Numeric vector containing the x-coordinates of the input signal |
y |
Numeric vector containing the y-coordinates of the input signal |
x2 |
Optional numeric vector of x-coordinates where predictions should be made. If NULL (default), predictions are made at the input x-coordinates |
spar |
Smoothing parameter, typically in (0,1]. Default is 0.05 |
deriv |
Integer specifying the order of derivative wanted. Default is 0 |
This function applies smoothing spline filtering to a signal using base R's
smooth.spline
function. The smoothing parameter spar
controls
the trade-off between smoothness and goodness of fit, with larger values
producing smoother results.
A numeric vector containing the smoothed signal values
x <- seq(0, 10, length.out = 100)
y <- sin(x) + rnorm(100, sd = 0.1)
smoothed <- kin.ssFilter(x, y, spar = 0.5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.