Skip to main content

PyMixEF

PyMixEF is a Python-native platform for mixed-effects statistics and pharmacometrics. Its architecture follows one central rule: define the scientific model once in a typed, versioned intermediate representation, then let compatible estimation engines consume that representation.

Documentation · PyPI · Source · Issue tracker

Install

PyMixEF requires Python 3.11 or newer.

Published releases install from PyPI with:

python -m pip install pymixef

For development from a source checkout:

python -m pip install -e .

Tabular adapters, reports, and validation comparison dependencies are optional:

python -m pip install -e ".[data,report,validation]"

To run the tutorial notebooks from GitHub or the source archive, install their Jupyter runtime:

python -m pip install "pymixef[notebooks]"

The ten worked tutorials are backed by pre-executed Jupyter notebooks with reviewed results, multiple scientific figures, and assertion-backed checks. GitHub therefore renders complete worked examples before a reader launches a kernel.

Documentation

The complete documentation includes:

  • installation profiles and a five-minute quickstart;
  • an analysis chooser and full LMM, GLMM, MMRM, PK, ODE, and pharmacometrics guides;
  • data, formula, family, link, covariance, inference, diagnostic, simulation, provenance, validation, CLI, and interoperability reference material;
  • deep dives for all ten pre-executed notebooks with all 31 validated plots and exact saved results;
  • a task-oriented map plus generated signature reference for every public Python module;
  • a searchable catalog of all 56 evidence-gated capabilities.

To build and preview the documentation locally:

python -m pip install -e ".[docs]"
make docs
python -m http.server 8765 --bind 127.0.0.1 --directory docs/_build/dirhtml

The strict build fails on Sphinx warnings, stale notebook figures, missing API docstrings/search entries, broken tutorial coverage, or figure-manifest drift.

First linear mixed model

import pymixef

data = {
    "change": [2.1, 3.2, 2.8, 4.4, 3.7, 5.1],
    "time": [0, 1, 2, 0, 1, 2],
    "subject": ["A", "A", "A", "B", "B", "B"],
}

result = pymixef.fit(
    "change ~ time + (1 | subject)",
    data=data,
    method="reml",
)

print(result.summary())
result.save("fit.json")

Compile and inspect a model without fitting:

model = pymixef.Model.from_formula(
    "change ~ time + (1 | subject)",
    family=pymixef.families.Gaussian(),
)
plan = model.compile(data, engine="lmm", method="reml")
print(plan.explain())

Pharmacometric events and ODEs

from pymixef.pharmacometrics import canonicalize_events, simulate_ode

events = canonicalize_events(
    {
        "ID": [1, 1, 1],
        "TIME": [0.0, 1.0, 4.0],
        "EVID": [1, 0, 0],
        "AMT": [100.0, 0.0, 0.0],
        "CMT": [1, 1, 1],
    }
)

See the documentation map, the validation policy, the public validation artifacts, and the warning catalog.

Scientific and regulatory scope

Every likelihood path states its normalization and parameterization. Every fit retains a convergence object, run manifest, approximation method, data/model fingerprints, warnings, and serialized diagnostic inputs.

PyMixEF can support an organization's context-specific validation process. No package version is universally “FDA validated,” and this project makes no such claim.

License

Apache License 2.0. Formal dependency and name review remains the responsibility of distributors and adopters.

Release files for pymixef 0.1.1

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

Source distribution (sdist)

Source distribution for pymixef 0.1.1
File Size Uploaded
pymixef-0.1.1.tar.gz 2.6 MB Details

Built distribution (wheel)

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

Total release size: 2.8 MB

Release files / pymixef-0.1.1.tar.gz

Download URL pymixef-0.1.1.tar.gz
Size 2.6 MB
Tags Source
SHA-256 checksum
How to use checksums
6d022849f02ca32c1300a787fca00617daa9dbb8cb74b36f97163589e9aaa2d3
BLAKE2b-256 checksum
How to use checksums
fa277b06a9e3aab82689d2baf65ab96f45b6ee30390e30d0eff8d0e2a1653789
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 23, 2026.

Transparency log

Release files / pymixef-0.1.1-py3-none-any.whl

Download URL pymixef-0.1.1-py3-none-any.whl
Size 214.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3d174eba38b9952deb2646232a7cc4c7c17116ad56eac85671f8922f9b594f4d
BLAKE2b-256 checksum
How to use checksums
20f192b1672cb91ec546141b77bc44c4b1e155d0bb72288272b57da7af3faa10
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 23, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 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