Slackbot
08/13/2023, 7:51 AMKevin Kho
08/13/2023, 11:41 PMmodels = [MSTL(
season_length=[24, 24 * 7], # seasonalities of the time series
trend_forecaster=SimpleExponentialSmoothing() # model used to forecast trend
)]
forecasts = sf.predict(h=24, level=[90])
forecasts.head()
Kevin Kho
08/13/2023, 11:48 PMStatsForecast
compatible model with an existing supersmoother implementation. For example:
from statsforecast.models import _TS
from supersmoother import SuperSmoother
class _SuperSmoother(_TS):
def __init__():
self.model = SuperSmoother()
def fit(self, t, y, dy):
self.model.fit(t, y, dy)
def predict(self, tfit):
self.model.predict(tfit)
The Naive model might provide guidance. I’m not sure this will work. You need to shape the output a bit, like predict
outputs a dictionary, which StatsForecast
turns into a DataFrame later.
The easiest thing to do is probably approximate it with the SimpleExponentialSmoothing, which is also meant for timeseries without seasonability