View source: R/ts_fil_spline.R
ts_fil_spline | 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(tsd)
tsd$y[9] <- 2*tsd$y[9]
# filter
filter <- ts_fil_spline(spar = 0.5)
filter <- fit(filter, tsd$y)
y <- transform(filter, tsd$y)
# plot
plot_ts_pred(y=tsd$y, yadj=y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.