Skip to content

Commit

Permalink
corrected statsmodels_wrapper.py quantile intervals
Browse files Browse the repository at this point in the history
  • Loading branch information
nepslor committed Sep 17, 2024
1 parent a382800 commit 2504cc5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pyforecaster/forecasting_models/statsmodels_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 2504cc5

Please sign in to comment.