ts_fil_spline {tspredit} | R Documentation |
Fits a cubic smoothing spline to a time series.
ts_fil_spline(spar = NULL)
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 |
# 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)