add calculate diff

This commit is contained in:
Антон Скалкин 2023-04-04 11:13:55 +04:00
parent d236081a45
commit f4b8089f29

View File

@ -27,6 +27,8 @@ public class AnomalyDifferenceSmoothed extends Target {
ModelingResult modelingResult = timeSeriesService.smoothTimeSeries(ts, "AddTrendAddSeason"); ModelingResult modelingResult = timeSeriesService.smoothTimeSeries(ts, "AddTrendAddSeason");
var tsResult = modelingResult.getTimeSeries(); var tsResult = modelingResult.getTimeSeries();
double diff = anomalyPoints.getMax().getValue()-anomalyPoints.getMin().getValue();
for (int i = 0; i < ts.getLength(); i++) { for (int i = 0; i < ts.getLength(); i++) {
residual.addValue(new TimeSeriesValue(ts.getValue(i).getDate(), Math.abs(ts.getNumericValue(i) - tsResult.getNumericValue(i)))); residual.addValue(new TimeSeriesValue(ts.getValue(i).getDate(), Math.abs(ts.getNumericValue(i) - tsResult.getNumericValue(i))));
} }