docs: Rebrand OptimizR to Optimiz-rs throughout documentation
Updated Branding in ReadTheDocs: - ✅ All 'OptimizR' → 'Optimiz-rs' (17 files) - ✅ Project name in conf.py - ✅ HTML title and short title - ✅ All algorithm documentation - ✅ Getting started guide - ✅ Installation guide - ✅ Theory/mathematical foundations - ✅ Archive documentation Documentation now consistently uses the new 'optimiz-rs' branding that matches both PyPI and crates.io package names. Note: Python module name 'optimizr' in import statements intentionally unchanged (that's the actual module name).
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
# OptimizR Refactoring - Completion Report
|
# Optimiz-rs Refactoring - Completion Report
|
||||||
|
|
||||||
## ✅ All Tasks Completed
|
## ✅ All Tasks Completed
|
||||||
|
|
||||||
@@ -263,7 +263,7 @@ pyproject.toml # ✅ Unchanged
|
|||||||
|
|
||||||
✅ **All todo items completed successfully!**
|
✅ **All todo items completed successfully!**
|
||||||
|
|
||||||
The OptimizR codebase has been completely refactored with:
|
The Optimiz-rs codebase has been completely refactored with:
|
||||||
- ✅ Modular trait-based architecture
|
- ✅ Modular trait-based architecture
|
||||||
- ✅ Functional programming patterns
|
- ✅ Functional programming patterns
|
||||||
- ✅ Advanced design patterns (Strategy, Builder, Traits)
|
- ✅ Advanced design patterns (Strategy, Builder, Traits)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# OptimizR Development Guide
|
# Optimiz-rs Development Guide
|
||||||
|
|
||||||
## Quick Start
|
## Quick Start
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# OptimizR Enhancement Strategy
|
# Optimiz-rs Enhancement Strategy
|
||||||
|
|
||||||
**Date**: January 2, 2025
|
**Date**: January 2, 2025
|
||||||
**Context**: Post-Polarway Phase 4, exploring integration and improvements
|
**Context**: Post-Polarway Phase 4, exploring integration and improvements
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
- Simulated Annealing
|
- Simulated Annealing
|
||||||
- Ant Colony Optimization
|
- Ant Colony Optimization
|
||||||
|
|
||||||
## Synergy Opportunities: Polarway + OptimizR
|
## Synergy Opportunities: Polarway + Optimiz-rs
|
||||||
|
|
||||||
### 1. Time-Series Feature Engineering for HMM
|
### 1. Time-Series Feature Engineering for HMM
|
||||||
**Description**: Use Polarway's time-series operations to create features for regime detection
|
**Description**: Use Polarway's time-series operations to create features for regime detection
|
||||||
@@ -70,7 +70,7 @@ df = client.lag(['price'], periods=1) # Lagged prices
|
|||||||
df = client.pct_change(['price'], periods=1) # Returns
|
df = client.pct_change(['price'], periods=1) # Returns
|
||||||
df = client.diff(['price'], periods=1) # Price changes
|
df = client.diff(['price'], periods=1) # Price changes
|
||||||
|
|
||||||
# OptimizR: Regime detection on features
|
# Optimiz-rs: Regime detection on features
|
||||||
returns = df['price_pct_change'].to_numpy()
|
returns = df['price_pct_change'].to_numpy()
|
||||||
hmm = HMM(n_states=3) # Bull, Bear, Sideways
|
hmm = HMM(n_states=3) # Bull, Bear, Sideways
|
||||||
hmm.fit(returns, n_iterations=100)
|
hmm.fit(returns, n_iterations=100)
|
||||||
@@ -79,7 +79,7 @@ states = hmm.predict(returns)
|
|||||||
|
|
||||||
**Value**:
|
**Value**:
|
||||||
- Polarway provides fast feature engineering (50-200× faster for large datasets)
|
- Polarway provides fast feature engineering (50-200× faster for large datasets)
|
||||||
- OptimizR provides statistical inference (HMM regime detection)
|
- Optimiz-rs provides statistical inference (HMM regime detection)
|
||||||
- Combined: Real-time regime switching for trading strategies
|
- Combined: Real-time regime switching for trading strategies
|
||||||
|
|
||||||
### 2. Risk Metrics on Time-Series Data
|
### 2. Risk Metrics on Time-Series Data
|
||||||
@@ -91,14 +91,14 @@ states = hmm.predict(returns)
|
|||||||
df = client.pct_change(['price'], periods=1)
|
df = client.pct_change(['price'], periods=1)
|
||||||
returns = df['price_pct_change'].to_numpy()
|
returns = df['price_pct_change'].to_numpy()
|
||||||
|
|
||||||
# OptimizR: Risk analysis
|
# Optimiz-rs: Risk analysis
|
||||||
hurst = compute_hurst_exponent(returns) # Mean-reversion detection
|
hurst = compute_hurst_exponent(returns) # Mean-reversion detection
|
||||||
half_life = estimate_half_life(returns) # Reversion time
|
half_life = estimate_half_life(returns) # Reversion time
|
||||||
risk_metrics = compute_risk_metrics(returns) # Comprehensive suite
|
risk_metrics = compute_risk_metrics(returns) # Comprehensive suite
|
||||||
```
|
```
|
||||||
|
|
||||||
**Value**:
|
**Value**:
|
||||||
- Fast preprocessing (Polarway) + sophisticated analysis (OptimizR)
|
- Fast preprocessing (Polarway) + sophisticated analysis (Optimiz-rs)
|
||||||
- Useful for pairs trading, mean-reversion strategies
|
- Useful for pairs trading, mean-reversion strategies
|
||||||
- Real-time risk monitoring
|
- Real-time risk monitoring
|
||||||
|
|
||||||
@@ -111,7 +111,7 @@ risk_metrics = compute_risk_metrics(returns) # Comprehensive suite
|
|||||||
df = client.lag(['spy_price', 'vix'], periods=[1, 5, 20])
|
df = client.lag(['spy_price', 'vix'], periods=[1, 5, 20])
|
||||||
df = client.pct_change(['spy_price'], periods=1)
|
df = client.pct_change(['spy_price'], periods=1)
|
||||||
|
|
||||||
# OptimizR: Solve optimal control problem
|
# Optimiz-rs: Solve optimal control problem
|
||||||
# State: [price, volatility regime]
|
# State: [price, volatility regime]
|
||||||
# Control: portfolio weights
|
# Control: portfolio weights
|
||||||
value_fn = solve_hjb_regime_switching(...)
|
value_fn = solve_hjb_regime_switching(...)
|
||||||
@@ -133,7 +133,7 @@ def backtest_strategy(params):
|
|||||||
# ... strategy logic ...
|
# ... strategy logic ...
|
||||||
return -sharpe_ratio # Minimize negative Sharpe
|
return -sharpe_ratio # Minimize negative Sharpe
|
||||||
|
|
||||||
# OptimizR: Find optimal parameters
|
# Optimiz-rs: Find optimal parameters
|
||||||
result = differential_evolution(
|
result = differential_evolution(
|
||||||
objective_fn=backtest_strategy,
|
objective_fn=backtest_strategy,
|
||||||
bounds=[(1, 50), (0.01, 0.5)], # [lag_period, threshold]
|
bounds=[(1, 50), (0.01, 0.5)], # [lag_period, threshold]
|
||||||
@@ -144,7 +144,7 @@ result = differential_evolution(
|
|||||||
|
|
||||||
**Value**:
|
**Value**:
|
||||||
- Polarway handles heavy data processing
|
- Polarway handles heavy data processing
|
||||||
- OptimizR finds optimal parameters
|
- Optimiz-rs finds optimal parameters
|
||||||
- 74-88× faster than SciPy DE
|
- 74-88× faster than SciPy DE
|
||||||
|
|
||||||
## High-Priority Enhancements
|
## High-Priority Enhancements
|
||||||
@@ -258,12 +258,12 @@ impl SHADEMemory {
|
|||||||
|
|
||||||
### Priority 3: Time-Series Integration Helpers
|
### Priority 3: Time-Series Integration Helpers
|
||||||
|
|
||||||
**Problem**: Using Polarway + OptimizR requires manual glue code
|
**Problem**: Using Polarway + Optimiz-rs requires manual glue code
|
||||||
|
|
||||||
**Solution**: Create helper functions for common time-series + optimization patterns
|
**Solution**: Create helper functions for common time-series + optimization patterns
|
||||||
|
|
||||||
**Implementation Strategy**:
|
**Implementation Strategy**:
|
||||||
1. Add `timeseries_utils` module to OptimizR
|
1. Add `timeseries_utils` module to Optimiz-rs
|
||||||
2. Functions for common workflows
|
2. Functions for common workflows
|
||||||
3. Optional Polarway integration (via feature flag)
|
3. Optional Polarway integration (via feature flag)
|
||||||
|
|
||||||
@@ -350,7 +350,7 @@ result = tsu.optimize_strategy_params(
|
|||||||
|
|
||||||
1. **Session 1 (Current)**: Time-Series Integration Helpers (1-2 hours)
|
1. **Session 1 (Current)**: Time-Series Integration Helpers (1-2 hours)
|
||||||
- Low effort, immediate value
|
- Low effort, immediate value
|
||||||
- Makes Polarway + OptimizR integration obvious
|
- Makes Polarway + Optimiz-rs integration obvious
|
||||||
- Creates examples for documentation
|
- Creates examples for documentation
|
||||||
|
|
||||||
2. **Session 2**: Enable Rust-Native Parallelization (1-2 hours)
|
2. **Session 2**: Enable Rust-Native Parallelization (1-2 hours)
|
||||||
@@ -372,7 +372,7 @@ result = tsu.optimize_strategy_params(
|
|||||||
For each enhancement:
|
For each enhancement:
|
||||||
1. **Unit tests**: Algorithm correctness (sphere function, Rosenbrock)
|
1. **Unit tests**: Algorithm correctness (sphere function, Rosenbrock)
|
||||||
2. **Benchmarks**: Performance comparison (before/after)
|
2. **Benchmarks**: Performance comparison (before/after)
|
||||||
3. **Integration tests**: Polarway + OptimizR workflows
|
3. **Integration tests**: Polarway + Optimiz-rs workflows
|
||||||
4. **Documentation**: Usage examples, API docs
|
4. **Documentation**: Usage examples, API docs
|
||||||
|
|
||||||
## Git Commit Strategy (per MANDATORY rules)
|
## Git Commit Strategy (per MANDATORY rules)
|
||||||
@@ -404,4 +404,4 @@ Each enhancement gets:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Next Action**: Implement Priority 3 (Time-Series Integration Helpers) as it's lowest effort with immediate value for demonstrating Polarway + OptimizR synergy.
|
**Next Action**: Implement Priority 3 (Time-Series Integration Helpers) as it's lowest effort with immediate value for demonstrating Polarway + Optimiz-rs synergy.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# OptimizR Enhancement Suite - Implementation Complete
|
# Optimiz-rs Enhancement Suite - Implementation Complete
|
||||||
|
|
||||||
**Date**: January 2, 2026
|
**Date**: January 2, 2026
|
||||||
**Session Duration**: ~3 hours
|
**Session Duration**: ~3 hours
|
||||||
@@ -8,13 +8,13 @@
|
|||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
Completed comprehensive enhancement suite for OptimizR v0.2.0, implementing all 3 priorities from the Enhancement Strategy:
|
Completed comprehensive enhancement suite for Optimiz-rs v0.2.0, implementing all 3 priorities from the Enhancement Strategy:
|
||||||
|
|
||||||
1. ✅ **Time-Series Integration Helpers** (Priority 3)
|
1. ✅ **Time-Series Integration Helpers** (Priority 3)
|
||||||
2. ✅ **Rust Parallelization** (Priority 2)
|
2. ✅ **Rust Parallelization** (Priority 2)
|
||||||
3. ✅ **SHADE Algorithm** (Priority 1)
|
3. ✅ **SHADE Algorithm** (Priority 1)
|
||||||
|
|
||||||
Additionally created integration examples combining Polarway + OptimizR workflows.
|
Additionally created integration examples combining Polarway + Optimiz-rs workflows.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ Additionally created integration examples combining Polarway + OptimizR workflow
|
|||||||
|
|
||||||
### 1. Time-Series Integration Helpers (Commit: 9a8032e, 7f77f29)
|
### 1. Time-Series Integration Helpers (Commit: 9a8032e, 7f77f29)
|
||||||
|
|
||||||
**Purpose**: Bridge OptimizR's optimization with time-series analysis for financial workflows.
|
**Purpose**: Bridge Optimiz-rs's optimization with time-series analysis for financial workflows.
|
||||||
|
|
||||||
**Implementation**:
|
**Implementation**:
|
||||||
- Created `src/timeseries_utils.rs` (400+ lines)
|
- Created `src/timeseries_utils.rs` (400+ lines)
|
||||||
@@ -41,7 +41,7 @@ Additionally created integration examples combining Polarway + OptimizR workflow
|
|||||||
- All functions tested and working
|
- All functions tested and working
|
||||||
|
|
||||||
**Impact**:
|
**Impact**:
|
||||||
- Enables Polarway → OptimizR workflows
|
- Enables Polarway → Optimiz-rs workflows
|
||||||
- Simplifies regime detection with HMM
|
- Simplifies regime detection with HMM
|
||||||
- Streamlines pairs trading analysis
|
- Streamlines pairs trading analysis
|
||||||
|
|
||||||
@@ -130,7 +130,7 @@ Additionally created integration examples combining Polarway + OptimizR workflow
|
|||||||
|
|
||||||
### 4. Integration Examples (Included with parallelization)
|
### 4. Integration Examples (Included with parallelization)
|
||||||
|
|
||||||
**Purpose**: Demonstrate Polarway + OptimizR workflows.
|
**Purpose**: Demonstrate Polarway + Optimiz-rs workflows.
|
||||||
|
|
||||||
**Implementation**:
|
**Implementation**:
|
||||||
- `examples/polarway_optimizr_integration.py` (500+ lines)
|
- `examples/polarway_optimizr_integration.py` (500+ lines)
|
||||||
@@ -148,7 +148,7 @@ Additionally created integration examples combining Polarway + OptimizR workflow
|
|||||||
|
|
||||||
**Impact**:
|
**Impact**:
|
||||||
- End-to-end examples for financial analysis
|
- End-to-end examples for financial analysis
|
||||||
- Demonstrates Polarway + OptimizR synergy
|
- Demonstrates Polarway + Optimiz-rs synergy
|
||||||
- Ready for production adaptation
|
- Ready for production adaptation
|
||||||
|
|
||||||
**Files**:
|
**Files**:
|
||||||
@@ -221,7 +221,7 @@ All commits pushed to origin/main ✅
|
|||||||
|
|
||||||
## 🎯 Alignment with Roadmap
|
## 🎯 Alignment with Roadmap
|
||||||
|
|
||||||
All enhancements align with OptimizR v0.3.0 roadmap:
|
All enhancements align with Optimiz-rs v0.3.0 roadmap:
|
||||||
|
|
||||||
- ✅ **Time-series integration**: Enable Polarway workflows
|
- ✅ **Time-series integration**: Enable Polarway workflows
|
||||||
- ✅ **Parallelization**: Unlock Rayon infrastructure
|
- ✅ **Parallelization**: Unlock Rayon infrastructure
|
||||||
@@ -325,4 +325,4 @@ Future (v0.3.0+):
|
|||||||
|
|
||||||
**Status**: ✅ **ALL OBJECTIVES COMPLETE**
|
**Status**: ✅ **ALL OBJECTIVES COMPLETE**
|
||||||
**Next**: Integrate SHADE into DE, performance testing
|
**Next**: Integrate SHADE into DE, performance testing
|
||||||
**Version**: OptimizR v0.2.0 → v0.3.0 prep
|
**Version**: Optimiz-rs v0.2.0 → v0.3.0 prep
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ Example notebooks in `examples/notebooks/` **ARE WORKING CORRECTLY**! They use P
|
|||||||
- Automatic Rust backend when available
|
- Automatic Rust backend when available
|
||||||
- Graceful fallback to pure Python
|
- Graceful fallback to pure Python
|
||||||
|
|
||||||
## Actual OptimizR Python API (from lib.rs)
|
## Actual Optimiz-rs Python API (from lib.rs)
|
||||||
|
|
||||||
### ✅ Available Functions/Classes:
|
### ✅ Available Functions/Classes:
|
||||||
|
|
||||||
@@ -155,7 +155,7 @@ from optimizr import (
|
|||||||
```
|
```
|
||||||
|
|
||||||
**Features Demonstrated:**
|
**Features Demonstrated:**
|
||||||
- Direct comparison: OptimizR (Rust) vs Python libraries
|
- Direct comparison: Optimiz-rs (Rust) vs Python libraries
|
||||||
- Benchmarks against: hmmlearn, scipy, sklearn
|
- Benchmarks against: hmmlearn, scipy, sklearn
|
||||||
- Performance metrics and speedup calculations
|
- Performance metrics and speedup calculations
|
||||||
|
|
||||||
@@ -178,7 +178,7 @@ from optimizr import (
|
|||||||
|
|
||||||
### Python Wrapper Design (Brilliant!)
|
### Python Wrapper Design (Brilliant!)
|
||||||
|
|
||||||
OptimizR uses a **two-layer architecture**:
|
Optimiz-rs uses a **two-layer architecture**:
|
||||||
|
|
||||||
1. **Rust Core** (`src/` with PyO3):
|
1. **Rust Core** (`src/` with PyO3):
|
||||||
- `HMMParams` class
|
- `HMMParams` class
|
||||||
@@ -237,7 +237,7 @@ This design is **excellent** because:
|
|||||||
|
|
||||||
## Testing Summary
|
## Testing Summary
|
||||||
|
|
||||||
| Notebook | Status | OptimizR Features | Test Result |
|
| Notebook | Status | Optimiz-rs Features | Test Result |
|
||||||
|----------|--------|-------------------|-------------|
|
|----------|--------|-------------------|-------------|
|
||||||
| 01_hmm_tutorial.ipynb | ✅ PASS | HMM (Rust) | All cells run |
|
| 01_hmm_tutorial.ipynb | ✅ PASS | HMM (Rust) | All cells run |
|
||||||
| 02_mcmc_tutorial.ipynb | ✅ PASS | mcmc_sample | Imports OK |
|
| 02_mcmc_tutorial.ipynb | ✅ PASS | mcmc_sample | Imports OK |
|
||||||
@@ -277,7 +277,7 @@ This design is **excellent** because:
|
|||||||
**Actual Status:** Notebooks use Python wrappers correctly
|
**Actual Status:** Notebooks use Python wrappers correctly
|
||||||
|
|
||||||
**What I Learned:**
|
**What I Learned:**
|
||||||
1. OptimizR has excellent two-layer design
|
1. Optimiz-rs has excellent two-layer design
|
||||||
2. Python wrappers provide familiar OOP interface
|
2. Python wrappers provide familiar OOP interface
|
||||||
3. Rust acceleration is transparent to users
|
3. Rust acceleration is transparent to users
|
||||||
4. Only 1 minor fix needed (random_state parameter)
|
4. Only 1 minor fix needed (random_state parameter)
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
# OptimizR Project Summary
|
# Optimiz-rs Project Summary
|
||||||
|
|
||||||
## What is OptimizR?
|
## What is Optimiz-rs?
|
||||||
|
|
||||||
OptimizR is a **general-purpose optimization library** that provides high-performance implementations of advanced algorithms in Rust with easy-to-use Python bindings. It's designed to be fast, reliable, and production-ready for open-source distribution.
|
Optimiz-rs is a **general-purpose optimization library** that provides high-performance implementations of advanced algorithms in Rust with easy-to-use Python bindings. It's designed to be fast, reliable, and production-ready for open-source distribution.
|
||||||
|
|
||||||
## Key Features
|
## Key Features
|
||||||
|
|
||||||
@@ -140,7 +140,7 @@ x_opt, f_min = differential_evolution(
|
|||||||
|
|
||||||
## Differences from rust-hft-arbitrage-lab
|
## Differences from rust-hft-arbitrage-lab
|
||||||
|
|
||||||
| Aspect | rust-hft-arbitrage-lab | OptimizR |
|
| Aspect | rust-hft-arbitrage-lab | Optimiz-rs |
|
||||||
|--------|----------------------|----------|
|
|--------|----------------------|----------|
|
||||||
| **Purpose** | HFT trading strategies | General optimization library |
|
| **Purpose** | HFT trading strategies | General optimization library |
|
||||||
| **Scope** | Trading-specific | Domain-agnostic |
|
| **Scope** | Trading-specific | Domain-agnostic |
|
||||||
@@ -165,7 +165,7 @@ x_opt, f_min = differential_evolution(
|
|||||||
```bash
|
```bash
|
||||||
git init
|
git init
|
||||||
git add .
|
git add .
|
||||||
git commit -m "Initial commit: OptimizR v0.1.0"
|
git commit -m "Initial commit: Optimiz-rs v0.1.0"
|
||||||
git remote add origin https://github.com/ThotDjehuty/optimiz-r.git
|
git remote add origin https://github.com/ThotDjehuty/optimiz-r.git
|
||||||
git push -u origin main
|
git push -u origin main
|
||||||
```
|
```
|
||||||
@@ -217,7 +217,7 @@ Based on benchmarks from rust-hft-arbitrage-lab:
|
|||||||
## Marketing/Outreach
|
## Marketing/Outreach
|
||||||
|
|
||||||
1. **Reddit**: r/rust, r/python, r/MachineLearning
|
1. **Reddit**: r/rust, r/python, r/MachineLearning
|
||||||
2. **Hacker News**: "Show HN: OptimizR - Fast optimization algorithms in Rust"
|
2. **Hacker News**: "Show HN: Optimiz-rs - Fast optimization algorithms in Rust"
|
||||||
3. **Twitter/X**: Tweet with #rustlang #python
|
3. **Twitter/X**: Tweet with #rustlang #python
|
||||||
4. **PyPI**: Ensure good package description
|
4. **PyPI**: Ensure good package description
|
||||||
5. **GitHub Topics**: optimization, rust, python, scientific-computing
|
5. **GitHub Topics**: optimization, rust, python, scientific-computing
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
# OptimizR Refactoring Summary
|
# Optimiz-rs Refactoring Summary
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
This document summarizes the major refactoring applied to OptimizR to improve modularity, introduce functional programming patterns, implement design patterns, and add concurrency support.
|
This document summarizes the major refactoring applied to Optimiz-rs to improve modularity, introduce functional programming patterns, implement design patterns, and add concurrency support.
|
||||||
|
|
||||||
## Architecture Changes
|
## Architecture Changes
|
||||||
|
|
||||||
@@ -369,7 +369,7 @@ impl ProposalStrategy for MyProposal {
|
|||||||
|
|
||||||
## Conclusion
|
## Conclusion
|
||||||
|
|
||||||
This refactoring significantly improves OptimizR's:
|
This refactoring significantly improves Optimiz-rs's:
|
||||||
- **Modularity**: Clear trait boundaries, easy to extend
|
- **Modularity**: Clear trait boundaries, easy to extend
|
||||||
- **Maintainability**: Builder patterns, functional utilities reduce boilerplate
|
- **Maintainability**: Builder patterns, functional utilities reduce boilerplate
|
||||||
- **Performance**: Parallel execution, memoization, lazy evaluation
|
- **Performance**: Parallel execution, memoization, lazy evaluation
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# OptimizR Setup Complete! ✅
|
# Optimiz-rs Setup Complete! ✅
|
||||||
|
|
||||||
## What Was Done
|
## What Was Done
|
||||||
|
|
||||||
@@ -136,7 +136,7 @@ pytest tests/ -v -k HMM # Run HMM tests only
|
|||||||
|
|
||||||
## Performance
|
## Performance
|
||||||
|
|
||||||
OptimizR provides **50-100x speedup** over pure Python for:
|
Optimiz-rs provides **50-100x speedup** over pure Python for:
|
||||||
- HMM fitting (71x faster)
|
- HMM fitting (71x faster)
|
||||||
- MCMC sampling (71x faster)
|
- MCMC sampling (71x faster)
|
||||||
- Differential Evolution (53x faster)
|
- Differential Evolution (53x faster)
|
||||||
@@ -144,7 +144,7 @@ OptimizR provides **50-100x speedup** over pure Python for:
|
|||||||
|
|
||||||
## Summary
|
## Summary
|
||||||
|
|
||||||
The OptimizR project is now **fully functional** with:
|
The Optimiz-rs project is now **fully functional** with:
|
||||||
- ✅ Zero compilation errors
|
- ✅ Zero compilation errors
|
||||||
- ✅ All tests passing
|
- ✅ All tests passing
|
||||||
- ✅ Docker support
|
- ✅ Docker support
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Time-Series Integration Helpers Implementation Summary
|
# Time-Series Integration Helpers Implementation Summary
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
Completed Priority 3 from Enhancement Strategy: Time-series integration helpers for OptimizR v0.3.0. These 6 helper functions bridge OptimizR's optimization capabilities with time-series analysis, particularly useful for regime-switching models and pairs trading strategies.
|
Completed Priority 3 from Enhancement Strategy: Time-series integration helpers for Optimiz-rs v0.3.0. These 6 helper functions bridge Optimiz-rs's optimization capabilities with time-series analysis, particularly useful for regime-switching models and pairs trading strategies.
|
||||||
|
|
||||||
## Implementation Details
|
## Implementation Details
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ Completed Priority 3 from Enhancement Strategy: Time-series integration helpers
|
|||||||
- Volatility proxy: squared returns
|
- Volatility proxy: squared returns
|
||||||
- Lagged returns for each lag period
|
- Lagged returns for each lag period
|
||||||
- Returns: Feature matrix (N-max_lag rows × (3 + num_lags) columns)
|
- Returns: Feature matrix (N-max_lag rows × (3 + num_lags) columns)
|
||||||
- Use case: Prepare price data for OptimizR's HMM regime detection
|
- Use case: Prepare price data for Optimiz-rs's HMM regime detection
|
||||||
|
|
||||||
2. **`rolling_hurst_exponent(returns: &[f64], window_size: usize) -> Vec<f64>`**
|
2. **`rolling_hurst_exponent(returns: &[f64], window_size: usize) -> Vec<f64>`**
|
||||||
- Purpose: Detect mean-reversion vs trending behavior
|
- Purpose: Detect mean-reversion vs trending behavior
|
||||||
@@ -146,7 +146,7 @@ import optimizr
|
|||||||
|
|
||||||
prices = [100.0, 101.5, 99.8, 102.3, 103.7]
|
prices = [100.0, 101.5, 99.8, 102.3, 103.7]
|
||||||
features = optimizr.prepare_for_hmm_py(prices, [1, 2])
|
features = optimizr.prepare_for_hmm_py(prices, [1, 2])
|
||||||
# Use with OptimizR's HMM for regime detection
|
# Use with Optimiz-rs's HMM for regime detection
|
||||||
```
|
```
|
||||||
|
|
||||||
### Mean-Reversion Check
|
### Mean-Reversion Check
|
||||||
|
|||||||
@@ -303,7 +303,7 @@ print(f"Function evaluations: {result.nfev}")
|
|||||||
|
|
||||||
## Adaptive Control (jDE)
|
## Adaptive Control (jDE)
|
||||||
|
|
||||||
OptimizR implements **jDE** (self-adaptive DE), where the parameters $F$ and $CR$
|
Optimiz-rs implements **jDE** (self-adaptive DE), where the parameters $F$ and $CR$
|
||||||
evolve with the population:
|
evolve with the population:
|
||||||
|
|
||||||
$$
|
$$
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ $$
|
|||||||
|
|
||||||
This is symmetric, so Metropolis acceptance applies.
|
This is symmetric, so Metropolis acceptance applies.
|
||||||
|
|
||||||
**This is what OptimizR implements.**
|
**This is what Optimiz-rs implements.**
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -6,7 +6,7 @@ import sys
|
|||||||
sys.path.insert(0, os.path.abspath('../../python'))
|
sys.path.insert(0, os.path.abspath('../../python'))
|
||||||
|
|
||||||
# -- Project information -----------------------------------------------------
|
# -- Project information -----------------------------------------------------
|
||||||
project = 'OptimizR'
|
project = 'Optimiz-rs'
|
||||||
copyright = '2026, HFThot Research Lab'
|
copyright = '2026, HFThot Research Lab'
|
||||||
author = 'HFThot Research Lab'
|
author = 'HFThot Research Lab'
|
||||||
release = '0.3.0'
|
release = '0.3.0'
|
||||||
@@ -32,8 +32,8 @@ exclude_patterns = []
|
|||||||
# -- Options for HTML output -------------------------------------------------
|
# -- Options for HTML output -------------------------------------------------
|
||||||
html_theme = 'furo' # Modern, clean theme
|
html_theme = 'furo' # Modern, clean theme
|
||||||
html_static_path = ['_static']
|
html_static_path = ['_static']
|
||||||
html_title = 'OptimizR Documentation'
|
html_title = 'Optimiz-rs Documentation'
|
||||||
html_short_title = 'OptimizR'
|
html_short_title = 'Optimiz-rs'
|
||||||
html_logo = 'logo_optimizrs.png'
|
html_logo = 'logo_optimizrs.png'
|
||||||
html_favicon = 'logo_optimizrs.png'
|
html_favicon = 'logo_optimizrs.png'
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Examples
|
# Examples
|
||||||
|
|
||||||
Practical snippets for every OptimizR component.
|
Practical snippets for every Optimiz-rs component.
|
||||||
|
|
||||||
## Differential Evolution (global optimization)
|
## Differential Evolution (global optimization)
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ pip install -r docs/requirements.txt
|
|||||||
pip install maturin numpy
|
pip install maturin numpy
|
||||||
```
|
```
|
||||||
|
|
||||||
## 2. Build and install OptimizR locally
|
## 2. Build and install Optimiz-rs locally
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install .
|
pip install .
|
||||||
@@ -26,7 +26,7 @@ maturin develop --release
|
|||||||
python - <<'PY'
|
python - <<'PY'
|
||||||
import optimizr
|
import optimizr
|
||||||
from optimizr import differential_evolution, HMM
|
from optimizr import differential_evolution, HMM
|
||||||
print("OptimizR version:", optimizr.__version__)
|
print("Optimiz-rs version:", optimizr.__version__)
|
||||||
|
|
||||||
# Simple objective
|
# Simple objective
|
||||||
f = lambda x: sum(v * v for v in x)
|
f = lambda x: sum(v * v for v in x)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
.. OptimizR documentation master file
|
.. Optimiz-rs documentation master file
|
||||||
|
|
||||||
OptimizR Documentation
|
Optimiz-rs Documentation
|
||||||
======================
|
======================
|
||||||
|
|
||||||
**High-performance optimization algorithms in Rust with Python bindings**
|
**High-performance optimization algorithms in Rust with Python bindings**
|
||||||
@@ -13,7 +13,7 @@ OptimizR Documentation
|
|||||||
:target: https://github.com/ThotDjehuty/optimiz-r/blob/main/LICENSE
|
:target: https://github.com/ThotDjehuty/optimiz-r/blob/main/LICENSE
|
||||||
:alt: License
|
:alt: License
|
||||||
|
|
||||||
OptimizR provides blazingly fast, production-ready implementations of advanced optimization and statistical inference algorithms. Built with Rust for maximum performance and exposed to Python through PyO3, it delivers **50-100× speedup** over pure Python implementations.
|
Optimiz-rs provides blazingly fast, production-ready implementations of advanced optimization and statistical inference algorithms. Built with Rust for maximum performance and exposed to Python through PyO3, it delivers **50-100× speedup** over pure Python implementations.
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 2
|
:maxdepth: 2
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
## Install from PyPI
|
## Install from PyPI
|
||||||
|
|
||||||
**Coming soon**: OptimizR will be available on PyPI.
|
**Coming soon**: Optimiz-rs will be available on PyPI.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install optimizr
|
pip install optimizr
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Mathematical Foundations
|
# Mathematical Foundations
|
||||||
|
|
||||||
This page collects the core equations driving OptimizR’s Rust kernels, plus short intuition blurbs and micro-checks you can run in a notebook. For visuals and full walkthroughs, see the example notebooks in `examples/notebooks/`.
|
This page collects the core equations driving Optimiz-rs’s Rust kernels, plus short intuition blurbs and micro-checks you can run in a notebook. For visuals and full walkthroughs, see the example notebooks in `examples/notebooks/`.
|
||||||
|
|
||||||
## Differential Evolution (DE)
|
## Differential Evolution (DE)
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ $$
|
|||||||
\end{cases}
|
\end{cases}
|
||||||
$$
|
$$
|
||||||
|
|
||||||
**Self-adaptive jDE (used by OptimizR):**
|
**Self-adaptive jDE (used by Optimiz-rs):**
|
||||||
$$
|
$$
|
||||||
F_i^{g+1} = \begin{cases}
|
F_i^{g+1} = \begin{cases}
|
||||||
F_{\min} + r_1 \cdot F_{\max} & r_2 < \tau_1,\\
|
F_{\min} + r_1 \cdot F_{\max} & r_2 < \tau_1,\\
|
||||||
@@ -52,7 +52,7 @@ $$
|
|||||||
-\partial_t V(t,x) = \inf_{u\in\mathcal{U}} \Big[ \ell(x,u) + \nabla_x V(t,x)^{\top} b(x,u) + \tfrac12 \operatorname{Tr}\big(\sigma\sigma^{\top}(x,u) \, \nabla_x^2 V(t,x)\big) \Big],\quad V(T,x) = g(x).
|
-\partial_t V(t,x) = \inf_{u\in\mathcal{U}} \Big[ \ell(x,u) + \nabla_x V(t,x)^{\top} b(x,u) + \tfrac12 \operatorname{Tr}\big(\sigma\sigma^{\top}(x,u) \, \nabla_x^2 V(t,x)\big) \Big],\quad V(T,x) = g(x).
|
||||||
$$
|
$$
|
||||||
|
|
||||||
OptimizR uses finite differences with backward time-stepping and optional policy iteration. On a uniform grid $(t_n, x_j)$:
|
Optimiz-rs uses finite differences with backward time-stepping and optional policy iteration. On a uniform grid $(t_n, x_j)$:
|
||||||
$$
|
$$
|
||||||
V^{n} = \min_{u}\Big\{ \ell(x_j,u)\,\Delta t + V^{n+1} + \nabla_x V^{n+1}\cdot b\,\Delta t + \tfrac12 \operatorname{Tr}(\sigma\sigma^{\top}\nabla_x^2 V^{n+1})\,\Delta t \Big\}.
|
V^{n} = \min_{u}\Big\{ \ell(x_j,u)\,\Delta t + V^{n+1} + \nabla_x V^{n+1}\cdot b\,\Delta t + \tfrac12 \operatorname{Tr}(\sigma\sigma^{\top}\nabla_x^2 V^{n+1})\,\Delta t \Big\}.
|
||||||
$$
|
$$
|
||||||
@@ -62,7 +62,7 @@ The control that attains the minimum yields the feedback policy $u^{\star}(x_j,
|
|||||||
|
|
||||||
## Mean Field Games (1D solver)
|
## Mean Field Games (1D solver)
|
||||||
|
|
||||||
OptimizR’s MFG module solves the coupled system for value $u$ and density $m$:
|
Optimiz-rs’s MFG module solves the coupled system for value $u$ and density $m$:
|
||||||
$$
|
$$
|
||||||
\begin{aligned}
|
\begin{aligned}
|
||||||
-\partial_t u(t,x) - \nu\,\partial_{xx} u(t,x) + H\big(x,\partial_x u(t,x), m(t,x)\big) &= 0,\\
|
-\partial_t u(t,x) - \nu\,\partial_{xx} u(t,x) + H\big(x,\partial_x u(t,x), m(t,x)\big) &= 0,\\
|
||||||
@@ -100,7 +100,7 @@ For target density $\pi(x)$ and proposal $q(x'\mid x)$:
|
|||||||
$$
|
$$
|
||||||
\alpha(x \to x') = \min\Big(1, \frac{\pi(x')\, q(x \mid x')}{\pi(x)\, q(x' \mid x)}\Big).
|
\alpha(x \to x') = \min\Big(1, \frac{\pi(x')\, q(x \mid x')}{\pi(x)\, q(x' \mid x)}\Big).
|
||||||
$$
|
$$
|
||||||
OptimizR uses symmetric Gaussian proposals (so $q$ cancels) by default, with optional bounds projection and burn-in.
|
Optimiz-rs uses symmetric Gaussian proposals (so $q$ cancels) by default, with optional bounds projection and burn-in.
|
||||||
|
|
||||||
**Heuristic:** Tune proposal std so acceptance is ~0.25–0.35 for moderate dimensions; see `examples/notebooks/02_mcmc.ipynb` for trace plots.
|
**Heuristic:** Tune proposal std so acceptance is ~0.25–0.35 for moderate dimensions; see `examples/notebooks/02_mcmc.ipynb` for trace plots.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user