Skip to main content

econometricsmodels

CI (engine) CI (python) Docs License: MIT

A Python API providing statistical and econometric analysis methods. It is primarily intended for use as the analysis engine for economicon, a GUI application for data analysis, and its design prioritizes ease of embedding from scripts and programs (type completion, validation, dynamic construction).

  • The computational core is implemented in Rust and thinly bound to Python via PyO3.
  • Data input is restricted to polars DataFrames only, passed to the Rust side via Arrow zero-copy.
  • Formula-string parsing (e.g. y ~ x1 + x2) is not used. The dependent variable is passed as a single column name (str), independent variables as a list of column names (list[str]), and estimation options as an instance of a dedicated class.

Installation

pip install econometricsmodels

Requires Python 3.12 or later.

Quickstart

OLS

import polars as pl
from econometricsmodels import OLS

df = pl.DataFrame(
    {
        "y": [2.1, 3.9, 6.2, 8.1, 9.8],
        "x1": [1.0, 2.0, 3.0, 4.0, 5.0],
    }
)

result = OLS(df, y="y", x=["x1"]).fit()

print(result.params)       # {"const": ..., "x1": ...}
print(result.std_errors)   # {"const": ..., "x1": ...}
print(result.r_squared)

# Row-oriented parameter table (param/coef/std_err/t_stat/p_value/conf_lower/conf_upper).
print(result.coef_table())

# Overall-fit statistics.
print(result.f_statistic, result.f_p_value)
print(result.aic, result.bic)

Logit

from econometricsmodels import Logit

df = pl.DataFrame(
    {
        "y": [0.0, 0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0, 1.0],
        "x1": [1.0, 1.5, 2.0, 2.5, 3.0, 3.2, 3.8, 4.0, 4.5, 5.0],
    }
)

result = Logit(df, y="y", x=["x1"]).fit()

print(result.coef_table())  # same shape as OLS, but z_stat instead of t_stat
print(result.aic, result.bic)

# Likelihood-ratio test for overall significance (the Logit/Probit analogue
# of OLS's F-statistic), plus McFadden pseudo R-squared.
print(result.lr_statistic, result.lr_p_value)
print(result.pseudo_r_squared)

Probit has the same API shape as Logit (drop-in replacement).

For more details — including how to switch to heteroskedasticity-robust standard errors (HC0-HC3), cluster-robust standard errors, HAC (Newey-West) standard errors, and Logit/Probit-specific features (marginal effects, classification tables) — see the documentation site. The full documentation, including the API reference, is published at https://masahiroyecon1997dev.github.io/econometricsmodels/.

Implementation status

Implemented: OLS (Ordinary Least Squares), WLS (Weighted Least Squares), Logit, Probit.

In progress: IV (2SLS/GMM).

Planned next, in this order: Tobit → FE (Fixed Effects) → RE (Random Effects) → GLS.

During the 0.x.x pre-release period, breaking changes may occur even in minor version bumps.

Verification accuracy

Estimates for each implemented method (coefficients, standard errors, confidence intervals, AIC, BIC, log-likelihood, and the model's overall-significance test — F-statistic/p-value for OLS/WLS, likelihood-ratio statistic/p-value for Logit/Probit — plus R²/adjusted R² for OLS/WLS and McFadden pseudo R² for Logit/Probit) are verified by numerical comparison against reference implementations. In addition to a primary reference, an independent implementation is used as a cross-check.

Method cov_type Primary reference Independent cross-check
OLS / WLS classical / HC0-3 / cluster statsmodels (relative tolerance 1e-8) R (lm/lm(weights=) + sandwich/lmtest, relative tolerance 1e-8)
OLS / WLS HAC (Newey-West) statsmodels (relative tolerance 1e-8) R (relative tolerance 1e-2 for OLS, 5e-2 for WLS — looser due to differing small-sample correction conventions)
Logit / Probit classical / OPG / HC0 / cluster statsmodels (relative tolerance 1e-8) R (glm + sandwich/marginaleffects, relative tolerance ~2e-4 — looser due to differing optimizer convergence)
Logit / Probit HC1 R (glm + sandwich, relative tolerance ~2e-4) — used as the primary reference here, since statsmodels' discrete-choice models omit the n/(n-k) small-sample correction for HC1 —

License

MIT License

Metadata

Release files for econometricsmodels 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for econometricsmodels 0.4.0
File Size Uploaded
econometricsmodels-0.4.0.tar.gz 226.8 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for econometricsmodels 0.4.0
File
econometricsmodels-0.4.0-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details
econometricsmodels-0.4.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.17+ x86-64 Details
econometricsmodels-0.4.0-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details
econometricsmodels-0.4.0-cp314-cp314-macosx_10_12_x86_64.whl CPython 3.14 CPython 3.14 macOS 10.12+ x86-64 Details
econometricsmodels-0.4.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
econometricsmodels-0.4.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details
econometricsmodels-0.4.0-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
econometricsmodels-0.4.0-cp313-cp313-macosx_10_12_x86_64.whl CPython 3.13 CPython 3.13 macOS 10.12+ x86-64 Details
econometricsmodels-0.4.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
econometricsmodels-0.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
econometricsmodels-0.4.0-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
econometricsmodels-0.4.0-cp312-cp312-macosx_10_12_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.12+ x86-64 Details

Total release size: 69.2 MB

Release files / econometricsmodels-0.4.0.tar.gz

Download URL econometricsmodels-0.4.0.tar.gz
Size 226.8 kB
Tags Source
SHA-256 checksum
How to use checksums
090e4d957a9cccccde7bad41b46bf5900326de1b87b16f523fb39c69a3150ef3
BLAKE2b-256 checksum
How to use checksums
e2ec97dff381137b4d3cad550f1c8e81f12b8dbe0bd4318fd365b24b892430ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.

Transparency log

Release files / econometricsmodels-0.4.0-cp314-cp314-win_amd64.whl

Download URL econometricsmodels-0.4.0-cp314-cp314-win_amd64.whl
Size 5.8 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
3112094ba5f78284458ea2f5f93fd0c69432b9021f774cfd165893170e40645b
BLAKE2b-256 checksum
How to use checksums
4a3ddf4c0a5ebece9d60773f15dc7d1133ec825aa55a7594a5692625ee657632
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.

Transparency log

Release files / econometricsmodels-0.4.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL econometricsmodels-0.4.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 6.4 MB
Tags CPython 3.14 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
2cbfb907a2236251b0dd5f4ab650cbdc72f77adc4d90040e34316c31052ff093
BLAKE2b-256 checksum
How to use checksums
d638dcaca875a6e5c2bc5580a483f65091fde8f74709a29638fe51abc008d735
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.

Transparency log

Release files / econometricsmodels-0.4.0-cp314-cp314-macosx_11_0_arm64.whl

Download URL econometricsmodels-0.4.0-cp314-cp314-macosx_11_0_arm64.whl
Size 5.1 MB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
64df9c86cf20ee5a5cf0a986f69391061fe32f3155f966d60ca0cbb08c5a0e08
BLAKE2b-256 checksum
How to use checksums
b70e36ff470da1d32769438960a91640498502123955b6c1b681d07562b252a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.

Transparency log

Release files / econometricsmodels-0.4.0-cp314-cp314-macosx_10_12_x86_64.whl

Download URL econometricsmodels-0.4.0-cp314-cp314-macosx_10_12_x86_64.whl
Size 5.7 MB
Tags CPython 3.14 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
6aef62ff0f570343bcbfd72ef4fa024a1cd5558c2a7ee6e055bf0a363c25c2c2
BLAKE2b-256 checksum
How to use checksums
7ff636ea15580ff45b9a3c2353ddd64ff7575f3e432b32f651c6af78ae0ca8b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.

Transparency log

Release files / econometricsmodels-0.4.0-cp313-cp313-win_amd64.whl

Download URL econometricsmodels-0.4.0-cp313-cp313-win_amd64.whl
Size 5.8 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
607123377a73ea6f6fb7ac39f0dd7442ad9cb589c7a0f4b55e925793533cfc08
BLAKE2b-256 checksum
How to use checksums
2f81730baa6cb938a245a28c792a4ce633e9010a58d6ec1b22c279a518335c3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.

Transparency log

Release files / econometricsmodels-0.4.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL econometricsmodels-0.4.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 6.4 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
5d80386b71727333d44ccaf640acb92a7365cc1766b07728412d0580cc2bd131
BLAKE2b-256 checksum
How to use checksums
3866278e580d8bb7fe281fa514543944096935bee8eb34854f6353095fd7e82c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.

Transparency log

Release files / econometricsmodels-0.4.0-cp313-cp313-macosx_11_0_arm64.whl

Download URL econometricsmodels-0.4.0-cp313-cp313-macosx_11_0_arm64.whl
Size 5.1 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4251d7ad6f24d4ab6f35b533d20b588baa8a8c9cef4bc736cb2fcbdb17f0b041
BLAKE2b-256 checksum
How to use checksums
2284747adc24bd107a65769b41751e8671ab12ac7968c915ad9b22d3f0d75a11
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.

Transparency log

Release files / econometricsmodels-0.4.0-cp313-cp313-macosx_10_12_x86_64.whl

Download URL econometricsmodels-0.4.0-cp313-cp313-macosx_10_12_x86_64.whl
Size 5.8 MB
Tags CPython 3.13 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
ff804e4b25a2002c50f35ba5a80a828e547e749d7cd2352a0a3705967f4f65f1
BLAKE2b-256 checksum
How to use checksums
1f3ecae5cec3902be2ffc8fcf7c4c009e99ebed02fca5069e8d0013d65285437
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.

Transparency log

Release files / econometricsmodels-0.4.0-cp312-cp312-win_amd64.whl

Download URL econometricsmodels-0.4.0-cp312-cp312-win_amd64.whl
Size 5.8 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
51c548ab5a44fcd8bd75d02c8f254e5182ab4aa8edc3f71e2c45c34080c727e6
BLAKE2b-256 checksum
How to use checksums
e105cc9df6608147c7eedaa4ad24f842339be57d41905e4359b867e60342c675
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.

Transparency log

Release files / econometricsmodels-0.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL econometricsmodels-0.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 6.4 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
e5ceee49b08b3c87f9d100b0079d00904a5c2de0da39f1104eaf6f84954de560
BLAKE2b-256 checksum
How to use checksums
cb3a540da417869f7cc95ee3ac760a5c91b36e7ce3f4eb2841c3920d6843334b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.

Transparency log

Release files / econometricsmodels-0.4.0-cp312-cp312-macosx_11_0_arm64.whl

Download URL econometricsmodels-0.4.0-cp312-cp312-macosx_11_0_arm64.whl
Size 5.1 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
32e5847a39a979d8c02f89538141b1e9502f936a165baeb4e88a48e5bd0b6b97
BLAKE2b-256 checksum
How to use checksums
f6d36360d398734738c9822d5e52558b676b9646870ba6dd4a07388bdd594da1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.

Transparency log

Release files / econometricsmodels-0.4.0-cp312-cp312-macosx_10_12_x86_64.whl

Download URL econometricsmodels-0.4.0-cp312-cp312-macosx_10_12_x86_64.whl
Size 5.8 MB
Tags CPython 3.12 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
9c57f330b14f58076d30eb28b315c5a20dac4dd33c076fe16d9e86200dd3b2e4
BLAKE2b-256 checksum
How to use checksums
c1711be30157ad19aaa8da307630587206c23f53c7298a7d3881585f47fd1bea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.

Transparency log

Release history Release notifications | RSS feed

0.7.0

13 release files

0.5.0

13 release files

This release

0.4.0 This release

13 release files

0.2.0

13 release files

0.1.0

13 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page