From f4b8089f292bc9122a5f6c66a8481d9d436563d5 Mon Sep 17 00:00:00 2001 From: Anton Skalkin Date: Tue, 4 Apr 2023 11:13:55 +0400 Subject: [PATCH] add calculate diff --- src/main/java/ru/ulstu/target/AnomalyDifferenceSmoothed.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/ru/ulstu/target/AnomalyDifferenceSmoothed.java b/src/main/java/ru/ulstu/target/AnomalyDifferenceSmoothed.java index 41755d7..71a544d 100644 --- a/src/main/java/ru/ulstu/target/AnomalyDifferenceSmoothed.java +++ b/src/main/java/ru/ulstu/target/AnomalyDifferenceSmoothed.java @@ -27,6 +27,8 @@ public class AnomalyDifferenceSmoothed extends Target { ModelingResult modelingResult = timeSeriesService.smoothTimeSeries(ts, "AddTrendAddSeason"); var tsResult = modelingResult.getTimeSeries(); + double diff = anomalyPoints.getMax().getValue()-anomalyPoints.getMin().getValue(); + for (int i = 0; i < ts.getLength(); i++) { residual.addValue(new TimeSeriesValue(ts.getValue(i).getDate(), Math.abs(ts.getNumericValue(i) - tsResult.getNumericValue(i)))); }