Skip to content

Installation

Prerequisites

  • Python 3.8 or higher
  • NumPy 1.21 or higher
  • pandas 1.3 or higher

Install from PyPI

pip install econometrust

Install from Source

Prerequisites for Building

  • Rust toolchain (1.70+)
  • maturin build tool

Steps

  1. Install Rust (if not already installed):

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    source ~/.cargo/env
    

  2. Clone the repository:

    git clone https://github.com/wdeligt/econometrust.git
    cd econometrust
    

  3. Install build dependencies:

    pip install maturin
    

  4. Build and install:

    maturin develop
    

Development Installation

For development work:

git clone https://github.com/wdeligt/econometrust.git
cd econometrust
pip install -e ".[dev]"

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

  1. Rust toolchain not found:

    # Install Rust
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    

  2. maturin build fails:

    # Update maturin
    pip install --upgrade maturin
    

  3. NumPy compatibility:

    # Update NumPy
    pip install --upgrade numpy
    

Platform-Specific Notes

macOS: Requires Xcode command line tools:

xcode-select --install

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.