Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Add other forecasting methods similar to STLForecast for seasonal_decompose and/or HP filter #8205

Open
gsamaras opened this issue Mar 31, 2022 · 2 comments

Comments

@gsamaras
Copy link

I am using STL to forecast like this:

import matplotlib.pyplot as plt
from statsmodels.datasets import elec_equip as ds
from statsmodels.tsa.arima.model import ARIMA
from statsmodels.tsa.forecasting.stl import STLForecast

elec_equip = ds.load().data
elec_equip.index.freq = 'MS'
stlf = STLForecast(elec_equip, ARIMA, model_kwargs=dict(order=(1, 1, 0), trend="t"))
stlf_res = stlf.fit()

forecast = stlf_res.forecast(24)
plt.plot(elec_equip)
plt.plot(forecast)
plt.show()

Is there something similar to STLForecast(), but for seasonal_decompose?
Same question for Hodrick-Prescott filter.

I checked https://www.statsmodels.org/devel/tsa.html#module-statsmodels.tsa.forecasting, and I can't see any - to be exact I can only see a Theta model and an STLForecast, so I should assume that these two wrappers only exist?

@bashtage
Copy link
Member

bashtage commented Apr 6, 2022

These are no other methods. You could, of course, roll your own, at least for seasonal decompose. For HP it isn't clear what value you would use for the forecast cycle, although it has a state-space representation so it should be doable.

@bashtage bashtage changed the title [Question] Similar to STLForecast for seasonal_decompose and/or HP filter? ENH: Add other forecasting methods similar to STLForecast for seasonal_decompose and/or HP filter Apr 6, 2022
@gsamaras
Copy link
Author

gsamaras commented Apr 8, 2022

Thanks a lot @bashtage, got it! I don't have any time to implement something, so from my side you can close this issue, unless if you want to keep it open for future contributors - up to you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants