protected IForecastResult createNaNForecast(final ITimeSeries<Double> timeseries, final int numForecastSteps) { final ITimeSeries<Double> tsForecast = this.prepareForecastTS(); final ITimeSeries<Double> tsLower = this.prepareForecastTS(); final ITimeSeries<Double> tsUpper = this.prepareForecastTS(); final Double fcQuality = Double.NaN; final Double[] nanArray = new Double[numForecastSteps]; Arrays.fill(nanArray, Double.NaN); tsForecast.appendAll(nanArray); tsLower.appendAll(nanArray); tsUpper.appendAll(nanArray); return new ForecastResult(tsForecast, this.getTsOriginal(), this.getConfidenceLevel(), fcQuality, tsLower, tsUpper, this.strategy); }
/** * @param numForecastSteps * number of values the forecaster is going to forecast * * @return Forecast Result */ @Override public IForecastResult forecast(final int numForecastSteps) { final ITimeSeries<Double> history = this.getTsOriginal(); final ITimeSeries<Double> tsFC = this.prepareForecastTS(); final List<Double> allHistory = new ArrayList<Double>(history.getValues()); final Double[] histValuesNotNull = MeanForecasterJava.removeNullValues(allHistory); final double mean = StatUtils.mean(ArrayUtils.toPrimitive(histValuesNotNull)); final Double[] forecastValues = new Double[numForecastSteps]; Arrays.fill(forecastValues, mean); tsFC.appendAll(forecastValues); return new ForecastResult(tsFC, this.getTsOriginal(), ForecastMethod.MEAN); }
/** * @param numForecastSteps * number of values the forecaster is going to forecast * * @return Forecast Result */ @Override public IForecastResult forecast(final int numForecastSteps) { final ITimeSeries<Double> history = this.getTsOriginal(); final ITimeSeries<Double> tsFC = this.prepareForecastTS(); final List<Double> allHistory = new ArrayList<Double>(history.getValues()); final Double[] histValuesNotNull = MeanForecasterJava.removeNullValues(allHistory); final double mean = StatUtils.mean(ArrayUtils.toPrimitive(histValuesNotNull)); final Double[] forecastValues = new Double[numForecastSteps]; Arrays.fill(forecastValues, mean); tsFC.appendAll(forecastValues); return new ForecastResult(tsFC, this.getTsOriginal(), ForecastMethod.MEAN); }
protected IForecastResult createNaNForecast(final ITimeSeries<Double> timeseries, final int numForecastSteps) { final ITimeSeries<Double> tsForecast = this.prepareForecastTS(); final ITimeSeries<Double> tsLower = this.prepareForecastTS(); final ITimeSeries<Double> tsUpper = this.prepareForecastTS(); final Double fcQuality = Double.NaN; final Double[] nanArray = new Double[numForecastSteps]; Arrays.fill(nanArray, Double.NaN); tsForecast.appendAll(nanArray); tsLower.appendAll(nanArray); tsUpper.appendAll(nanArray); return new ForecastResult(tsForecast, this.getTsOriginal(), this.getConfidenceLevel(), fcQuality, tsLower, tsUpper, this.strategy); }
AbstractRForecaster.RBRIDGE.evalWithR(String.format("rm(%s)", varNameForecast)); return new ForecastResult(tsForecast, this.getTsOriginal(), this.getConfidenceLevel(), fcQuality, tsLower, tsUpper, this.strategy);
AbstractRForecaster.RBRIDGE.evalWithR(String.format("rm(%s)", varNameForecast)); return new ForecastResult(tsForecast, this.getTsOriginal(), this.getConfidenceLevel(), fcQuality, tsLower, tsUpper, this.strategy);