statsmodels / statsmodels

Statsmodels: statistical modeling and econometrics in Python
http://www.statsmodels.org/devel/
BSD 3-Clause "New" or "Revised" License
10.08k stars 2.88k forks source link

sophisticated seasonal_decompose #4221

Closed znavoyan closed 5 years ago

znavoyan commented 6 years ago

Hi,

In the documentation of statsmodels.tsa.seasonal.seasonal_decompose methods it was written that this is a naive decomposition. More sophisticated methods should be preferred.

Do you have implemented such methods? Or if not, can you please point some implementation or article ?

Thanks in advance. Zaven.

josef-pkt commented 6 years ago

see my comments here https://stackoverflow.com/questions/47076771/statsmodels-seasonal-decompose-what-is-naive-about-it

I don't know what Skipper had in mind when he initially implemented seasonal_decompose and wrote that comment, and I'm not familiar with the literature.

We don't have any other seasonal decomposition methods directly, but models like UnobservedComponents, Holt-Winters (now in master) and similar allow for more flexible modelling of trend and seasonal components. Another option for modeling the seasonal components especially with many periods per seasonal cycles or multiple seasons are using splines or fourier series for it.

josef-pkt commented 6 years ago

also, I have seen this a while ago but never looked at it more closely https://github.com/jrmontag/STLDecompose

bashtage commented 5 years ago

statsmodels now has STL.