Skip to main content

aimz: Scalable probabilistic impact modeling

Run Pytest PyPI Conda Python License: Apache 2.0 Code style: ruff codecov JOSS DOI

Installation | User Guide | Examples | FAQs | Changelog

Overview

aimz is a Python library for scalable probabilistic impact modeling: estimating how interventions affect outcomes while quantifying uncertainty.

It provides a high-level, object-oriented interface on top of NumPyro and JAX for building, fitting, and scaling Bayesian models: a user-defined NumPyro model is wrapped as a "kernel" inside a single class, augmented with capabilities for scalable predictive sampling, structured outputs, and experiment tracking.

Key capabilities

  • Object-oriented interface for NumPyro models: Bring any NumPyro model as a "kernel" and access fit, predict, sample, and related methods through a single class; aimz does not enforce a fixed architecture.
  • Scalable predictive sampling: JIT-compiled, sharded sampling streams results to chunked Zarr stores (or accumulates them in memory), enabling large-scale posterior predictive simulations that do not need to fit in memory.
  • Structured outputs: Predictions, samples, and effect estimates are materialized as Xarray objects backed by Zarr or host memory, integrating cleanly with the scientific Python ecosystem.
  • Intervention handling and impact modeling: Specify interventions declaratively and estimate effects from prior or posterior predictive distributions.
  • Experiment tracking: MLflow integration for logging runs, parameters, metrics, and model artifacts with full lineage.

Installation

Install aimz using either pip or conda:

pip install -U aimz
conda install -c conda-forge aimz

For additional details, see the full installation guide.

Quick start

from aimz import ImpactModel


# Define a probabilistic model (kernel) using NumPyro primitives
def model(X, trt, y=None): ...


# Load or prepare data, including the treatment trt
X, trt, y = ...

# Initialize ImpactModel with SVI or MCMC inference
im = ImpactModel(
    model,
    rng_key=...,  # e.g., jax.random.key(0)
    inference=...,  # e.g., SVI (or MCMC)
)

# Fit model with minibatch SVI and draw posterior samples
im.fit(X, y, trt=trt, batch_size=32, epochs=10)

# Generate posterior predictive samples
dt = im.predict(X, trt=trt)

# Estimate the effect of treating every unit versus none
effect = im.estimate_effect(
    args_baseline={"X": X, "trt": 0.0},
    args_intervention={"X": X, "trt": 1.0},
)

Contributing

See the Contributing Guide to get started.

Citation

If you use aimz in your work, please cite the accompanying paper in the Journal of Open Source Software:

@article{Kim2026,
  title        = {aimz: Scalable probabilistic impact modeling},
  author       = {Kim, Eunseop},
  year         = 2026,
  journal      = {Journal of Open Source Software},
  publisher    = {The Open Journal},
  volume       = 11,
  number       = 120,
  pages        = 9738,
  doi          = {10.21105/joss.09738},
  url          = {https://doi.org/10.21105/joss.09738}
}

Metadata

Release files for aimz 0.17.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 aimz 0.17.0
File Size Uploaded Provenance Actions
aimz-0.17.0.tar.gz 126.7 kB With provenance Details for aimz-0.17.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aimz 0.17.0
File Interpreter ABI Platform Actions
aimz-0.17.0-py3-none-any.whl Python 3 none any Details for aimz-0.17.0-py3-none-any.whl

Total release size: 231.1 kB

Release files / aimz-0.17.0.tar.gz

Download URL aimz-0.17.0.tar.gz
Size 126.7 kB
Tags Source
SHA-256 checksum
How to use checksums
fb4516465e6ebad9e9803afc7391065a97cc5400973ec854bbe3f29b7ee7cf21
BLAKE2b-256 checksum
How to use checksums
cdbcbca0365462aaa623296a1193e776d47eba28a5926eced84bbbbda8b3e9f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 26, 2026.

Transparency log

Release files / aimz-0.17.0-py3-none-any.whl

Download URL aimz-0.17.0-py3-none-any.whl
Size 104.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
498f33b22d7caa296de7728c7fb25413ab01e5f73105fd3f71c8e6738bccdd61
BLAKE2b-256 checksum
How to use checksums
97c474c9b339eb492e350cdaf4d160916ffad3f7e0d04fe4676306f7e3c9445f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 26, 2026.

Transparency log

Security for aimz 0.17.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for aimz-0.17.0.tar.gz

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 Oct 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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