question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

STLDecomposition Implementation

See original GitHub issue

Hello, First of all thank you for open sourcing the package; it is excellently written.

One potential issue I’ve noticed: the STL Decomposition seems to be implemented using a rolling window method for detrending data, not the Loess method. Here is a code snippet from transformer_1d.py:

def _remove_trend(self, s):
        s_trend = s.rolling(
            window=(self.freq_ if self.freq_ % 2 else self.freq_ + 1),
            center=True,
        ).mean()
        return s - s_trend

Perhaps I’m missing something? The current implementation seems to be what Hyndman calls Classical Decomposition, and not STL. There is a python library that does STL decompose and it is relatively lightweight. And if what I’m describing is indeed the behavior, can I work on implementing STL with Loess?

Any feedback would be greatly appreciated, Thank you

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
tailaiwcommented, Feb 6, 2020

@yy910616 i just noticed that statsmodels v0.11 has been released.

1reaction
tailaiwcommented, Dec 2, 2019

@yy910616 I think you are right. I appreciate that you raised the problem. I’m gonna work on this and hopefully have it in the next release. Will keep you updated when a PR is ready to be reviewed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

STL decomposition : How to do it from Scratch?
This is a statistical method of decomposing a Time Series data into 3 components containing seasonality, trend and residual. Now, what is a...
Read more >
Seasonal-Trend decomposition using LOESS (STL)
This note book illustrates the use of STL to decompose a time series into three components: trend, season(al) and residual. STL uses LOESS...
Read more >
6.6 STL decomposition | Forecasting: Principles and Practice ...
STL is a versatile and robust method for decomposing time series. STL is an acronym for “Seasonal and Trend decomposition using Loess”, while...
Read more >
Seasonal Decomposition of Time Series by Loess - GitHub
The Seasonal-Trend-Loess (STL) algorithm decomposes a time series into seasonal, trend and residual components. The algorithm uses Loess interpolation (original ...
Read more >
STL Algorithm Explained: STL Part II - Dillon R. Gardner
STL (Seasonal Trend decomposition using Loess) was developed by Cleveland et al. Journal of Official Statistics 6 No. 1 pp 3-33 1990. The...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found