Skip to content

Commit

Permalink
Adaptation to improved Theil-Sen algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
JaapvanEkris authored Jan 9, 2024
1 parent 3412ed8 commit 9c47873
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/engine/utils/FullTSQuadraticSeries.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)', () => {
Expand Down Expand Up @@ -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', () => {
Expand Down

0 comments on commit 9c47873

Please sign in to comment.