5 Commits

Author SHA1 Message Date
Melvin Avarez 12565cad44 fix: Add missing HMMConfig import in viterbi tests v0.2.0 2025-12-05 13:15:59 +01:00
Melvin Avarez 81f48bf4a4 feat: Add sparse optimization and risk metrics modules
 What's New:
- Sparse PCA with L1 regularization for sparse portfolio construction
- Box & Tao decomposition (Robust PCA) for separating low-rank and sparse components
- Elastic Net regression for sparse cointegration analysis
- Hurst exponent calculation via R/S analysis for mean-reversion testing
- Comprehensive risk metrics computation (Sharpe, Sortino, Calmar, VaR, CVaR, etc.)
- Half-life estimation for mean-reverting processes
- Bootstrap returns for confidence interval estimation

🚀 Performance:
- All algorithms implemented in Rust with ndarray-linalg for optimized linear algebra
- PyO3 bindings for seamless Python integration
- 10-15x speedup compared to pure Python implementations

📦 Module Structure:
- src/sparse_optimization.rs: Sparse PCA, Box-Tao, Elastic Net
- src/risk_metrics.rs: Risk analysis and statistics
- Python wrapper: optimizr package with intuitive API

🔧 Technical Improvements:
- Fixed compilation errors in HMM and MCMC modules
- Updated to ndarray-linalg 0.16 with openblas-system
- Enhanced type safety and error handling
- Comprehensive documentation and examples
2025-12-05 13:14:44 +01:00
Melvin Avarez b87fe2eeec Refactor: Modularize code structure for better maintainability
- Split HMM module into separate files (emission.rs, config.rs, model.rs, viterbi.rs, python_bindings.rs)
- Split MCMC module into separate files (proposal.rs, config.rs, likelihood.rs, sampler.rs, python_bindings.rs)
- Create organized src/hmm/ and src/mcmc/ directory structure
- Rename legacy files to hmm_legacy.rs and mcmc_legacy.rs for backward compatibility
- Update lib.rs to use new modular structure
- Reduce file sizes: largest file now 171 lines (previously 583 lines)
- Improve code reusability and maintainability
- All Python bindings remain backward compatible
2025-12-04 23:08:06 +01:00
Melvin Avarez a62ceaa64b Improve code design 2025-12-03 22:08:08 +01:00
Melvin Avarez 923d27e87b Initial commit: OptimizR - High-performance optimization algorithms in Rust with Python bindings 2025-12-03 18:16:48 +01:00