0
$\begingroup$

I would like to smooth modeling input time series data using the stl function in R.

Based on my understanding, the function performs a local regression using data both forwards and backwards of each data point. I would not like to have data points include future information after the smoothing.

Is there a way to do that using R's stl function, short of looping the smoothing algorithm through gradually expanding time windows?

Here is the function's paper by Cleveland et. al. for your reference.

$\endgroup$

1 Answer 1

4
$\begingroup$

I don't think this is possible in R (or in any other software). After all, the L stands for "loess", which is a local smoothing method. Every implementation of loess I have seen uses values on either side of the focal value. (loess is not limited to time series.)

You could look at Single Exponential Smoothing, which is implemented as ses in the forecast package. Or an equivalent state space formulation via forecast::ets or smooth::es.

$\endgroup$
1
  • 2
    $\begingroup$ Every implementation of Loess you have ever seen undoubtedly incorporated some procedure for dealing with the data at the extremes, which shows it can do one-sided smoothing. You're likely still correct that it will be difficult to find software that has this option for smoothing all values. $\endgroup$
    – whuber
    Commented Mar 15, 2018 at 21:57

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.