Adaptation to improved Theil-Sen algorithm

This commit is contained in:
Jaap van Ekris 2024-01-09 22:24:55 +01:00 committed by GitHub
parent 3412ed8abc
commit 9c47873e35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -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', () => {