Instrumental Variables Regression in Python
ivmodels implements
- K-Class estimators, including the Limited Information Maximum Likelihood (LIML) and the Two-Stage Least Squares (TSLS) estimator.
- Tests and confidence sets for the parameters of the model, including the Anderson-Rubin test, the Lagrange multiplier test, the (conditional) likelihood-ratio test, and the Wald test.
- Auxiliary tests such as Anderson's (1951) test of reduced rank (a multivariate extension to the first-stage F-test), the J-test (including its LIML variant), and Scheidegger et al.'s residual prediction test of well-specification.
See the docs and the examples therein for more details. See this document for an introduction to the estimators, tests, and their properties.
If you use this code, consider citing
@article{londschien2025statistician,
title={A statistician's guide to weak-instrument-robust inference in instrumental variables regression with illustrations in {Python}},
author={Londschien, Malte},
journal={arXiv preprint arXiv:2508.12474},
year={2025}
}
and
@article{londschien2024weak,
title={Weak-instrument-robust subvector inference in instrumental variables regression: A subvector Lagrange multiplier test and properties of subvector Anderson-Rubin confidence sets},
author={Londschien, Malte and B{\"u}hlmann, Peter},
journal={arXiv preprint arXiv:2407.15256},
year={2024}
}
Installation
You can install ivmodels from conda (recommended):
conda install -c conda-forge ivmodels
or pip:
pip install ivmodels
Release files for ivmodels 0.10.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 | |
|---|---|---|---|
| ivmodels-0.10.0.tar.gz | 85.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ivmodels-0.10.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 143.0 kB
Release files / ivmodels-0.10.0.tar.gz
| Download URL | ivmodels-0.10.0.tar.gz |
|---|---|
| Size | 85.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fb9ce7c6b52b396308bf75b9963132e7bd1531b249e7ad9bd92584898e733d2a
|
|
BLAKE2b-256 checksum How to use checksums |
ca4cdfd032c74dc46b2ee577dd12edd556b0bfc37044eb5fce9b79507c221020
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Mar 19, 2026.
Transparency logRelease files / ivmodels-0.10.0-py3-none-any.whl
| Download URL | ivmodels-0.10.0-py3-none-any.whl |
|---|---|
| Size | 57.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
372e8178fdb79c50ffcc43a0183183ccae217f3d3841fe5c866f4cdb7543cd1d
|
|
BLAKE2b-256 checksum How to use checksums |
9e757d79b7fcb70000a35d225f9aa60e16a02a030fd0d6820299ffb97998c0e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Mar 19, 2026.
Transparency log