docs(wiki): document O(1) regression update and long-stream sum reseed (R2, R7)
Three indicator pages get a short follow-up paragraph that surfaces an internal implementation detail the audit findings made user-visible: - `Indicator-LinearRegression.md` gains a "Complexity" section explaining the O(1) update (precomputed `Σx`, `Σxx`; incrementally slid `Σy`, `Σxy` via the closed-form sliding identity), and the existing "Reset" bullet mentions the additional running accumulators. The same story applies to `LinRegSlope` and `LinRegAngle` (the page now links to both rather than repeating the derivation three times). - `Indicator-Sma.md` and `Indicator-BollingerBands.md` mention the periodic reseed (`16 · period` updates) that caps floating-point drift on long-running streams. Amortised cost is still O(1) and the user-facing behaviour on benign inputs is unchanged. No behavioural claim, no API claim, no example changes — just narrative catching up with the implementation.
This commit is contained in:
@@ -31,7 +31,11 @@ lower = mean - multiplier * stddev
|
||||
|
||||
Wickra computes `var` from the streaming sums `Σ x` and `Σ x²` as
|
||||
`Σx²/n - (Σx/n)²` and clamps to `0.0` to absorb catastrophic cancellation on
|
||||
near-constant inputs (`crates/wickra-core/src/indicators/bollinger.rs:82`).
|
||||
near-constant inputs (`crates/wickra-core/src/indicators/bollinger.rs`). On
|
||||
long-running streams the running `Σ x` and `Σ x²` are reseeded from the live
|
||||
window every `16 · period` updates — amortised O(1), bounds the cancellation
|
||||
drift to roughly `16 · period · ULP · max(|x|²)` (sub-picodollar on
|
||||
real-world price scales).
|
||||
|
||||
## Parameters
|
||||
|
||||
|
||||
Reference in New Issue
Block a user