Installation
Prerequisites
- Python 3.8 or higher
- NumPy 1.21 or higher
- pandas 1.3 or higher
Install from PyPI
Install from Source
Prerequisites for Building
- Rust toolchain (1.70+)
- maturin build tool
Steps
-
Install Rust (if not already installed):
-
Clone the repository:
-
Install build dependencies:
-
Build and install:
Development Installation
For development work:
Verify Installation
import econometrust
import numpy as np
# Quick test
X = np.random.randn(100, 2)
y = X @ [1.0, -0.5] + np.random.randn(100) * 0.1
model = econometrust.OLS()
model.fit(X, y)
print("Installation successful!")
print(f"Coefficients: {model.coefficients}")
Performance Notes
Econometrust is built with Rust for maximum performance:
- Compiled Native Code: Orders of magnitude faster than pure Python implementations
- Memory Optimized: Minimal allocation overhead during computation
- SIMD Instructions: Automatic vectorization for supported operations
- Cache-Friendly: Data structures optimized for modern CPU architectures
Troubleshooting
Common Issues
-
Rust toolchain not found:
-
maturin build fails:
-
NumPy compatibility:
Platform-Specific Notes
macOS: Requires Xcode command line tools:
Windows: Requires Microsoft C++ Build Tools or Visual Studio.
Linux: Requires standard development tools (gcc, make, etc.).
Dependencies
Econometrust has minimal dependencies:
- NumPy: Array operations and linear algebra
- pandas: Optional, for DataFrame support in examples
- pytest: Testing framework (development only)
- ruff: Code formatting (development only)
The core library only requires NumPy for basic functionality.