SearcharxivSearch

arXiv subjects

Jan Hasenauer

Publications and source records attributed to Jan Hasenauer.

At least 19 recordsLinked to original sources

PEtab SciML: an exchange format for specifying and training dynamic scientific machine learning models

Summary: Dynamic scientific machine learning (SciML) models that combine mechanistic ordinary differential equations (ODEs) with machine learning (ML) components have applications ranging from learning unknown biological processes to integrating auxiliary data modalities into dynamic modelling. To enable reproducible and efficient SciML training, we introduce PEtab SciML, an interoperable data format for specifying parameter estimation problems in which mechanistic and ML model parameters are jointly estimated from time series data. PEtab SciML supports several ML ODE hybridization patterns in realistic problem setups. It is accompanied by a reference Python library and downstream modelling support in Python/JAX and Julia, provided by AMICI and PEtab$.$jl, respectively, and a collection of real data benchmarks. Availability and implementation: PEtab SciML is available on GitHub (https://github.com/PEtab-dev/petab_sciml). The reference Python package is installable from PyPI and is continuously tested and supported on Linux, macOS, and Windows.

q-bio.QM

Large language models as synthetic clinical experts to inform longitudinal rare-disease modeling

Due to the limited amount of information, modeling longitudinal rare-disease data can benefit from integrating clinical knowledge. Yet, elicitation of expert knowledge and formalization for model fitting is challenging, in particular due to limited time of clinical experts. To nevertheless make domain knowledge accessible during model fitting, we use large language models (LLMs) as synthetic clinical experts to supervise a variational-autoencoder-based approach that learns low-dimensional latent summaries of visit-level observations. Specifically, LLMs are queried offline on textual descriptions of patient observations to obtain judgments, e.g., the suspected clinical category. To improve the variational autoencoder fit, we train a differentiable surrogate model on these judgments and augment the loss function to encourage reconstructions that preserve the clinical-label distribution of their corresponding input profile. In an application to longitudinal motor-function assessments from children with spinal muscular atrophy, we map visit-level clinical profiles to low-dimensional representations that are linked by a multivariate mixed-effects model. The synthetic expert loss discourages reconstructions that remain numerically close in data space but alter the clinical interpretation of the reconstructed motor function profile, such as by crossing a disease-type boundary. We thus reduced disagreement between original and reconstructed SMA type labels from about 11 to 7 percent. Furthermore, informing the latent representation by the synthetic expert improved prediction of motor function milestones compared with unsupervised latent representations and a data-level baseline. These results suggest that incorporating LLMs into model fitting can make clinical knowledge available to representation learning and improve clinical faithfulness for longitudinal rare-disease data.

cs.AI

NoLimits.jl: Flexible and Composable Nonlinear Mixed-Effects Modeling in Julia

Nonlinear mixed-effects models are widely used to analyze longitudinal data, but existing open-source software often supports only a limited subset of the model structures, inference methods, machine-learning components, automatic differentiation techniques, and random-effects distributions required in modern applications. We introduce NoLimits.jl, an open-source Julia package for flexible and composable nonlinear mixed-effects modeling. Its macro-based modeling language enables observation and latent-state models to be constructed from diverse building blocks, including ordinary differential equations, Markov models, and neural networks. NoLimits.jl supports flexible, covariate-dependent observation and random-effects distributions and provides a unified interface to frequentist inference through Laplace approximation, stochastic expectation maximization, and Bayesian Markov chain Monte Carlo methods. We demonstrate the package on three case studies showcasing its workflows, integration of differentiable machine-learning components, and data-driven estimation of random-effects distributions using normalizing flows. Together, these capabilities substantially expand the range of nonlinear mixed-effects models that can be specified, estimated, and compared within a single open-source framework.

stat.CO

Typical Healthcare Pathways as a Basis for Admixture Modeling of Patient Trajectories

Background: Understanding whether patients follow similar or distinct patterns of care is important for characterizing clinical practice, identifying patient subgroups, and supporting quality improvement. However, routine healthcare trajectories are difficult to compare directly because patients may differ in their diagnostic workup, treatment sequencing, timing of clinical events, and documentation practices. Despite this variation, trajectories often contain recurring patterns at the cohort level. Methods: To address this challenge, we present a framework that explicitly separates cohort-level typical pathway identification from patient-level inference. At the cohort level, we derive an interpretable representation of care processes using a rule-based algorithm to identify typical healthcare pathways, resulting in a compact pathway graph. These pathways are then modeled as Markov chains and used as structured components in an admixture model, allowing each patient to be represented as a probabilistic mixture of typical pathways rather than being assigned to a single pathway component. The resulting admixture weights provide a compact representation of patient trajectories for subgroup characterization. We further assess the stability of the identified pathways and inferred admixture representations across multiple train-test splits. Results: Across train-test splits, the framework demonstrated consistent pathway structures and patient-level mixture patterns. Applied to routine care data from prostate cancer patients undergoing radical prostatectomy, the framework identified interpretable care patterns and supported the identification of patient subgroups with similar clinical event patterns. Conclusion: Overall, the proposed framework provides an interpretable and stable approach for summarizing treatment pathways and characterizing patient subgroups in real-world practice.

stat.ME

Balancing label resolution and computational cost in dynamical models of lipid metabolism

Lipid metabolism is a central biological process that is commonly studied using destructive mass-spectrometry experiments. A recently proposed strategy, uses multiple labels to extract temporal information about lipid metabolism from a single destructive measurement. However, the computational complexity of the model-based data analysis increases rapidly with the number of labels, creating a fundamental trade-off between the information content of the measurements and the cost of analysis. Here, we examine how the number of modelled labels affects parameter estimation accuracy, trajectory recovery, and computational cost, and whether modelling fewer labels than are experimentally available can mitigate this trade-off. Using synthetic data from a five-label experiment, we find that modelling three of the five labels provides a practical balance between experimental feasibility, inferential power, and computational tractability. In an application to hepatocyte triglyceride cycling, we further show that the most cost-efficient, single-label model can yield biologically implausible predictions for unobserved species, whereas models that resolve more labels better constrain these latent dynamics. These results provide practical guidance for selecting model resolution in multi-label experiments and establish a quantitative basis for balancing inferential power against computational cost.

q-bio.QM

Overcoming Selection Bias in Statistical Studies With Amortized Bayesian Inference

Selection bias arises when the probability that an observation enters a dataset depends on variables related to the quantities of interest, leading to systematic distortions in estimation and uncertainty quantification. For example, in epidemiological or survey settings, individuals with certain outcomes may be more likely to be included, resulting in biased prevalence estimates with potentially substantial downstream impact. Classical corrections, such as inverse-probability weighting or explicit likelihood-based models of the selection process, rely on tractable likelihoods, which limits their applicability in complex stochastic models with latent dynamics or high-dimensional structure. Simulation-based inference enables Bayesian analysis without tractable likelihoods but typically assumes missingness at random and thus fails when selection depends on unobserved outcomes or covariates. Here, we develop a bias-aware simulation-based inference framework that explicitly incorporates selection into neural posterior estimation. By embedding the selection mechanism directly into the generative simulator, the approach enables amortized Bayesian inference without requiring tractable likelihoods. This recasting of selection bias as part of the simulation process allows us to both obtain debiased estimates and explicitly test for the presence of bias. The framework integrates diagnostics to detect discrepancies between simulated and observed data and to assess posterior calibration. The method recovers well-calibrated posterior distributions across three statistical applications with diverse selection mechanisms, including settings in which likelihood-based approaches yield biased estimates. These results recast the correction of selection bias as a simulation problem and establish simulation-based inference as a practical and testable strategy for parameter estimation under selection bias.

stat.ML

Efficient numerical computation of traveler states in explicit mobility-based metapopulation models: Mathematical theory and application to epidemics

Metapopulation models are powerful tools for capturing the spatio-temporal spread of infectious diseases. Models that explicitly account for traveler origins and destinations, such as Lagrangian metapopulation models, enable a detailed representation of mobility and traveling subpopulations. However, in densely connected networks, tracking these subpopulations leads to quadratic growth in system size with the number of spatial patches. While specific approaches reducing the effort of traveler state estimation have been proposed, these approaches are either model-specific or heuristic. Here, we introduce a Runge-Kutta (RK) stage-aligned computation of traveler states that leverages the precomputed intermediate stage values of explicit RK methods under the assumption of localized homogeneous mixing. We prove that the resulting numerical solution is identical to that of the standard Lagrangian formulation when solved with the corresponding RK method. For compartments without inflows, we further show that the exact same results can be obtained using a simple algebraic scaling based on the initial traveler share. When embedded in a recently proposed metapopulation framework that combines local dynamics with discrete mobility, the stage-aligned approach eliminates the need for heuristic traveler approximations. In contrast to the standard Lagrangian formulation, the resulting method enables efficient simulations by reducing the global ODE system to linear scaling in the number of patches, while the remaining quadratic interactions are handled through highly efficient algebraic updates. Numerical experiments confirm the theoretical results, demonstrating optimal convergence order. Benchmarks on fully connected networks with up to 1025 patches, 1024 local travel connections, and six age groups achieve speedups of up to 76 and 50 for first- and fourth-order Runge-Kutta methods, respectively.

math.NA

MEmilio -- A high performance Modular EpideMIcs simuLatIOn software for multi-scale and comparative simulations of infectious disease dynamics

Epidemic and pandemic preparedness with rapid outbreak response rely on timely, trustworthy evidence. Mathematical models are crucial for supporting timely and reliable evidence generation for public health decision-making with models spanning approaches from compartmental and metapopulation models to detailed agent-based simulations. Yet, the accompanying software ecosystem remains fragmented across model types, spatial resolutions, and computational targets, making models harder to compare, extend, and deploy at scale. Here we present MEmilio, a modular, high-performance framework for epidemic simulation that harmonizes the specification and execution of diverse dynamic epidemiological models within a unified and harmonized architecture. MEmilio couples an efficient C++ simulation core with coherent model descriptions and a user-friendly Python interface, enabling workflows that run on laptops as well as high-performance computing systems. Standardized representations of space, demography, and mobility support straightforward adaptations in resolution and population size, facilitating systematic inter-model comparisons and ensemble studies. The framework integrates readily with established tools for uncertainty quantification and parameter inference, supporting a broad range of applications from scenario exploration to calibration. Finally, strict software-engineering practices, including extensive unit and continuous integration testing, promote robustness and minimize the risk of errors as the framework evolves. By unifying implementations across modeling paradigms, MEmilio aims to lower barriers to reuse and generalize models, enable principled comparisons of implicit assumptions, and accelerate the development of novel approaches that strengthen modeling-based outbreak preparedness.

q-bio.PE

Diffusion Models in Simulation-Based Inference: A Tutorial Review

Diffusion models have recently emerged as powerful learners for simulation-based inference (SBI), enabling fast and accurate estimation of latent parameters from simulated and real data. Their score-based formulation offers a flexible way to learn conditional or joint distributions over parameters and observations, thereby providing a versatile solution to various modeling problems. In this tutorial review, we synthesize recent developments on diffusion models for SBI, covering design choices for training, inference, and evaluation. We highlight opportunities created by various concepts such as guidance, score composition, flow matching, consistency models, and joint modeling. Furthermore, we discuss how efficiency and statistical accuracy are affected by noise schedules, parameterizations, and samplers. Finally, we illustrate these concepts with case studies across parameter dimensionalities, simulation budgets, and model types, and outline open questions for future research.

stat.ML

Scalable branch-and-bound model selection with non-monotonic criteria including AIC, BIC and Mallows's $\mathit{C_p}$

Model selection is a pivotal process in the quantitative sciences, where researchers must navigate between numerous candidate models of varying complexity. Traditional information criteria, such as the corrected Akaike Information Criterion (AICc), Bayesian Information Criterion (BIC), and Mallows's $\mathit{C_p}$, are valuable tools for identifying optimal models. However, the exponential increase in candidate models with each additional model parameter renders the evaluation of these criteria for all models -- a strategy known as exhaustive, or brute-force, searches -- computationally prohibitive. Consequently, heuristic approaches like stepwise regression are commonly employed, albeit without guarantees of finding the globally-optimal model. In this study, we challenge the prevailing notion that non-monotonicity in information criteria precludes bounds on the search space. We introduce a simple but novel bound that enables the development of branch-and-bound algorithms tailored for these non-monotonic functions. We demonstrate that our approach guarantees identification of the optimal model(s) across diverse model classes, sizes, and applications, often with orders of magnitude computational speedups. For instance, in one previously-published model selection task involving $2^{32}$ (approximately 4 billion) candidate models, our method achieves a computational speedup exceeding 6,000. These findings have broad implications for the scalability and effectiveness of model selection in complex scientific domains.

q-bio.QM

Assessment of Simulation-based Inference Methods for Stochastic Compartmental Models in Epidemiological Research

Global pandemics, such as the recent COVID-19 crisis, highlight the need for stochastic epidemic models that can capture the randomness inherent in the spread of disease. Such models must be accompanied by methods for estimating parameters in order to generate fast nowcasts and short-term forecasts that can inform public health decisions. This paper presents a comparison of two advanced Bayesian inference methods: 1) pseudo-marginal particle Markov chain Monte Carlo, using an unbiased likelihood estimate obtained by Particle Filter (PF), and 2) Conditional Normalizing Flows (CNF). We investigate their performance on three commonly used compartmental models: A classical Susceptible-Infected-Susceptible (SIS), a Susceptible-Infected-Recovered (SIR) model and a two-variant Susceptible-Exposed-Infected-Recovered (SEIR) model, complemented by an observation model that maps latent trajectories to empirical data. Addressing the challenges of intractable likelihoods for parameter inference in stochastic settings, our analysis highlights how these likelihood-free methods provide accurate and robust inference capabilities. The results of our simulation study further underscore the effectiveness of these approaches in capturing the stochastic dynamics of epidemics, providing prediction capabilities for the control of epidemic outbreaks. Results on an Ethiopian cohort study demonstrate operational robustness under real-world noise and irregular data sampling. To facilitate reuse and to enable building pipelines that ultimately contribute to better informed decision making in public health, we make code and synthetic datasets publicly available.

q-bio.QM

PEtab-GUI: A graphical user interface to create, edit and inspect PEtab parameter estimation problems

Motivation: Parameter estimation is a cornerstone of data-driven modeling in systems biology. Yet, constructing such problems in a reproducible and accessible manner remains challenging. The PEtab format has established itself as a powerful community standard to encode parameter estimation problems, promoting interoperability and reusability. However, its reliance on multiple interlinked files - often edited manually - can introduce inconsistencies, and new users often struggle to navigate them. Here, we present PEtab-GUI, an open-source Python application designed to streamline the creation, editing, and validation of PEtab problems through an intuitive graphical user interface. PEtab-GUI integrates all PEtab components, including SBML models and tabular files, into a single environment with live error-checking and customizable defaults. Interactive visualization and simulation capabilities enable users to inspect the relationship between the model and the data. PEtab-GUI lowers the barrier to entry for specifying standardized parameter estimation problems, making dynamic modeling more accessible, especially in educational and interdisciplinary settings. Availability and Implementation: PEtab-GUI is implemented in Python, open-source under a 3-Clause BSD license. The code, designed to be modular and extensible, is hosted on https://github.com/PEtab-dev/PEtab-GUI and can be installed from PyPI. Key words: Parameter Estimation, Python, Graphical User Interface, Systems Biology

q-bio.QM

Using latent representations to link disjoint longitudinal data for mixed-effects regression

Many rare diseases offer limited established treatment options, leading patients to switch therapies when new medications emerge. To analyze the impact of such treatment switches within the low sample size limitations of rare disease trials, it is important to use all available data sources. This, however, is complicated when usage of measurement instruments change during the observation period, for example when instruments are adapted to specific age ranges. The resulting disjoint longitudinal data trajectories, complicate the application of traditional modeling approaches like mixed-effects regression. We tackle this by mapping observations of each instrument to a aligned low-dimensional temporal trajectory, enabling longitudinal modeling across instruments. Specifically, we employ a set of variational autoencoder architectures to embed item values into a shared latent space for each time point. Temporal disease dynamics and treatment switch effects are then captured through a mixed-effects regression model applied to latent representations. To enable statistical inference, we present a novel statistical testing approach that accounts for the joint parameter estimation of mixed-effects regression and variational autoencoders. The methodology is applied to quantify the impact of treatment switches for patients with spinal muscular atrophy. Here, our approach aligns motor performance items from different measurement instruments for mixed-effects regression and maps estimated effects back to the observed item level to quantify the treatment switch effect. Our approach allows for model selection as well as for assessing effects of treatment switching. The results highlight the potential of modeling in joint latent representations for addressing small data challenges.

stat.ML

Compositional amortized inference for large-scale hierarchical Bayesian models

Amortized Bayesian inference (ABI) with neural networks has emerged as a powerful simulation-based approach for estimating complex mechanistic models. However, extending ABI to hierarchical models, a cornerstone of modern Bayesian analysis, has been a major hurdle due to the need to simulate and process massive datasets. Our study tackles these challenges by extending compositional score matching (CSM), a divide-and-conquer strategy for Bayesian updating using diffusion models. We develop a new error-damping estimator to address previous stability issues of CSM when aggregating large numbers of data points. We first verified the numerical stability with up to 100,000 data points on a controlled benchmark. We then evaluated our method on a hierarchical AR model, achieving competitive performance to direct ABI baselines on smaller problem sizes while using less than one full model simulation for larger problem sizes. Finally, we address a large-scale inverse problem in advanced microscopy with over 750,000 parameters, demonstrating its relevance to real scientific applications.

q-bio.QM

Non-Negative Universal Differential Equations With Applications in Systems Biology

Universal differential equations (UDEs) leverage the respective advantages of mechanistic models and artificial neural networks and combine them into one dynamic model. However, these hybrid models can suffer from unrealistic solutions, such as negative values for biochemical quantities. We present non-negative UDE (nUDEs), a constrained UDE variant that guarantees non-negative values. Furthermore, we explore regularisation techniques to improve generalisation and interpretability of UDEs.

q-bio.QM

Assessment of Uncertainty Quantification in Universal Differential Equations

Scientific Machine Learning is a new class of approaches that integrate physical knowledge and mechanistic models with data-driven techniques for uncovering governing equations of complex processes. Among the available approaches, Universal Differential Equations (UDEs) are used to combine prior knowledge in the form of mechanistic formulations with universal function approximators, like neural networks. Integral to the efficacy of UDEs is the joint estimation of parameters within mechanistic formulations and the universal function approximators using empirical data. The robustness and applicability of resultant models, however, hinge upon the rigorous quantification of uncertainties associated with these parameters, as well as the predictive capabilities of the overall model or its constituent components. With this work, we provide a formalisation of uncertainty quantification (UQ) for UDEs and investigate important frequentist and Bayesian methods. By analysing three synthetic examples of varying complexity, we evaluate the validity and efficiency of ensembles, variational inference and Markov chain Monte Carlo sampling as epistemic UQ methods for UDEs.

stat.ML

Exploration of methods for computing sensitivities in ODE models at dynamic and steady states

Estimating parameters of dynamic models from experimental data is a challenging, and often computationally-demanding task. It requires a large number of model simulations and objective function gradient computations, if gradient-based optimization is used. The gradient depends on derivatives of the state variables with respect to parameters, also called state sensitivities, which are expensive to compute. In many cases, steady-state computation is a part of model simulation, either due to steady-state data or an assumption that the system is at steady state at the initial time point. Various methods are available for steady-state and gradient computation. Yet, the most efficient pair of methods (one for steady states, one for gradients) for a particular model is often not clear. Moreover, depending on the model and the available data, some methods may not be applicable or sufficiently robust. In order to facilitate the selection of methods, we explore six method pairs for computing the steady state and sensitivities at steady state using six real-world problems. The method pairs involve numerical integration or Newton's method to compute the steady-state, and -- for both forward and adjoint sensitivity analysis -- numerical integration or a tailored method to compute the sensitivities at steady-state. Our evaluation shows that the two method pairs that combine numerical integration for the steady-state with a tailored method for the sensitivities at steady-state were the most robust, and amongst the most computationally-efficient. We also observed that while Newton's method for steady-state computation yields a substantial speedup compared to numerical integration, it may lead to a large number of simulation failures. Overall, our study provides a concise overview across current methods for computing sensitivities at steady state, guiding modelers to choose the right methods.

q-bio.QM

pyPESTO: A modular and scalable tool for parameter estimation for dynamic models

Mechanistic models are important tools to describe and understand biological processes. However, they typically rely on unknown parameters, the estimation of which can be challenging for large and complex systems. We present pyPESTO, a modular framework for systematic parameter estimation, with scalable algorithms for optimization and uncertainty quantification. While tailored to ordinary differential equation problems, pyPESTO is broadly applicable to black-box parameter estimation problems. Besides own implementations, it provides a unified interface to various popular simulation and inference methods. pyPESTO is implemented in Python, open-source under a 3-Clause BSD license. Code and documentation are available on GitHub (https://github.com/icb-dcm/pypesto).

q-bio.QM