Skip to main content

Module interbar_math

Module interbar_math 

Source
Expand description

Inter-bar math helper functions Extracted from interbar.rs (Phase 2e refactoring)

GitHub Issue: https://github.com/terrylica/opendeviationbar-py/issues/59 Issue #96 Task #4: SIMD burstiness acceleration (feature-gated) Issue #96 Task #14: Garman-Klass libm optimization (1.2-1.5x speedup) Issue #96 Task #93: Permutation entropy batch processing optimization Issue #96 Task #130: Permutation entropy SIMD vectorization with wide crate

§FILE-SIZE-OK (600+ lines - organized by feature module)

Structs§

EntropyCache
Entropy result cache for deterministic price sequences (Issue #96 Task #117)
LookbackCache
Memoized lookback trade data (Issue #96 Task #99: Float conversion memoization)

Functions§

accumulate_buy_sell_branchless
Branchless conditional accumulation for buy/sell volume (Issue #96 Task #177)
compute_approximate_entropy
Compute Approximate Entropy (ApEn)
compute_burstiness
Compute Burstiness (Goh-Barabasi)
compute_entropy_adaptive
Adaptive entropy computation: Permutation Entropy for small windows, ApEn for large
compute_entropy_adaptive_cached
compute_entropy_adaptive_cached_readonly
Compute adaptive entropy with caching support (Issue #96 Task #117)
compute_garman_klass
Compute Garman-Klass volatility estimator
compute_garman_klass_with_ohlc
Compute Garman-Klass volatility with pre-computed OHLC
compute_hurst_dfa
Compute Hurst exponent via Detrended Fluctuation Analysis (DFA)
compute_kaufman_er
Compute Kaufman Efficiency Ratio
compute_kyle_lambda
Compute Kyle’s Lambda (normalized version) with adaptive sampling for large windows
compute_ofi_branchless
Compute Order Flow Imbalance (OFI) with branchless ILP (Issue #96 Task #194)
compute_permutation_entropy
Compute Adaptive Permutation Entropy with dynamic embedding dimension
compute_volume_moments
Compute volume moments (skewness and excess kurtosis)
compute_volume_moments_cached
Compute volume moments using pre-computed cache (Issue #96 Task #99)
compute_volume_moments_with_mean
Compute volume moments with pre-computed mean (Issue #96 Task #51)
extract_lookback_cache
Extract memoized lookback data in single pass (Issue #96 Task #99)
extract_ohlc_batch
Issue #96 Task #129: Vectorized ordinal pattern batch computation (SIMD-ready)
extract_prices_and_ohlc_cached
Issue #96 Task #77: Combined OHLC + prices extraction in single pass (1.3-1.6x speedup) Extract both prices vector and OHLC values in ONE pass through lookback Replaces separate price iteration + extract_ohlc_batch calls