Questions tagged [stl-decomposition]

STL in this context is a standard method for decomposing a time-series into Seasonal and Trend components using a Loess smoothing algorithm.

STL in this context is a standard method for decomposing a time-series into Seasonal and Trend components using a Loess smoothing algorithm. It has been popularized by its presence in R as the standard stl() function.

The approach was described by Cleveland, et al, in "STL: A Seasonal-Trend Decomposition Procedure Based on Loess". The original public domain implementation is available in Fortran from netlib and is used by the R implementation and the pyloess python package. A somewhat more general native Java implementation, stl-decomp-4j, is also available.

28 questions
18
votes
2 answers

STL decomposition of time series with missing values for anomaly detection

I am trying to detect anomalous values in a time series of climatic data with some missing observations. Searching the web I found many available approaches. Of those, stl decomposition seems appealing, in the sense of removing trend and seasonal…
effie pav
  • 181
  • 1
  • 1
  • 4
6
votes
3 answers

Dual seasonal cycles in ts object

I want to strip out seasonality from a ts. This particular ts is daily, and has both yearly and weekly seasonal cycles (frequency 365 and 7). In order to remove both, I have tried conducting stl() on the ts with frequency set to 365, before…
Jonathan Mulligan
  • 352
  • 2
  • 3
  • 10
5
votes
1 answer

How to plot statsmodels timeseries plots side by side and customize x axis in Python

I am creating these timeseries plots specifically stl decomposition and already managed to get all the plots into one. The issue I am having is having them shown side by side like the solution here. I tried the solution on the link but it did not…
4
votes
1 answer

R: Deseasonalizing a time series

We can use following code to plot and decompose a time series in R: # Monthly Airline Passenger Numbers 1949-1960 data(AirPassengers) data = data.frame(AirPassengers) data #Transform to time series ts.data1 =…
Rnaldinho
  • 421
  • 2
  • 6
  • 15
4
votes
1 answer

seasonal decomposition on non-uniform spaced time series, any well-established algo in R or Python?

stats package in R has stl(), but it requires a uniformly spaced time series created by ts(). It can't deal with zoo objects. Strangely, it can't deal with missing values either, although STL method claims to be able to fill in missing value with…
jf328
  • 6,841
  • 10
  • 58
  • 82
3
votes
4 answers

Seasonal-Trend-Loess Method for Time Series in Python

Does anyone know if there is a Python-based procedure to decompose time series utilizing STL (Seasonal-Trend-Loess) method? I saw references to a wrapper program to call the stl function in R, but I found that to be unstable and cumbersome from the…
Toly
  • 2,981
  • 8
  • 25
  • 35
3
votes
1 answer

can I estimate a time varying seasonal effect in R with GAMM?

I would like to use a generalized additive model to investigate time-series data in R. My data are monthly and I would like to estimate a seasonal effect and a longer run trend effect. I have followed some helpful posts by Gavin Simpson here and…
aaronmams
  • 141
  • 12
3
votes
2 answers

Multivariate Decomposition in R?

I am looking to decompose daily sales data with a heavily seasonal component (making a 365-day seasonality that's too long for an ARIMA process). However, there are certain parts of the time series explained by other factors, including regular…
Bryan
  • 5,999
  • 9
  • 29
  • 50
3
votes
1 answer

TIme series decomposition using R

I'm using R with the forecast package to build some time-series models. Right now, i'm dealing with multiple-seasonality data, using the tbats function. When a plot the fitted-model, i get a plot with the time-series components. My question is, what…
Fernando
  • 7,785
  • 6
  • 49
  • 81
2
votes
0 answers

STL loess window in R for trend and seasonal components

When using the stl function in R, I understand loess is used in order to 'smooth' seasonal sub-series to find the seasonal component. The window used in order to do this is given with the s.window command. I believe that loess uses a symmetric…
sym246
  • 1,836
  • 3
  • 24
  • 50
1
vote
1 answer

Editing the time series- decomposed plots

Is it possible to remove the empty grey boxes (highlighted inside red circle) present to the right side of the decomposed plots (attached)? Also, it is possible to change the title fonts (highlighted inside green circle) of the individual to Times…
1
vote
1 answer

Residual Plot in Python seasonal_decompose function not displaying properly

The residual plot is not displaying properly in my plot. I cannot understand what can the issue be. Please need help withenter image description here this. There is some issue with the axis. I am pulling Data of COVID 19 and I am plotting…
1
vote
2 answers

Non-nested double seasonality using dshw() in R

I'm trying to use dshw() to deal with double seasonality -- in my case, daily data with one-week (7-day) and one-year (365-day) seasonality. However, I get the following error when I run my code: data<-msts(1:1000, seasonal.periods=c(7,365),…
Bryan
  • 5,999
  • 9
  • 29
  • 50
0
votes
1 answer

How to apply STL decomposition on a quarterly time series data using feasts package in R?

The time series data is a quarterly sales data, that is recored in Date Sales Q 2019Q1 2000 2019Q2 3000 2019Q3 2500 2019Q4 3200 I used the yq(date) function to convert Date in Character into Date format. Then, I tried data…
KT.Thompson
  • 149
  • 1
  • 9
0
votes
0 answers

Multiplicative model in MSTL?

I currently decompose time series with MSTL from statsmodels: https://www.statsmodels.org/dev/generated/statsmodels.tsa.seasonal.MSTL.html. As far as I understood, MSTL assumes that the time series can be expressed as an additive decomposition. For…
Patrick Balada
  • 1,330
  • 1
  • 18
  • 37
1
2