Manuscript Offprint

arXiv:2611.07937

Joint Modeling of Conditional Mean and Variability in Multilevel Functional Data: Application to Postprandial Glucose Trajectories in the AEGIS Study

Yang Xiao, Francisco Gude, Marcos Matabuena

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Functional data analysis (FDA) regression models provide a natural analytical framework for quantifying time-varying associations between Euclidean predictors and high-frequency biological signals (e.g., minute-by-minute physical activity measurements and glucose trajectories). In digital health applications, multiple functional trajectories are often collected from each participant. Existing multilevel functional regression methods primarily focus on modeling the conditional mean as a function of individual-level covariates (e.g., age, body mass index, and demographic characteristics), whereas conditional variability has received comparatively little attention, despite its importance for understanding biological processes and characterizing individual heterogeneity. To address this gap, we introduce, to the best of our knowledge, the first heteroskedastic functional mixed-effects regression framework that jointly models the conditional mean and variance of repeated functional observations while incorporating participant-specific random effects in both components. This framework enables the simultaneous characterization of time-varying biological responses and their variability, capturing dimensions of individual heterogeneity that conventional multilevel functional regression models cannot adequately represent. We further develop a participant-level bootstrap procedure to quantify uncertainty in the estimated functional parameters. We apply the proposed framework to postprandial glucose trajectories from the AEGIS study, revealing clinically relevant patterns of time-varying variability that are overlooked by conventional analyses focusing primarily on mean glucose responses. In this general adult population, premeal glucose levels, carbohydrate intake, and meal type exhibit distinct time-dependent associations with postprandial glucose variability, whereas glycated hemoglobin (HbA1c) shows a comparatively weaker association with variability despite retaining its association with the conditional mean. We also identify substantial between-participant heterogeneity in residual variability, even among individuals with similar observed covariates, highlighting dimensions of biological heterogeneity that cannot be adequately characterized through conditional mean models alone. Overall, our findings establish heteroskedastic functional mixed-effects regression as a flexible framework for jointly characterizing the conditional mean, variability, and participant-specific heterogeneity of longitudinal biological signals, with important implications for personalized modeling in digital health and precision nutrition in the analyzed case study.

1 Introduction

The ongoing revolution in biological measurement technologies is enabling the collection of multiple high-frequency time series of physiological variables, such as glucose levels and heart rate, on different time scales, with the potential to accelerate scientific discovery and improve clinical decision making. Matabuena et al. (2023). A key feature of these modern datasets is that devices record observations every few seconds or minutes; these time-stamped measurements can be naturally represented as a mathematical function over time. Because individuals are typically monitored repeatedly (e.g., across days or other time periods), the resulting data structure collected is functional and multilevel (hierarchical) Matabuena and Crainiceanu (2026). To emphasize this structure, Figure 1 displays, for two participants in the AEGIS study, glucose trajectories after breakfast, lunch and dinner, recorded every five minutes on five days, together with the corresponding fitted mean curves and gaussian assympotic prediction bands. The plots of individual glucose trajectories show substantial heterogeneity both within and between individuals across meals and over days, underscoring the importance of multilevel random-effects models that capture individual variation specific to the time after a meal for personalized prediction.

In digital health applications, multilevel functional models are increasingly used to analyze high-frequency measurements of functional biomarkers. When individual-level covariate information is not available and only repeated functional trajectories are observed, the prevailing approach is multilevel functional principal component analysis (MFPCA) (Di et al., 2009). MFPCA has been developed for a wide range of hierarchical designs and estimation paradigms (Crainiceanu et al., 2024), and recent work has introduced computationally efficient algorithms for both Gaussian and non-Gaussian functional outcomes (Cui et al., 2023; Leroux et al., 2023).

When individual-level covariate information is available (e.g. demographic and anthropometric measures), a range of frequentist and Bayesian functional regression methods have been proposed to model the conditional mean function (Morris and Carroll, 2006; Greven and Scheipl, 2017). Scalable implementations for large cohorts, such as NHANES, have also emerged (Cui et al., 2022; Sun and Kowal, 2025). These often rely on a “mass-univariate-then-smooth” pipeline: separate univariate models are fitted at each time point on the functional grid and the resulting coefficient estimates are then smoothed over time to enforce temporal regularity and improve statistical inference. Because each time point can be modeled independently, this strategy is naturally parallelizable and scales well in large epidemiological studies—for example, minute-by-minute accelerometer-derived physical activity signals collected from about 100,000 participants in the UK Biobank.

Despite substantial progress in multilevel functional modeling, most multilevel functional regression methods target only the conditional mean, leaving other distributional features, such as the conditional variance, largely unmodeled. Approaches that capture temporal structure in conditional variability are still scarce (Backenroth et al., 2018; Stöcker et al., 2021), although variability is key for characterizing individual heterogeneity and for designing temporally targeted digital health interventions (e.g., chronobiologically personalized interventions). For scalar repeated measurements, mixed-effects location-scale models allow covariates and subject-specific random effects to influence both the conditional mean and within-subject variance (Hedeker et al., 2008; Hedeker and Nordgren, 2013). Subsequent developments have extended these models to nonlinear learning curves (Williams et al., 2019) and dyadic data (Rast and Ferrer, 2018), while recent computational advances have enabled more efficient estimation (Gill and Hedeker, 2023; Wu and Hedeker, 2026). However, these approaches are designed for scalar responses and do not directly accommodate the functional structure of repeated trajectories, where both the conditional mean and variability may evolve continuously over time. To address this limitation, we propose a joint multilevel functional location-scale model that simultaneously estimates covariate-dependent mean and variance functions, enabling the characterization of time-varying biological responses and their heterogeneity across individuals.

Why variability matters. Understanding biological variability is essential for elucidating physiological mechanisms, characterizing individual heterogeneity, and informing the development of personalized, time-dependent interventions. Across clinical domains, variability provides information beyond average responses. In oncology, variability patterns have been used to characterize tumor heterogeneity and identify clinically relevant subtypes (Chen et al., 2013); in diabetes, glucose variability complements mean glucose as an indicator of glycemic regulation and metabolic instability (Rodbard, 2018); and in physical activity, temporal variability has been associated with circadian organization and age (Xiao et al., 2015; Li et al., 2021). Despite its clinical relevance, biological variability is frequently summarized using scalar measures, such as daily standard deviations (Rodbard, 2018), which obscure how variability evolves throughout the day or in response to specific physiological stimuli. This limitation is particularly relevant for high-frequency biological signals, such as continuous glucose monitoring (CGM) trajectories, where both the magnitude and timing of variability may carry important physiological information. For example, two individuals may exhibit similar average postprandial glucose responses but differ substantially in the day-to-day variability of their glucose trajectories, with these differences changing over the postprandial period (Figure 1). Characterizing such heterogeneity requires moving beyond conditional mean regression to explicitly model the conditional variance as a function of time and individual-level covariates, thereby capturing aspects of biological regulation that conventional summary measures may overlook.

AEGIS motivation. Our methodological development is motivated by the need to characterize time-dependent variability in postprandial glucose responses among adults without diabetes, using continuous glucose monitoring (CGM) data from the AEGIS study (Gude et al., 2017; Calvo-Malvar et al., 2025), while accounting for individual characteristics and meal composition. Postprandial glucose regulation reflects complex interactions among dietary composition, insulin sensitivity, pancreatic beta-cell function, and other physiological processes. Large-scale studies have documented substantial interindividual heterogeneity in glycemic responses to identical meals, providing a

Figure

Figure 1: Postprandial glucose trajectories of two AEGIS participants after breakfast, lunch and dinner on five study days (D1–D5), on a five-minute grid from the start of each meal. Solid lines are the observed glucose and dashed lines the participant's fitted mean for that meal. Shading is an approximate pointwise 95% prediction band with asymptotic approximation, the fitted mean ±1.96 times the fitted residual standard deviation; crosses mark observations outside it.

scientific basis for personalized nutrition approaches (Zeevi et al., 2015; Berry et al., 2020). More recently, detailed metabolic phenotyping has demonstrated that individual responses to different carbohydrate-rich foods are associated with underlying metabolic characteristics, including insulin resistance and beta-cell dysfunction (Wu et al., 2025). However, considerable variability may also arise within the same individual across repeated exposures to similar meals. Recent evidence has highlighted the limited reproducibility of postprandial glycemic responses to duplicate meals, raising questions about the reliability of personalized dietary recommendations derived from a small number of CGM observations (Hengist et al., 2025). Together, these findings motivate statistical approaches that distinguish expected postprandial glucose responses from their within-individual variability, while accounting for individual metabolic characteristics and differences in meal composition.

Although glycemic variability is increasingly recognized as an important dimension of glucose regulation, clinical assessments commonly rely on scalar summaries, such as the coefficient of variation and time-in-range metrics (Battelino et al., 2019). While these measures provide useful information about overall glycemic patterns, they do not directly characterize how the conditional variability of repeated postprandial trajectories evolves over the period following a meal. Functional data analysis (FDA) offers a natural framework for studying high-resolution glucose trajectories (Gaynanova et al., 2022), and previous analyses of AEGIS postprandial responses have employed multilevel functional regression to investigate associations with individual and meal characteristics (Calvo-Malvar et al., 2025; Matabuena et al., 2026). However, existing approaches have primarily focused on conditional mean responses or summarized variability using scalar measures (Gude et al., 2017). Consequently, the time-dependent structure of within-individual glucose variability, and its association with metabolic and dietary characteristics, remains insufficiently characterized.

Goals and contributions. This paper addresses the lack of methods for estimating conditional variability in multilevel functional data. We propose a computationally efficient algorithm that estimates the conditional mean and then, in further steps, the conditional variability (heteroscedasticity) in multilevel functional models and provides uncertainty quantification for functional parameters. The model is a functional mixed-effects location-scale model, in which covariates and participant random functions act on both the mean and the log residual standard deviation of each trajectory (Section 2.1). The conditional mean and the conditional variability at a covariate profile are two parallel primary targets, each with its own time-varying covariate effects (Section 2.2). Our key idea is a three-step fitting strategy: (i) to estimate the conditional mean with a multilevel functional regression fitted score by score on a spline basis, (ii) to estimate the conditional variability by a regression of cross-fitted squared residuals on covariates, with participant random functions, and (iii) to correct this scale fit for the error in predicting each participant's mean. Step (iii) addresses the main difficulty of variance estimation in multilevel functional data: when participants contribute few trajectories, the squared residuals also contain the error of the predicted participant mean, which pulls the estimated variance slopes towards zero and does not vanish as the number of participants grows (Section 2.4). The correction estimates this component, removes it through conditional refits of the scale model, and estimates the level of variability separately. To propagate uncertainty from all steps, we use a participant bootstrap that repeats every step and yields pointwise and simultaneous confidence bands for the conditional mean and conditional variance functional parameters.

We further demonstrate the practical relevance of our framework through an analysis of postprandial glucose trajectories from the AEGIS study, uncovering distinct time-varying associations between premeal glucose levels, carbohydrate intake, meal type, and conditional glucose variability. These associations would be systematically underestimated without the proposed bias correction. Finally, we introduce an individual-level functional R2R^2 that quantifies the model-based reduction in squared prediction error relative to a common population variance. Its substantial variation across participants reveals pronounced heterogeneity in the extent to which the model explains individual glucose variability.

Paper roadmap. Section 2 introduces the modeling framework and the associated estimation and inference procedures. Section 3 presents a detailed analysis of the AEGIS case study. Section 4 concludes with a discussion of the results, limitations, and future work. The Appendix gives estimation and inference details and implementation details of the case study.

References (56)