econometricsmodels
統計・計量経済学の分析手法を提供するPython APIです。分析GUIアプリ「economicon」のエンジンとして使われることを主な用途としており、スクリプト・プログラムからの組み込みやすさ(型補完・バリデーション・動的な組み立て)を優先した設計になっています。
- 計算コアは Rust で実装し、PyO3 で薄くPythonにバインディングしています。
- データ入力は polars DataFrameのみに限定し、ArrowのゼロコピーでRust側に受け渡します。
y ~ x1 + x2のようなformula文字列パースは採用せず、被説明変数は列名(str)、説明変数は列名のリスト(list[str])、推定オプションは専用クラスのインスタンスとして渡します。
インストール
pip install econometricsmodels
対応Pythonバージョンは3.12以上です。
クイックスタート
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)
不均一分散に頑健な標準誤差(HC0〜HC3)・クラスター標準誤差・HAC(Newey-West)標準誤差への切り替えなど、詳しい使い方はdocs/getting-started.mdを参照してください。
検証精度
各手法の推定値(係数・標準誤差・信頼区間・R²・調整済みR²・AIC・BIC・対数尤度・F統計量・F検定p値)は、リファレンス実装との数値比較で検証しています。主リファレンスに加え、独立実装によるクロスチェックも行っています。
| 手法 | cov_type | 主リファレンス | 独立クロスチェック |
|---|---|---|---|
| OLS | classical / HC0-3 / cluster | statsmodels(相対誤差1e-8) | R(lm + sandwich/lmtest、相対誤差1e-8) |
| OLS | HAC(Newey-West) | statsmodels(相対誤差1e-8) | R(相対誤差1e-2。小標本補正の慣習差のため緩め) |
| WLS | classical / HC0-3 / cluster | statsmodels(相対誤差1e-8) | R(lm(weights=) + sandwich/lmtest、相対誤差1e-8) |
| WLS | HAC(Newey-West) | statsmodels(相対誤差1e-8) | R(相対誤差5e-2。小標本補正の慣習差のため緩め) |
実装状況
現在実装済みなのは Phase 1(基礎回帰)のうち OLS(最小二乗法)・WLS(加重最小二乗法) です。区分回帰を含む他の手法は未着手です。
0.x.xのプレリリース期間中は、マイナーバージョンの変更でも破壊的変更が入る可能性があります。
ライセンス
Metadata
Release files for econometricsmodels 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| econometricsmodels-0.2.0.tar.gz | 110.9 kB | Details |
Built distributions (wheels)
Total release size: 66.2 MB
Release files / econometricsmodels-0.2.0.tar.gz
| Download URL | econometricsmodels-0.2.0.tar.gz |
|---|---|
| Size | 110.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2052a4e3754316d8fd9ccfe7b11b9d0de4090107cf3b2f4b9fe10be51e432dff
|
|
BLAKE2b-256 checksum How to use checksums |
1a5fa42dc7ccae51c2c708dc77680f0cd46ac6ae8f3289902eea89680c37e5d7
|
| 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 Jul 25, 2026.
Transparency logRelease files / econometricsmodels-0.2.0-cp314-cp314-win_amd64.whl
| Download URL | econometricsmodels-0.2.0-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 5.5 MB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
0c2ab0cb7ce629a64e46d479db504cd6a6ffb67c5defa9f3148536385d0254fb
|
|
BLAKE2b-256 checksum How to use checksums |
6d2ad36bf5bb26a0dda9c6e49ffacd5850b668af899fd7bd2948dba77b2763ad
|
| 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 Jul 25, 2026.
Transparency logRelease files / econometricsmodels-0.2.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | econometricsmodels-0.2.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 6.1 MB |
| Tags | CPython 3.14 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
eeab89785f8dd4f65d59e2d8422b9d19220f31e771c99f1afcc57a515caa0720
|
|
BLAKE2b-256 checksum How to use checksums |
194fac440b1aa791e61730f62763f4eca097e93f00c683f5b4fb29f6c41c9508
|
| 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 Jul 25, 2026.
Transparency logRelease files / econometricsmodels-0.2.0-cp314-cp314-macosx_11_0_arm64.whl
| Download URL | econometricsmodels-0.2.0-cp314-cp314-macosx_11_0_arm64.whl |
|---|---|
| Size | 4.9 MB |
| Tags | CPython 3.14 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
7228c38bb4737d4ed71382ddb5a086b16294c75bd971c370b4cc92c285b8cffa
|
|
BLAKE2b-256 checksum How to use checksums |
ba1e858e8ef4475ca14613575f173433b5092d0ec9e3acc169e368752a0241f9
|
| 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 Jul 25, 2026.
Transparency logRelease files / econometricsmodels-0.2.0-cp314-cp314-macosx_10_12_x86_64.whl
| Download URL | econometricsmodels-0.2.0-cp314-cp314-macosx_10_12_x86_64.whl |
|---|---|
| Size | 5.5 MB |
| Tags | CPython 3.14 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
94cd47debb9a30f4d4e4fe55398b5fabb0911c34970d567755e0f5304785ef9b
|
|
BLAKE2b-256 checksum How to use checksums |
6a2b12f8772f0a96e264f258c28de8b53e4017cef4e6641f8f6942f79aa14c2f
|
| 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 Jul 25, 2026.
Transparency logRelease files / econometricsmodels-0.2.0-cp313-cp313-win_amd64.whl
| Download URL | econometricsmodels-0.2.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 5.5 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
8fa477219abf5bfc58821e58de00ffcd21da33d984dacb482eb4fecb10d186b0
|
|
BLAKE2b-256 checksum How to use checksums |
46cc85382ee94d566e5025e1374a3130f8503a65c9d376e702d02b5e05da913c
|
| 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 Jul 25, 2026.
Transparency logRelease files / econometricsmodels-0.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | econometricsmodels-0.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 6.1 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
193e40c9c46fe7e90c11521e5122c9440f221542e6944a966fdcff6a683e3c68
|
|
BLAKE2b-256 checksum How to use checksums |
acb0e963a94278733ff4ea7db2f83e61fa3871a0166506bbf104f63f2ac55102
|
| 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 Jul 25, 2026.
Transparency logRelease files / econometricsmodels-0.2.0-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | econometricsmodels-0.2.0-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 4.9 MB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
0cacee0bcf92dd870a11e8fed790815e1581825f08f829857c25b3a094ee267f
|
|
BLAKE2b-256 checksum How to use checksums |
e7df252039de99569e6ed7aa30e42684432562e94c2e613fa768d4edd0259fbf
|
| 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 Jul 25, 2026.
Transparency logRelease files / econometricsmodels-0.2.0-cp313-cp313-macosx_10_12_x86_64.whl
| Download URL | econometricsmodels-0.2.0-cp313-cp313-macosx_10_12_x86_64.whl |
|---|---|
| Size | 5.5 MB |
| Tags | CPython 3.13 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
2bb67f1befad874ec5af8a021d18090b0c8e4c07044f7809f3f5a7800d325d09
|
|
BLAKE2b-256 checksum How to use checksums |
171ee8d9cfadd7e8d5dbd70d9aa630107c2def5fd52da5320f0d0c2056d476db
|
| 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 Jul 25, 2026.
Transparency logRelease files / econometricsmodels-0.2.0-cp312-cp312-win_amd64.whl
| Download URL | econometricsmodels-0.2.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 5.5 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
2e578fbec70d9b675508624d40d9a20db8a6c99dcc1ee88043f3002cf9561115
|
|
BLAKE2b-256 checksum How to use checksums |
00b6c593dae099d27598d1cc1b7c164fb6f51bfb051602cd914c4b3b89640f10
|
| 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 Jul 25, 2026.
Transparency logRelease files / econometricsmodels-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | econometricsmodels-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 6.1 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
084394bd7164bb1cf7160ea37e0124c51deac05b6d93f345077058f6d6859837
|
|
BLAKE2b-256 checksum How to use checksums |
abb24c0f8689809784e2aeca881d83ef9a3738d16e443c569fa6659986f295c9
|
| 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 Jul 25, 2026.
Transparency logRelease files / econometricsmodels-0.2.0-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | econometricsmodels-0.2.0-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 4.9 MB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
26b1efc7656557482031db17687af8b8b705f7bb11f00bf37a879c8cf0116788
|
|
BLAKE2b-256 checksum How to use checksums |
e1c6762749802c09733146720f83dbca3af74903d9993848800218765d8b5d16
|
| 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 Jul 25, 2026.
Transparency logRelease files / econometricsmodels-0.2.0-cp312-cp312-macosx_10_12_x86_64.whl
| Download URL | econometricsmodels-0.2.0-cp312-cp312-macosx_10_12_x86_64.whl |
|---|---|
| Size | 5.5 MB |
| Tags | CPython 3.12 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
469d51024eb96bbb268c919881c8ac2930eeb440aad9502aa3761c24ff0b93bf
|
|
BLAKE2b-256 checksum How to use checksums |
2e499849abefbb876c3ead7df0aa22c1730011f310e8458a06312492e752b442
|
| 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 Jul 25, 2026.
Transparency log