mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-26 06:18:05 +00:00
validation and profiles
This commit is contained in:
@@ -69,6 +69,20 @@ $$T_{total} = T_{between} + \sum_k \frac{n_k}{n} \cdot \frac{\mu_k}{\mu} \cdot T
|
||||
|
||||
## Performance Profile
|
||||
|
||||
### Operation Count (Streaming Mode)
|
||||
|
||||
Theil-Sen slope estimates the median of all pairwise slopes — O(N^2) per bar for exact computation.
|
||||
|
||||
| Operation | Count | Cost (cycles) | Subtotal |
|
||||
| :--- | :---: | :---: | :---: |
|
||||
| Ring buffer add/evict | 1 | 3 cy | ~3 cy |
|
||||
| Compute N*(N-1)/2 pairwise slopes | N^2/2 | 3 cy | ~1.5N^2 cy |
|
||||
| Sort slopes for median | N^2/2 log(N^2/2) | 2 cy | ~N^2 log N cy |
|
||||
| Extract median | 1 | 1 cy | ~1 cy |
|
||||
| **Total (N=20)** | **O(N^2 log N)** | — | **~7000 cy** |
|
||||
|
||||
O(N^2 log N) per update — expensive for N > 30. Use only where robustness to outliers justifies compute cost. Batch pre-computation strongly preferred for historical analysis.
|
||||
|
||||
| Operation | Complexity | Notes |
|
||||
|-----------|------------|-------|
|
||||
| Update (streaming) | O(n) | Two passes: mean then Theil sum |
|
||||
|
||||
Reference in New Issue
Block a user