kin.ssFilter: Smooth Signal Using Smoothing Splines

View source: R/kin.ssFilter.R

kin.ssFilterR Documentation

Smooth Signal Using Smoothing Splines

Description

Applies smoothing spline filtering to a signal using smooth.spline.

Usage

kin.ssFilter(x, y, x2 = NULL, spar = 0.05, deriv = 0)

Arguments

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

Details

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.

Value

A numeric vector containing the smoothed signal values

Examples

x <- seq(0, 10, length.out = 100)
y <- sin(x) + rnorm(100, sd = 0.1)
smoothed <- kin.ssFilter(x, y, spar = 0.5)


ccamp83/kinesis documentation built on July 4, 2025, 6:19 p.m.