/** * @param numForecastSteps * amount of to calculate FC steps * @return ForecastResult */ @Override public final IForecastResult forecast(final int numForecastSteps) { final ITimeSeries<Double> history = this.getTsOriginal(); IForecastResult forecast = null; if (this.satisfiesInputTSRequirements(history)) { try { forecast = this.forecastWithR(numForecastSteps); } catch (final InvalidREvaluationResultException exception) { LOGGER.warn("Exception occured when forecast with R", exception); } } if (forecast == null) { LOGGER.warn("Null result for forecast. Falling back to Double.NaN result."); forecast = this.createNaNForecast(history, numForecastSteps); } return forecast; }
/** * @param numForecastSteps * amount of to calculate FC steps * @return ForecastResult */ @Override public final IForecastResult forecast(final int numForecastSteps) { final ITimeSeries<Double> history = this.getTsOriginal(); IForecastResult forecast = null; if (this.satisfiesInputTSRequirements(history)) { try { forecast = this.forecastWithR(numForecastSteps); } catch (final InvalidREvaluationResultException exception) { LOG.warn("Exception occured when forecast with R", exception); } } if (forecast == null) { LOG.warn("Null result for forecast. Falling back to Double.NaN result."); forecast = this.createNaNForecast(history, numForecastSteps); } return forecast; }