From 2504cc5fe218db96785276d392201e89b387836b Mon Sep 17 00:00:00 2001 From: nepslor Date: Tue, 17 Sep 2024 14:52:01 +0200 Subject: [PATCH] corrected statsmodels_wrapper.py quantile intervals --- pyforecaster/forecasting_models/statsmodels_wrapper.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pyforecaster/forecasting_models/statsmodels_wrapper.py b/pyforecaster/forecasting_models/statsmodels_wrapper.py index ea87674..b03e188 100644 --- a/pyforecaster/forecasting_models/statsmodels_wrapper.py +++ b/pyforecaster/forecasting_models/statsmodels_wrapper.py @@ -43,11 +43,9 @@ def fit(self, x_pd:pd.DataFrame, y:pd.DataFrame=None): def predict(self, x_pd:pd.DataFrame, **kwargs): pass - def _predict_quantiles(self, x:pd.DataFrame, **kwargs): - preds = np.expand_dims(self.predict(x), -1) * np.ones((1, 1, len(self.q_vect))) - for h in np.unique(x.index.hour): - preds[x.index.hour == h, :, :] += np.expand_dims(self.err_distr[h], 0) - return preds + def _predict_quantiles(self, x, **kwargs): + preds = self.predict(x) + return np.expand_dims(preds, -1) + np.expand_dims(self.err_distr, 0) class ExponentialSmoothing(StatsModelsWrapper):