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.

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.

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.1.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.1-py3-none-any.whl (214.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pymixef-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 6d022849f02ca32c1300a787fca00617daa9dbb8cb74b36f97163589e9aaa2d3
MD5 ea79d9db34d668bb080f4959719c610b
BLAKE2b-256 fa277b06a9e3aab82689d2baf65ab96f45b6ee30390e30d0eff8d0e2a1653789

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymixef-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: pymixef-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 214.2 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3d174eba38b9952deb2646232a7cc4c7c17116ad56eac85671f8922f9b594f4d
MD5 bf2b3182253570a642b5f0714aea9181
BLAKE2b-256 20f192b1672cb91ec546141b77bc44c4b1e155d0bb72288272b57da7af3faa10

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymixef-0.1.1-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