Bayesian hierarchical state-space digital twins for longitudinal clinical cohorts.
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 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
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
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.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| symphony_dt-2.1.0.tar.gz | 289.7 kB | With provenance | Details for symphony_dt-2.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| symphony_dt-2.1.0-py3-none-any.whl | Python 3 | none | any | Details for symphony_dt-2.1.0-py3-none-any.whl |
Total release size: 460.2 kB
Release files / symphony_dt-2.1.0.tar.gz
| Download URL | symphony_dt-2.1.0.tar.gz |
|---|---|
| Size | 289.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0d879b98d1f5535839d6c6087e07d1581a7967d87e19ff4d4c43536502a61853
|
|
BLAKE2b-256 checksum How to use checksums |
72f0f913a97595004dcc001e06080504f48f18f57fdaab14e3eb2bb8180b9e5f
|
| 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 6, 2026.
Transparency logRelease files / symphony_dt-2.1.0-py3-none-any.whl
| Download URL | symphony_dt-2.1.0-py3-none-any.whl |
|---|---|
| Size | 170.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
98534450859363862218d52c23e58632ceed9e5bfec1886c022e263155b5ec8f
|
|
BLAKE2b-256 checksum How to use checksums |
8346f5dd9af6f8b7e3e63104ef3a10d710889329ffaef04c07a6aa278c4c0d45
|
| 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 6, 2026.
Transparency logSecurity for symphony-dt 2.1.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.
Attestation for symphony_dt-2.1.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 6, 2026.
Transparency logA 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.