use of com.axibase.tsd.api.model.series.query.transformation.forecast.Forecast in project atsd-api-test by axibase.
the class PostEvaluationTest method testForecast.
@Test(description = "Interpolate and forecast evaluation-generated series.")
public void testForecast() {
Interpolate interpolationSettings = new Interpolate(InterpolateFunction.LINEAR, period(1));
Forecast forecastSettings = new Forecast().setHorizon(new Horizon().setLength(31)).setSsa(new SSASettings()).setInclude(Arrays.asList(SeriesType.HISTORY, SeriesType.FORECAST));
SeriesQuery query = baseQuery.withInterpolate(interpolationSettings).withForecast(forecastSettings).withTransformationOrder(Arrays.asList(EVALUATE, INTERPOLATE, FORECAST));
List<Series> seriesList = querySeriesAsList(query);
assertEquals(seriesList.size(), 2 * seriesCount);
CommonAssertions.assertSeriesSize(seriesList, 31);
query = query.withSeriesLimit(5).withLimit(4);
seriesList = querySeriesAsList(query);
assertEquals(seriesList.size(), 5);
CommonAssertions.assertSeriesSize(seriesList, 4);
}
use of com.axibase.tsd.api.model.series.query.transformation.forecast.Forecast in project atsd-api-test by axibase.
the class SeriesQueryForecastTimeFilterTest method buildForecastSettings.
private Forecast buildForecastSettings() {
HoltWintersSettings hwSettings = new HoltWintersSettings().setAlpha(0.5).setBeta(0.5).setGamma(0.5).setAuto(false).setPeriod(new Period(1, TimeUnit.DAY));
List<SeriesType> include = Arrays.asList(SeriesType.RECONSTRUCTED, SeriesType.FORECAST);
return new Forecast().setHw(hwSettings).setInclude(include).setScoreInterval(new Interval(1, TimeUnit.DAY));
}
Aggregations