Search in sources :

Example 1 with Forecast

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);
}
Also used : Series(com.axibase.tsd.api.model.series.Series) SeriesQuery(com.axibase.tsd.api.model.series.query.SeriesQuery) Interpolate(com.axibase.tsd.api.model.series.query.transformation.interpolate.Interpolate) SSASettings(com.axibase.tsd.api.model.series.query.transformation.forecast.SSASettings) Forecast(com.axibase.tsd.api.model.series.query.transformation.forecast.Forecast) Horizon(com.axibase.tsd.api.model.series.query.transformation.forecast.Horizon) Test(org.testng.annotations.Test)

Example 2 with Forecast

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));
}
Also used : Forecast(com.axibase.tsd.api.model.series.query.transformation.forecast.Forecast) SeriesType(com.axibase.tsd.api.model.series.SeriesType) Period(com.axibase.tsd.api.model.Period) HoltWintersSettings(com.axibase.tsd.api.model.series.query.transformation.forecast.HoltWintersSettings) Interval(com.axibase.tsd.api.model.series.query.Interval)

Aggregations

Forecast (com.axibase.tsd.api.model.series.query.transformation.forecast.Forecast)2 Period (com.axibase.tsd.api.model.Period)1 Series (com.axibase.tsd.api.model.series.Series)1 SeriesType (com.axibase.tsd.api.model.series.SeriesType)1 Interval (com.axibase.tsd.api.model.series.query.Interval)1 SeriesQuery (com.axibase.tsd.api.model.series.query.SeriesQuery)1 HoltWintersSettings (com.axibase.tsd.api.model.series.query.transformation.forecast.HoltWintersSettings)1 Horizon (com.axibase.tsd.api.model.series.query.transformation.forecast.Horizon)1 SSASettings (com.axibase.tsd.api.model.series.query.transformation.forecast.SSASettings)1 Interpolate (com.axibase.tsd.api.model.series.query.transformation.interpolate.Interpolate)1 Test (org.testng.annotations.Test)1