Commit 956bb52
committed
Scale the zero-dispersion floor with the sample size
The first guard compared the standard deviation against eps x scale, which is the
residue of a single rounding rather than of the whole sum. Measured over constant
series spanning values 1e-7..1e3 and lengths 3..10000, the residue reaches
1.96 eps x scale, so the original threshold still let a flat series through at
other lengths: it was calibrated on one series and tested on that same series.
n eps x scale keeps a margin of at least 3.9x at every length measured, and a
real series with sigma=1e-12 sits more than ten orders of magnitude above it, so
nothing legitimate is caught. The test now sweeps values x lengths rather than
asserting one point, and was run against the unfixed function, where it fails.1 parent 06511a5 commit 956bb52
2 files changed
Lines changed: 35 additions & 2 deletions
File tree
- openbb_platform/extensions/quantitative
- openbb_quantitative
- tests
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
134 | 145 | | |
135 | 146 | | |
136 | 147 | | |
| |||
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
0 commit comments