From fc3e51a2174badc168533e057cf2b9e8d35b8839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=C3=B4nio=20C=C3=A2ndido?= Date: Tue, 28 May 2019 17:35:02 -0300 Subject: [PATCH] Improvements on EnsembleFTS.forecast_distribution_ahead --- pyFTS/models/ensemble/ensemble.py | 6 ++++-- pyFTS/tests/ensemble.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pyFTS/models/ensemble/ensemble.py b/pyFTS/models/ensemble/ensemble.py index 28ceb8c..be01293 100644 --- a/pyFTS/models/ensemble/ensemble.py +++ b/pyFTS/models/ensemble/ensemble.py @@ -276,13 +276,15 @@ class EnsembleFTS(fts.FTS): ''' lags = [] for i in np.arange(0, self.order): - lags.append(sample[k - self.order]) + lags.append(sample[i - self.order]) + + print(k, lags) # Trace the possible paths for path in product(*lags): forecasts.extend(self.get_models_forecasts(path)) - sample.append(sampler(forecasts, np.arange(0.1, 1, 0.1))) + sample.append(sampler(forecasts, np.arange(0.05, .99, 0.1))) if alpha is None: forecasts = np.ravel(forecasts).tolist() diff --git a/pyFTS/tests/ensemble.py b/pyFTS/tests/ensemble.py index 5edd239..8eb0e24 100644 --- a/pyFTS/tests/ensemble.py +++ b/pyFTS/tests/ensemble.py @@ -29,7 +29,7 @@ for k in [15, 25, 35]: model.append_model(tmp) -forecasts = model.predict(data, type='distribution', smooth='histogram', steps_ahead=10) +forecasts = model.predict(data, type='distribution', smooth='histogram', steps_ahead=5) from pyFTS.benchmarks import benchmarks as bchmk