Search in sources :

Example 1 with SSASettings

use of com.axibase.tsd.api.model.series.query.transformation.forecast.SSASettings 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)

Aggregations

Series (com.axibase.tsd.api.model.series.Series)1 SeriesQuery (com.axibase.tsd.api.model.series.query.SeriesQuery)1 Forecast (com.axibase.tsd.api.model.series.query.transformation.forecast.Forecast)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