Skip to main content

Python-native mixed-effects statistics and pharmacometrics

Project description

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.

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]"

Before the first PyPI release, use python -m pip install -e ".[notebooks]" from a source checkout. Maintainer publication prerequisites and the Trusted Publishing procedure are documented in docs/publishing.md.

The ten tutorial notebooks are committed with reviewed results, multiple scientific figures, and assertion-backed checks, so GitHub 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 the Read the Docs site 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymixef-0.1.0.tar.gz (2.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pymixef-0.1.0-py3-none-any.whl (214.1 kB view details)

Uploaded Python 3

File details

Details for the file pymixef-0.1.0.tar.gz.

File metadata

  • Download URL: pymixef-0.1.0.tar.gz
  • Upload date:
  • Size: 2.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for pymixef-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5db9f5bb60f3de88dbec2fb1462b2114888a006f7cee3de59cb48ea13fcd6589
MD5 5a1e49149fb8a3a987946c0e0f0d0f11
BLAKE2b-256 ac1e588e52d66a5be11f0fe62e642f8362338276d5f3db232e1d1204fd9c0164

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymixef-0.1.0.tar.gz:

Publisher: publish.yml on kkusima/PyMixEF

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymixef-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pymixef-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 214.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for pymixef-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7aab962f294fca454d0365d202db5c44c4f5a9b07eafd04589476ad342eb6041
MD5 33dca826c39a4c122a7f420ae6a20dc7
BLAKE2b-256 74eee2309d0f97c5eadb5ef0da53a5af751d3cdf151b29e9e5ab4e60e3a8aa48

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymixef-0.1.0-py3-none-any.whl:

Publisher: publish.yml on kkusima/PyMixEF

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page