Commit Graph

15 Commits

Author SHA1 Message Date
ThotDjehuty 5f44714261 feat: Fix remaining notebooks and prepare v1.0.0 publication
Notebook Improvements:

- Fixed 05_performance_benchmarks.ipynb: Reduced observation count from 50k to 10k max

- Fixed mean_field_games_tutorial.ipynb: Improved numerical stability

  - Reduced grid size (100x100 -> 50x50) for Python implementation

  - Added CFL condition checking and auto-adjustment

  - Implemented semi-implicit schemes for better stability

  - Added sub-stepping for Fokker-Planck solver

  - Enhanced error handling with NaN/Inf detection

  - Added graceful convergence handling

Marketing Materials:

- Created LINKEDIN_POST.md for v1.0.0 announcement

  - Compelling narrative with real benchmarks

  - Clear call-to-action for stars and contributions

  - Links to documentation and installation

Status:

- All 8 notebooks now functional (100% success rate)

- Ready for crates.io and PyPI publication

- Professional presentation for open source community
2026-02-17 09:05:43 +01:00
Melvin Alvarez 3e4390e462 chore(release): Prepare OptimizR v1.0.0 for production release
Production Release Preparation:

- 75% notebook success rate (6/8 fully functional)

- Comprehensive documentation and repository cleanup

Documentation:

- Created comprehensive examples/notebooks/README.md (200+ lines)

- Updated docs/source/index.rst version badge (0.3.0 to 1.0.0)

- Archived 17 temporary development markdown files to docs/archive/

- Added examples/notebooks/.gitignore for outputs/

Repository Cleanup:

- Removed test_release.py (temporary test script)

- Removed NOTEBOOK_EXECUTION_REPORT.md (development artifact)

- Organized development docs into docs/archive/

Working Notebooks (6/8):

1. 01_hmm_tutorial.ipynb - Market regime detection

2. 02_mcmc_tutorial.ipynb - Bayesian inference

3. 03_differential_evolution_tutorial.ipynb - Global optimization

4. 03_optimal_control_tutorial.ipynb - HJB equations

5. 04_kalman_filter_sensor_fusion.ipynb - Sensor fusion

6. 04_real_world_applications.ipynb - Portfolio optimization

Documented Limitations (2/8):

7. 05_performance_benchmarks.ipynb - Memory limits

8. mean_field_games_tutorial.ipynb - Numerical stability

Validation:

- All 11 core tests passing (0.73s)

- HMM, MCMC, Differential Evolution, Grid Search validated
2026-02-16 17:56:27 +01:00
Melvin Alvarez 6ebd1337fa fix: updated 3 more notebooks for v1.0.0 API - 75% success rate 2026-02-16 17:35:15 +01:00
Melvin Alvarez c18788160a fix: update MCMC and DE tutorials for v1.0.0 API - lambda closures, parameter renames, tuple unpacking 2026-02-16 17:15:45 +01:00
Melvin Alvarez 6b084ae396 docs: add execution outputs to working notebooks
Successfully executed and saved outputs for:
- 01_hmm_tutorial.ipynb (HMM regime detection examples)
- 03_optimal_control_tutorial.ipynb (Optimal control and Kalman filtering)

These notebooks now demonstrate working code with real outputs,
validating documentation examples for v1.0.0 release.

Note: Several notebooks require API updates to match current library:
- 02_mcmc_tutorial.ipynb - mcmc_sample API changed
- 03_differential_evolution_tutorial.ipynb - parameter names changed
- 04_kalman_filter_sensor_fusion.ipynb - syntax errors
- 04_real_world_applications.ipynb - requires investigation
- 05_performance_benchmarks.ipynb - requires investigation
- mean_field_games_tutorial.ipynb - requires investigation

These will be fixed in follow-up commits.
2026-02-16 16:59:21 +01:00
Melvin Alvarez c1f4c0bde7 docs: add ReadTheDocs configuration and Sphinx documentation structure 2026-02-08 17:16:41 +01:00
Melvin Alvarez 1e88ba5bb6 feat(optimal_control): implement Kalman filter module with Python bindings
- Add kalman_filter.rs with LinearKF, RTSSmoother, UKF implementations
- Add kalman_py_bindings.rs for Python API exposure
- Create tutorial notebook with 3 real-world examples (vehicle tracking, financial time series, multi-sensor fusion)
- All tests passing with excellent results (63-88% RMSE improvements)
- Fix compilation errors in py_bindings.rs (type annotations, imports)
- Successfully builds with maturin develop --release
2026-01-23 18:38:02 +01:00
Melvin Alvarez cafb3476a4 docs: fix 404 broken links
- 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
2026-01-06 14:36:08 +01:00
Melvin Alvarez 25c7539c21 feat(examples): Complete Mean Field Games tutorial with Rust implementation
- Fixed Python bindings build with maturin (replaces cargo build)
- Updated MFG tutorial notebook to use actual Rust solver (solve_mfg_1d_rust)
- Added graceful handling of Python numerical instability
- All visualization cells working with beautiful 3D plots
- Rust solver demonstrates stable computation (0.4s for 100×100 grid)
- Tutorial showcases Rust advantages: no NaN, robust numerics, parallel execution

Tested full workflow: maturin build → notebook execution → all cells pass
2026-01-04 16:54:04 +01:00
Melvin Alvarez 1a866da60b feat(mean_field): Add Python bindings and comprehensive tutorial notebook
- 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
2026-01-04 14:52:14 +01:00
Melvin Alvarez 27e1b377ac feat(mean_field): Implement Mean Field Games module with PDE solvers
- 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
2026-01-04 13:30:57 +01:00
Melvin Alvarez f5f6005f80 feat(parallel): add GIL-free parallel DE with Rust objectives
- 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
2026-01-03 00:03:29 +01:00
Melvin Alvarez 9a8032e4ee feat(timeseries): add time-series integration helpers for financial analysis
- Implement 6 helper functions in src/timeseries_utils.rs:
  * prepare_for_hmm: Feature engineering for HMM regime detection
  * rolling_hurst_exponent: Mean-reversion detection (H < 0.5 = mean-reverting)
  * rolling_half_life: Mean-reversion speed for pairs trading
  * return_statistics: Risk metrics (mean, std, skew, kurt, sharpe)
  * create_lagged_features: ML feature matrix creation
  * rolling_correlation: Rolling correlation for pairs trading

- Add PyO3 bindings in src/timeseries_utils/python_bindings.rs:
  * All functions exposed with _py suffix
  * Proper signature decorators and error handling
  * Registered in lib.rs module system

- Update Python module exports:
  * python/optimizr/core.py: Import from _core
  * python/optimizr/__init__.py: Re-export all functions

- Create comprehensive example:
  * examples/timeseries_integration.py demonstrates all 6 functions
  * Includes integrated pairs trading workflow
  * Shows feature engineering for regime detection

- Technical details:
  * Fixed Array1<f64> type conversions for ndarray compatibility
  * Uses risk_metrics::hurst_exponent and estimate_half_life
  * Built successfully with maturin develop --release (40.93s)
  * All functions tested and working correctly

Part of Priority 3: Time-series integration helpers (Enhancement Strategy)
Addresses v0.3.0 roadmap: Bridge optimization with time-series analysis
2026-01-02 22:13:05 +01:00
Melvin Avarez 79f51e4775 Release v0.2.0: Comprehensive DE, Mathematical Toolkit, Optimal Control
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
2025-12-10 18:54:32 +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