Skip to main content

symphony-dt

Bayesian hierarchical state-space digital twins for longitudinal clinical cohorts.

PyPI Python versions CI Coverage Docs Licence

symphony-dt builds, checks, calibrates, forecasts with and audits Bayesian digital twins of longitudinal clinical cohorts. It ships pd_v2, the frozen model of the SYMPHONY v2 study of Parkinson's disease progression. pd_v2 follows MDS-UPDRS Part III, MoCA and SCOPA-AUT over time, in Stan, driven from Python with cmdstanpy.

Developed by Ahmed Hemedan. Validation manuscript in preparation.

The digital twin of Parkinson's disease: from irregular clinic visits to a calibrated forecast that must pass fixed gates

The logo is a red tulip, the symbol of Parkinson's disease. Its solid half is the patient. Its dotted half is the digital twin, drawn as posterior samples.

Install

pip install "symphony-dt[io]"
python -m cmdstanpy.install_cmdstan --version 2.39.0
symphony-dt check --compile

Or use the container image, with CmdStan installed and pd_v2 already compiled, for Linux on Intel or ARM and for Apple silicon:

docker run --rm -v "$PWD":/work ghcr.io/a7med7emedan/symphony-dt:2.1.1 check

A ten-line example

import numpy as np
from symphony_dt.data import simulate_cohort
from symphony_dt.fit import fit
from symphony_dt.forecast import split_at_anchor, forecast_exact

cohort = simulate_cohort(60, seed=1)                       # synthetic data only
split = split_at_anchor(cohort.stan_data, list(range(0, 60, 4)), anchor_years=2.0)
result = fit(split.fit, chains=4, iter_warmup=1000, iter_sampling=1000, output_dir="run")
print("\n".join(result.gates().summary_lines()))           # the study's convergence gates
forecast = forecast_exact(result, split, total_keep=400)
print(forecast.interval(0.95).head())

How it works

symphony-dt method overview: data, model, inference, gates, evaluation and governance

What it does

  • A validated, long-format data model with a design-envelope check. Adapters read wide tables, OMOP CDM, HL7 FHIR R4, CDISC SDTM and the PPMI download layout.
  • The pd_v2 model of record, byte-identical to the study and checked by sha256 at import.
  • Fitting with chain-level resume, and the study's convergence gates fixed in one place.
  • Exact forecasts by the study's design, and an experimental fast route for new participants.
  • The scoring code of record: interval coverage, CRPS, LOCF and mixed-model baselines, events, bootstrap.
  • Simulation-based calibration with explicit multiplicity control, and posterior predictive checks.
  • Run manifests, data fingerprints, pre-registration freezes, PROV provenance, model and data cards.
  • One study file runs everything, with eligibility rules and an attrition table, a data profile, tidy tables and plots for every step.
  • A living twin (EXPERIMENTAL) that updates with each visit and monitors its own calibration with an anytime-valid e-process. It recalibrates online, suggests the most informative next visit and relearns with lineage.
  • Runs anywhere: Slurm job arrays, Docker and Apptainer, portable run bundles, JSON Schemas and a JSON twin service.
  • An open synthetic benchmark against LOCF and a mixed model.

Every public function carries a validation label: VALIDATED, TESTED or EXPERIMENTAL. See the documentation.

Governance

No participant data ship with this package, and none may be added. Tests, examples and tutorials use the package's own simulator. A privacy gate runs before every commit and in CI. The model was developed on PPMI data under the PPMI data use agreement; obtain PPMI data yourself from PPMI. No PPMI-derived result appears here until the validation manuscript is published. The twin's forecasts are associational: no causal, treatment or deployment claim is made. See GOVERNANCE.md.

Citation

Hemedan A. symphony-dt: Bayesian digital twins of Parkinson's disease progression, version 2.0.0. https://github.com/a7med7emedan/symphony-dt

See CITATION.cff.

Licence

BSD-3-Clause, copyright Ahmed Hemedan. Version 1 remains on the v1 branch and the v1.0-preprint tag under its original Apache-2.0 licence.

Metadata

Release files for symphony-dt 2.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 symphony-dt 2.1.1
File Size Uploaded Provenance Actions
symphony_dt-2.1.1.tar.gz 291.0 kB With provenance Details for symphony_dt-2.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for symphony-dt 2.1.1
File Interpreter ABI Platform Actions
symphony_dt-2.1.1-py3-none-any.whl Python 3 none any Details for symphony_dt-2.1.1-py3-none-any.whl

Total release size: 462.0 kB

Release files / symphony_dt-2.1.1.tar.gz

Download URL symphony_dt-2.1.1.tar.gz
Size 291.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6a894bd46cc8ba3b1ea08a5f72789f7039f72f1ca8e1a7d4cfaa519f3dbdae04
BLAKE2b-256 checksum
How to use checksums
83fdb73f06050d42c50a47e726620753cfe6e2b04f7396474ac69aa06a4105dc
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 7, 2026.

Transparency log

Release files / symphony_dt-2.1.1-py3-none-any.whl

Download URL symphony_dt-2.1.1-py3-none-any.whl
Size 171.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cb23365b02916a0d74b566584b34250a39e91d7978ffb7795bf8c9200c538049
BLAKE2b-256 checksum
How to use checksums
d336a58cacbb5e0fd919bcd5c78ca4cd61fd1b179086581ad64a090cc408429b
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 7, 2026.

Transparency log

Security for symphony-dt 2.1.1

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 symphony_dt-2.1.1.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 7, 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