- Remove unused OptimizrError imports in pde_solvers and mod.rs
- Remove unused Array2 import in optimal_transport.rs
- Remove unused Grid and pde_solvers imports in nash_equilibrium.rs
- Fix m_new variable declaration in forward_backward.rs
- Add #[allow(non_snake_case)] for T field/parameter in python_bindings.rs
- Prefix unused hist_cr variable in shade.rs
All changes fix compilation warnings while preserving functionality.
NEW FEATURE - Full Value Function Export:
- solve_hjb_full_py() returns (boundaries, x_grid, V(x), V'(x), V''(x))
- Enables value function plotting and analysis
- Trading zone visualization from gradient
- Backward compatible - solve_hjb_py() unchanged
Technical Details:
- Returns 8-tuple: (lower, upper, residual, iter, x_grid, value, gradient, hessian)
- All arrays as numpy arrays via PyO3
- Zero overhead - reuses existing solver results
- Registered in py_bindings::register_py_module()
Use Cases:
- Plot value function for strategy verification
- Analyze trading zones from V'(x)
- Diagnostic checks via V''(x) convexity
- Research and backtesting enhancements
- Replace non-existent Python examples with actual files
- Fix all placeholder yourusername URLs to ThotDjehuty
- Remove references to non-existent optimal_control.md theory doc
- Update examples to reference: hmm_regime_detection.py, parallel_de_benchmark.py, polaroid_optimizr_integration.py, timeseries_integration.py
- Add python_bindings.rs with MFGConfigPy and solve_mfg_1d_rust
- Update notebook to compare Rust vs Python implementations
- Add performance benchmarking and accuracy validation
- Include convergence plots and 3D visualizations
- Update __init__.py to expose MFG functions
Note: Python bindings need maturin build due to macOS linker issues with cargo
- Add complete mean_field module with 6 submodules
- Implement HJB and Fokker-Planck PDE solvers with rayon parallelization
- Add forward-backward fixed-point iteration algorithm
- Include Nash equilibrium and optimal transport utilities
- Add comprehensive Jupyter notebook tutorial with:
* Mathematical formulation (HJB and FP equations)
* Finite difference methods explanation
* Complete congestion game example
* 3D visualizations and convergence plots
* Citations to Jiang, Chewi, Pooladian (2023) paper
- All tests passing (5 tests in mean_field module)
- Based on 'Numerical Methods for Mean Field Games' PDF algorithms
- Implement RustObjective trait for GIL-free parallelization
- Add 5 benchmark functions: Sphere, Rosenbrock, Rastrigin, Ackley, Griewank
* Each implements RustObjective with evaluate(), dimension(), global_optimum()
* Exposed to Python with __call__ method
- Add parallel_differential_evolution_rust() function:
* Uses Rayon for parallel population evaluation
* Works with RustObjective implementations only
* Eliminates Python GIL overhead for 10-100× speedup
* Supports all DE strategies and adaptive parameters
- Create comprehensive examples:
* parallel_de_benchmark.py: Performance benchmarks showing speedup
* polaroid_optimizr_integration.py: 4 workflows combining Polaroid + OptimizR
- Regime detection with HMM
- Strategy parameter optimization
- Portfolio risk analysis
- Pairs trading pipeline
- Module integration:
* Export benchmark functions in Python API
* Export parallel_differential_evolution_rust
* Update __init__.py and core.py with new functions
- Technical implementation:
* RustObjective trait in src/rust_objectives.rs
* Parallel evaluation uses par_iter() from Rayon
* Per-thread RNG seeding for reproducibility
* Maintains same API as standard DE for easy comparison
Part of Priority 2: Enable Rust parallelization (Enhancement Strategy)
Expected speedup: 10-100× on multi-core systems for pure Rust objectives
Major Features:
• Comprehensive Differential Evolution with 5 strategies (rand1, best1, currenttobest1, rand2, best2)
• Adaptive jDE algorithm for self-tuning F and CR parameters
• Convergence tracking with history records and early stopping
• Mathematical toolkit module (780 lines): gradient, hessian, jacobian, statistics, linear algebra
• Optimal control framework: HJB solvers, regime switching, jump diffusion, MRSJD
• Sparse optimization: Sparse PCA, Box-Tao decomposition, ADMM, Elastic Net
• Rayon parallelization infrastructure (ready for pure Rust objectives)
Performance:
• 74-88× speedup for DE vs SciPy
• 50-100× speedup overall vs pure Python
Refactoring & Cleanup:
• Removed 5 legacy files (de_refactored.rs, hmm_legacy.rs, hmm_refactored.rs, mcmc_legacy.rs, mcmc_refactored.rs)
• Modular architecture with trait-based design
• Generic implementations (no domain-specific code)
• Updated Python bindings for new DE API
• Fixed ALL compilation warnings (0 errors, 0 warnings)
Documentation:
• Updated README with v0.2.0 features and benchmarks
• Created RELEASE_NOTES_v0.2.0.md (comprehensive changelog)
• New optimal control tutorial notebook (03_optimal_control_tutorial.ipynb)
• Updated API examples in README
• Created test_release.py for release validation
Version Bumps:
• Cargo.toml: 0.1.0 → 0.2.0
• pyproject.toml: 0.1.0 → 0.2.0
• python/__init__.py: 0.1.0 → 0.2.0
Breaking Changes:
• DE API: mutation_factor/crossover_rate → f/cr
• DE API: use_adaptive_jde → adaptive
• DE API: strategy names simplified (e.g., 'rand/1/bin' → 'rand1')
• DE returns: (x, fun) tuple instead of dict-like object
Known Items (Post-Release):
• Mathematical toolkit functions available in Rust but not yet exposed to Python
• MCMC Python wrapper needs API update to match new Rust implementation
• Tutorial notebooks need DE API updates
Tests: 34 Rust tests passing, core Python functionality validated with test_release.py
✨ 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