gautam vj
gautam vj

Reputation: 11

What is the logic behind finding the Trend Component using Convolution Filters in STL Decomposition?

I'm trying to analyse the Source Code of STL Decomposition using Loess and identify the math behind splitting the observed data into Seasonality, Trend and Residual. Please find below the link to the source code of the STL: https://github.com/statsmodels/statsmodels/blob/master/statsmodels/tsa/seasonal.py

I'm able to decode the values of Seasonality. But to find how the value for Trend is calculated, I'm redirected to a Convolution Filter function which inturn makes further more calls to compute the values for Trend. I need 2 information out of this : 1. How are the filter values (an array) generated ? (the logic behind it) 2. How are the trend values calculated using Convolution filters?

Upvotes: 1

Views: 541

Answers (1)

sfjac
sfjac

Reputation: 7294

The underlying STL implementation appears to be a direct port of the original Fortran implementation available in netlib. I recommend reading the original paper. The authors show that the combination of filters can separate different scales of variation with the "trend" component being the longest scale variation. Stability of the iteration implies certain constraints on the smoothing widths that are specified for the various stages of the iteration. I've done a less literal translation to java, available here, that might (or might not) be helpful in understanding the algorithm. It extends the Fortran implementation to allow for local quadratic LOESS interpolation. This was described in the paper but only implemented in the S version (the R version does not have this - it is a wrapper for the original Fortran).

Upvotes: 0

Related Questions