Abstract: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.



Abstract: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.