Ludvig Jakobsson 1,2,3, Marcus Baaz 1, Jacob Leander 3, Philip Gerlee 2, Mats Jirstrand 1,4
1 Fraunhofer-Chalmers Research Centre for Industrial Mathematics (Gothenburg, Sweden), 2 Department of Mathematical Sciences, Chalmers University of Technology and University of Gothenburg (Gothenburg, Sweden), 3 Clinical Pharmacology and Quantitative Pharmacology, Clinical Pharmacology and Safety Sciences, R&D, AstraZeneca (Gothenburg, Sweden), 4 Department of Electrical Engineering, Chalmers University of Technology (Gothenburg, Sweden)
Objectives
Lung function of people with asthma fluctuates substantially over time, and increased variability has been linked to elevated risk of worsening events called exacerbations [1,2]. Although home-measured peak expiratory flow (PEF) can provide richer temporal information than in-clinic measurements, its irregular dynamics makes it difficult to analyse using conventional modelling approaches. We explore a modelling strategy that treats PEF patterns as transitions between latent disease states, using a mixed-effects hidden Markov model (MEHMM) [3] to capture both between-patient heterogeneity and state-dependent changes in disease severity. Parameter estimation relies on a modified version [4] of the stochastic approximation expectation–maximization (SAEM) algorithm, adapted for hidden Markov models. This approach aims to extract treatment effects directly from underlying state dynamics, and we evaluate its feasibility and robustness through a simulation study as well as its application to phase 2b clinical trial data.
Implementation objectives
– To develop a custom R implementation of a modified SAEM algorithm for handling observations from an MEHMM
Methodological objectives
– To evaluate the accuracy of model inference in a two-state MEHMM using home-measured spirometry and the modified SAEM algorithm
Application objectives
– To model home-measured PEF in patients with asthma using an MEHMM
– To identify and quantify treatment effects related to the latent state dynamics
Methods
We used data from a phase 2b dose-finding study (NCT03622112) of velsecorat in patients with asthma to develop the model. The study included five active treatment arms and placebo, with twice-daily home-measured spirometry collected over 12 weeks. Additional datasets were simulated from successive model variants to better understand specific aspects and complexities of the model.
The resulting model is an MEHMM with two latent disease states representing sustained periods of high and low PEF. The observations were modeled using a Gaussian process with state-dependent mean. All model parameters, including the mean PEF levels, within-state variability, and state-transition probabilities, were in turn modeled with fixed and random effects to capture both directly observed as well as unobserved heterogeneity.
Implementation in R
We developed an implementation of the modified SAEM algorithm for handling MEHMMs in R. The code is publicly available on GitHub and features functions for simulation, parameter estimation, standard error calculation, likelihood estimation, and related functionality.
Simulation study
A simulation study was performed to determine the validity of the estimates obtained from the modified SAEM algorithm, to refine the algorithm settings, and to investigate scenarios such as varying time-series lengths. Datasets were simulated from the MEHMM with known population-level parameters and subsequently analysed in the estimation algorithm. The obtained population-level estimates were assessed in terms of bias and variance. The inferred latent state sequences for each subject were evaluated by confusion matrices. Empirical Bayes Estimates (EBEs) were compared to the true subject-specific parameters and evaluated on the population level using eta-shrinkage.
Application to phase 2b data
The MEHMM was applied to the phase 2b study in two stages. First, an exploratory analysis was conducted with categorical treatment indicators for each dose. Nonsignificant treatment effects were subsequently removed to obtain a more parsimonious model. Second, a dose-response analysis was performed by modelling the remaining treatment effects with parametric relationships. The final model was compared to alternative models using predictive accuracy, Akaike’s information criteria (AIC), and by inspection of the EBEs.
Results
Simulation study
Population parameter recovery in the simulation study was strong (mean absolute relative bias = 1.56%) and the standard errors reflected the variability of estimates obtained from repeated simulation of datasets with coverage of 95% CIs ranging between 91%-97%. Further, the sum of the diagonal of the mean confusion matrix, which represents the fraction of correctly estimated latent states, was 98.9%. Finally, the EBEs were found to reflect the true subject-specific parameters well, but some shrinkage was observed (ranging 2%-45%).
Application to phase 2b data
Several treatment groups showed statistically significant effects versus placebo for state-transition probabilities, severity of the low-PEF state, and within-state variability. All these effects were consistent with the expected direction, reflecting improved disease control through faster recovery from low PEF, less severe low-PEF episodes, and reduced variability within both states. Specifically, the highest treatment dose increased the probability of transitioning from low to high PEF by 87% (placebo: 0.023 [0.017, 0.031] vs treatment: 0.043 [0.037, 0.050]), decreased the relative drop from high to low PEF by 17% (placebo: 0.879 [0.863, 0.893] vs treatment: 0.900 [0.895, 0.905]), and decreased the within-state standard deviation by 17% (placebo: 30.5 [28.4, 32.8] vs treatment: 25.4 [24.5, 27.4]).
In the dose-response analysis of these effects, Emax-expressions were used for the within-state variability and state transition probability, for which there were clear signs of saturation in the higher dose range. For the low-PEF severity, a constant treatment effect across all active doses was sufficient, as higher doses did not produce an additional effect. The resulting dose-response curves reproduced the categorical estimates closely and with reduced uncertainty. However, the ED50 estimates for the within-state variability and transition probability were associated with relatively large standard errors (log(ED50) 95% CI = [3.11, 4.51] and [4.08, 5.99], respectively), reflecting limited information about the steep part of the dose-response curve. This final model achieved the lowest AIC, improving by 39 points compared to a model without treatment effects and by 38 points compared to a model with categorical treatment arms, indicating successful model reduction without loss of explanatory power.
Conclusion
This work demonstrates that mixed-effects hidden Markov modelling can reveal treatment effects embedded in the latent dynamics of home-measured PEF. The approach performed well for both clinical data and in controlled simulations, providing accurate parameter estimates, robust state classification, and clear identification of treatment effects. Overall, the model offers a promising direction for improving treatment detection in early-stage asthma trials and for making fuller use of high-resolution home-measured spirometry data.
References:
References
1. Frey U, Brodbeck T, Majumdar A, Robin Taylor D, Ian Town G, Silverman M, et al. Risk of severe asthma episodes predicted from fluctuation analysis of airway function. Nature. 2005 Dec;438(7068):667–70.
2. Leander J, Jirstrand M, Eriksson UG, Palmér R. A stochastic mixed effects model to assess treatment effects and fluctuations in home‐measured peak expiratory flow and the association with exacerbation risk in asthma. CPT Pharmacom & Syst Pharma. 2022 Feb;11(2):212–24.
3. Altman RM. Mixed Hidden Markov Models: An Extension of the Hidden Markov Model to the Longitudinal Data Setting. Journal of the American Statistical Association. 2007 Mar;102(477):201–10.
4. Delattre M, Lavielle M. Maximum likelihood estimation in discrete mixed hidden Markov models using the SAEM algorithm. Computational Statistics & Data Analysis. 2012 Jun;56(6):2073–85.
Reference: PAGE 34 (2026) Abstr 11982 [www.page-meeting.org/?abstract=11982]
Poster: Oral: Lewis Sheiner