From 9c47873e353d459fd3f7925fd78c077771cb2bc0 Mon Sep 17 00:00:00 2001 From: Jaap van Ekris <82339657+JaapvanEkris@users.noreply.github.com> Date: Tue, 9 Jan 2024 22:24:55 +0100 Subject: [PATCH] Adaptation to improved Theil-Sen algorithm --- app/engine/utils/FullTSQuadraticSeries.test.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/engine/utils/FullTSQuadraticSeries.test.js b/app/engine/utils/FullTSQuadraticSeries.test.js index 5699517360..effb7aa975 100644 --- a/app/engine/utils/FullTSQuadraticSeries.test.js +++ b/app/engine/utils/FullTSQuadraticSeries.test.js @@ -257,11 +257,11 @@ test('Quadratic Approximation on function y = 4 * Math.pow(x, 2) + 4 * x + 4, wi dataSeries.push(9, 363) testCoefficientA(dataSeries, 4) testCoefficientB(dataSeries, 4) - testCoefficientC(dataSeries, 4) + testCoefficientC(dataSeries, 3) dataSeries.push(10, 444) testCoefficientA(dataSeries, 4) testCoefficientB(dataSeries, 4) - testCoefficientC(dataSeries, 4) + testCoefficientC(dataSeries, 5) }) test('Quadratic Approximation on function y = 4 * Math.pow(x, 2) + 4 * x + 4, with some noise (+/- 1) and spikes (+/- 9)', () => { @@ -325,15 +325,15 @@ test('Quadratic Approximation on function y = 4 * Math.pow(x, 2) + 4 * x + 4, wi dataSeries.push(8, 293) testCoefficientA(dataSeries, 3.9047619047619047) testCoefficientB(dataSeries, 4.761904761904762) - testCoefficientC(dataSeries, 2.47619047619048) // This is quite acceptable as ORM ignores the C + testCoefficientC(dataSeries, 3.476190476190478) // This is quite acceptable as ORM ignores the C dataSeries.push(9, 363) testCoefficientA(dataSeries, 4) testCoefficientB(dataSeries, 4) - testCoefficientC(dataSeries, 4) // We get a 3 instead of 4, which is quite acceptable (especially since ORM ignores the C) + testCoefficientC(dataSeries, 3) // We get a 3 instead of 4, which is quite acceptable (especially since ORM ignores the C) dataSeries.push(10, 444) testCoefficientA(dataSeries, 4) testCoefficientB(dataSeries, 4) - testCoefficientC(dataSeries, 4) + testCoefficientC(dataSeries, 5) }) test('Quadratic TS Estimation should be decent for standard real-life example from MathBits with some noise', () => {