2025-12-03 18:16:48 +01:00
|
|
|
"""
|
|
|
|
|
OptimizR - High-Performance Optimization Algorithms
|
|
|
|
|
===================================================
|
|
|
|
|
|
|
|
|
|
Fast, reliable implementations of advanced optimization and statistical
|
|
|
|
|
inference algorithms with Rust acceleration and pure Python fallbacks.
|
|
|
|
|
|
|
|
|
|
.. moduleauthor:: OptimizR Contributors
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
from optimizr.hmm import HMM
|
|
|
|
|
from optimizr.core import (
|
|
|
|
|
mcmc_sample,
|
|
|
|
|
differential_evolution,
|
2026-01-03 00:03:29 +01:00
|
|
|
parallel_differential_evolution_rust,
|
2025-12-03 18:16:48 +01:00
|
|
|
grid_search,
|
|
|
|
|
mutual_information,
|
|
|
|
|
shannon_entropy,
|
2025-12-05 13:14:44 +01:00
|
|
|
sparse_pca_py,
|
|
|
|
|
box_tao_decomposition_py,
|
|
|
|
|
elastic_net_py,
|
|
|
|
|
hurst_exponent_py,
|
|
|
|
|
compute_risk_metrics_py,
|
|
|
|
|
estimate_half_life_py,
|
|
|
|
|
bootstrap_returns_py,
|
2026-01-02 22:13:05 +01:00
|
|
|
# Time-series utilities
|
|
|
|
|
prepare_for_hmm_py,
|
|
|
|
|
rolling_hurst_exponent_py,
|
|
|
|
|
rolling_half_life_py,
|
|
|
|
|
return_statistics_py,
|
|
|
|
|
create_lagged_features_py,
|
|
|
|
|
rolling_correlation_py,
|
2026-01-03 00:03:29 +01:00
|
|
|
# Benchmark functions
|
|
|
|
|
Sphere,
|
|
|
|
|
Rosenbrock,
|
|
|
|
|
Rastrigin,
|
|
|
|
|
Ackley,
|
|
|
|
|
Griewank,
|
2025-12-03 18:16:48 +01:00
|
|
|
)
|
|
|
|
|
|
2026-01-04 14:52:14 +01:00
|
|
|
# Try to import maths_toolkit and mean_field from Rust backend
|
2025-12-10 18:54:32 +01:00
|
|
|
try:
|
|
|
|
|
from optimizr import _core
|
|
|
|
|
maths_toolkit = _core
|
2026-01-04 14:52:14 +01:00
|
|
|
MFGConfig = _core.MFGConfigPy
|
|
|
|
|
solve_mfg_1d_rust = _core.solve_mfg_1d_rust
|
2025-12-10 18:54:32 +01:00
|
|
|
except (ImportError, AttributeError):
|
|
|
|
|
maths_toolkit = None
|
2026-01-04 14:52:14 +01:00
|
|
|
MFGConfig = None
|
|
|
|
|
solve_mfg_1d_rust = None
|
2025-12-10 18:54:32 +01:00
|
|
|
|
|
|
|
|
__version__ = "0.2.0"
|
2025-12-03 18:16:48 +01:00
|
|
|
__all__ = [
|
|
|
|
|
"HMM",
|
|
|
|
|
"mcmc_sample",
|
|
|
|
|
"differential_evolution",
|
2026-01-03 00:03:29 +01:00
|
|
|
"parallel_differential_evolution_rust",
|
2025-12-03 18:16:48 +01:00
|
|
|
"grid_search",
|
|
|
|
|
"mutual_information",
|
|
|
|
|
"shannon_entropy",
|
2025-12-05 13:14:44 +01:00
|
|
|
"sparse_pca_py",
|
|
|
|
|
"box_tao_decomposition_py",
|
|
|
|
|
"elastic_net_py",
|
|
|
|
|
"hurst_exponent_py",
|
|
|
|
|
"compute_risk_metrics_py",
|
|
|
|
|
"estimate_half_life_py",
|
|
|
|
|
"bootstrap_returns_py",
|
2026-01-02 22:13:05 +01:00
|
|
|
# Time-series utilities
|
|
|
|
|
"prepare_for_hmm_py",
|
|
|
|
|
"rolling_hurst_exponent_py",
|
|
|
|
|
"rolling_half_life_py",
|
|
|
|
|
"return_statistics_py",
|
|
|
|
|
"create_lagged_features_py",
|
|
|
|
|
"rolling_correlation_py",
|
2026-01-03 00:03:29 +01:00
|
|
|
# Benchmark functions
|
|
|
|
|
"Sphere",
|
|
|
|
|
"Rosenbrock",
|
|
|
|
|
"Rastrigin",
|
|
|
|
|
"Ackley",
|
|
|
|
|
"Griewank",
|
2025-12-10 18:54:32 +01:00
|
|
|
"maths_toolkit",
|
2026-01-04 14:52:14 +01:00
|
|
|
# Mean Field Games
|
|
|
|
|
"MFGConfig",
|
|
|
|
|
"solve_mfg_1d_rust",
|
2025-12-03 18:16:48 +01:00
|
|
|
]
|