Improvements on EnsembleFTS.forecast_distribution_ahead

This commit is contained in:
Petrônio Cândido 2019-05-28 17:35:02 -03:00
parent 839842d61f
commit fc3e51a217
2 changed files with 5 additions and 3 deletions

View File

@ -276,13 +276,15 @@ class EnsembleFTS(fts.FTS):
''' '''
lags = [] lags = []
for i in np.arange(0, self.order): 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 # Trace the possible paths
for path in product(*lags): for path in product(*lags):
forecasts.extend(self.get_models_forecasts(path)) 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: if alpha is None:
forecasts = np.ravel(forecasts).tolist() forecasts = np.ravel(forecasts).tolist()

View File

@ -29,7 +29,7 @@ for k in [15, 25, 35]:
model.append_model(tmp) 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 from pyFTS.benchmarks import benchmarks as bchmk