parent
d70a2b3e5e
commit
576178ef41
|
|
@ -490,7 +490,7 @@ Reducing extreme values while maintaining the true data volatility is a subject
|
|||
|
||||
### Quality of the implementation of Quadratic Theil-Senn regression in calculateA()
|
||||
|
||||
The implementation of the Quadratic Theil-Senn regression in `FullTSQuadraticSeries.js` contains an optimization that will hurts its accuracy. In theory, all factors for a (in generalised formula y = a * x<sup>2</sup> + b * x + c ) should be considered in the median calculation. `TSQuadraticSeries` maintains a matrix of all possible `a`'s to determine the median. When calculating the optimal curve between points x<sub>1</sub> and x<sub>3</sub> by calculateA(x<sub>1</sub>, x<sub>3</sub>), all possible intermediate values of x<sub>2</sub> are considered, resulting in a series of `a`'s.
|
||||
The implementation of the Quadratic Theil-Senn regression in `FullTSQuadraticSeries.js` contains an optimization that will hurt its accuracy. In theory, all encountered factors for `a` (in generalised formula y = a * x<sup>2</sup> + b * x + c ) should be considered in the median calculation. `TSQuadraticSeries` maintains a matrix of all possible `a`'s to determine this median. When calculating the optimal curve between points x<sub>1</sub> and x<sub>3</sub> by calculateA(x<sub>1</sub>, x<sub>3</sub>), all possible intermediate values of x<sub>2</sub> are considered, resulting in a series of `a`'s.
|
||||
|
||||
In theory, all resulting `a`'s found by calculateA(x<sub>1</sub>, x<sub>3</sub>) should be returned as an array and all should be considered in the median calculation by `TSQuadraticSeries`'s `push(x,y)` function. However, this results in a large 3D matrix, where sorting and determining the median would be extremely CPU intensive. As this approach would result in a 3D matrix, with length, width and depth sizes close to `flankLength`, a sorting will cost O(n<sup>3</sup>) cycles (at best) before the median can be determined for `a`.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue