ts_fil_spline {tspredit}R Documentation

Smoothing Splines

Description

Fits a cubic smoothing spline to a time series.

Usage

ts_fil_spline(spar = NULL)

Arguments

spar

smoothing parameter. When spar is specified, the coefficient of the integral of the squared second derivative in the fitting criterion (penalized log-likelihood) is a monotone function of spar. #'@return a ts_fil_spline object.

Examples

# time series with noise
library(daltoolbox)
data(sin_data)
sin_data$y[9] <- 2*sin_data$y[9]

# filter
filter <- ts_fil_spline(spar = 0.5)
filter <- fit(filter, sin_data$y)
y <- transform(filter, sin_data$y)

# plot
plot_ts_pred(y=sin_data$y, yadj=y)

[Package tspredit version 1.0.767 Index]