Is there a way/method/approach to decompose a time series data using regression splines:

  1. Seasonal time series into trend+seasonal+random component ?
  2. A non seasonal time series into trend+random component ?

I'm familiar with STL, Census and classical decomposition in R. All these techniques require time series data with seasonal component. We cannot extract trend if the time series is non seasonal (i.e., Frequency = 1).

I recently came across this interesting article which is data driven in the recent 2013 ISF. Any insights on methods like these that are data driven decomposition using regression splines and that can be readily programmed in software packages such R would be greatly helpful.

Thanks so much

Detrending time series with cycle and seasonal components Tatyana Krivobokova and Francisco Rosales In this work we discuss a nonparametric and completely data-driven approach to the decomposition of time series into a trend (cycle), seasonal and random components. Two former are modeled with penalized splines, while the latter is assumed to follow an ARMA structure. Empirical Bayesian approach allows to estimate both smoothing parameters and the orders of the ARMA process simultaneously resulting in an efficient, fast and data-driven decomposition procedure. The practical relevance of the approach is illustrated by real-data examples. The work is the extension of Kauermann, G., Krivobokova, T., Semmler, W. (2011) Filtering time series with penalized splines. Studies in Nonlinear Dynamics & Econometrics.

  • $\begingroup$ What's not "data driven" about STL? It is fully nonparametric. $\endgroup$ Commented Sep 12, 2013 at 22:29
  • $\begingroup$ Rob, I have modified the question. I deleted the incorrect statement. $\endgroup$
    – forecaster
    Commented Sep 13, 2013 at 0:38
  • $\begingroup$ OK. But there are still errors. You can extract the trend using STL, Census (X-13-ARIMA) and classical decomposition. If the data are non-seasonal, just use any nonparametric smoothing method to estimate trend. $\endgroup$ Commented Sep 13, 2013 at 2:51
  • $\begingroup$ Can we extract trend from a non seasonal time series data using STL, Census (X-13-ARIMA) and classical decomposition ?. I thought all these require seasonal component i.e., frequency > 1. $\endgroup$
    – forecaster
    Commented Sep 13, 2013 at 14:19
  • $\begingroup$ Please read what I wrote. "If the data are non-seasonal, just use any nonparametric smoothing method to estimate trend." $\endgroup$ Commented Sep 15, 2013 at 7:34

1 Answer 1


Could you use constrained B-splines from the R library cobs?

co <- cobs(x, y, lambda=-1)
  • $\begingroup$ Fantastic, I had to sligtly modify your code because cobs was providing some warning messages on the number of knots. co <- cobs(x,y,nknots = 20, knots.add = TRUE) plot(co) $\endgroup$
    – forecaster
    Commented Sep 13, 2013 at 16:13
  • $\begingroup$ Note that the lambda=-1 automatically selects 20 knots. The difference between regression and smoothing. $\endgroup$
    – Wayne
    Commented Sep 14, 2013 at 0:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.