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, declare the causal scope a model is meant for, check scenarios against it, 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.18.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.18.0
File Size Uploaded Provenance Actions
aimz-0.18.0.tar.gz 144.4 kB With provenance Details for aimz-0.18.0.tar.gz

Built distribution (wheel)

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

Total release size: 265.7 kB

Release files / aimz-0.18.0.tar.gz

Download URL aimz-0.18.0.tar.gz
Size 144.4 kB
Tags Source
SHA-256 checksum
How to use checksums
532b74ceffaaa2d5cc52074b258ebb82d7b341cde2e2b9f20452cfc1a01dc9fe
BLAKE2b-256 checksum
How to use checksums
6ab688c6768f10ba6f16984fd91414bd70d23bc9310831dbf1bb924e495dde3b
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 Nov 16, 2026.

Transparency log

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

Download URL aimz-0.18.0-py3-none-any.whl
Size 121.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2aa1a24af732c811d3cfddede057c191fea3520079c30666b1adc93efd6c310e
BLAKE2b-256 checksum
How to use checksums
36dc60d612683a53c330c10fbc585f10691213adc2a855ecb6fabbd42786e598
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 Nov 16, 2026.

Transparency log

Security for aimz 0.18.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.18.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 Nov 16, 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