Bayesian structural time series for biomedical sensor data: A flexible modeling framework for evaluating interventions

Jason Liu, Daniel J. Spakowicz, Garrett I. Ash, Rebecca Hoyd, Rohan Ahluwalia, Andrew Zhang, Shaoke Lou, Donghoon Lee, Jing Zhang, Carolyn Presley, Ann Greene, Matthew Stults-Kolehmainen, Laura M. Nally, Julien S. Baker, Lisa M. Fucito, Stuart A. Weinzimer, Andrew V. Papachristos, Mark Gerstein

Introduction

The "Quantified Self" movement has provided researchers with an unprecedented volume of longitudinal data from smartwatches, medical sensors, and environmental monitors. Despite this wealth of information, determining whether a specific intervention—such as a new exercise routine, a mobile health app, or a clinical treatment—actually caused a change in health outcomes remains a significant challenge. Real-world sensor data is notoriously "noisy," influenced by seasonal changes, daily habits, and complex environmental variables that can easily mask the true signal of a treatment.

Traditional statistical tools often struggle with these complexities. Simple t-tests ignore the temporal nature of the data, while ARIMA models, though excellent for forecasting, often fail to evaluate long-term evolving impacts or provide the dynamic confidence intervals necessary for personalized medicine. This paper introduces MhealthCI, a modeling framework that adapts Bayesian Structural Time Series (BSTS) to isolate and quantify the causal impact of health interventions.

The MhealthCI Framework

The core of the MhealthCI framework is the use of BSTS to generate a "counterfactual." The model is first trained on "pre-intervention" data to learn the relationship between a target variable (e.g., blood glucose levels) and various covariates. It then predicts what the target variable would have looked like during the intervention period if no treatment had occurred. The difference between this counterfactual prediction and the actual observed data represents the isolated causal impact of the intervention.

Key technical features of the framework include:

  • Spike-and-Slab Regression: A Bayesian technique that selects the most relevant predictors from a large pool of potential covariates, preventing model overfitting.
  • Paired Covariates: A novel approach where data from an unaffected control (e.g., a roommate’s wearable or a nearby neighborhood's data) is used to cancel out shared environmental noise.
  • MCMC Sampling: Markov Chain Monte Carlo methods estimate the posterior distribution, providing a "cone of uncertainty" that evolves dynamically over time.

Datasets and Validation

The researchers validated MhealthCI across four distinct scenarios to demonstrate its versatility in handling different data structures and noise profiles.

Figure 1: Examples of the diverse longitudinal and spatial data types used to validate the MhealthCI framework, including human activity, behavioral, and environmental sensor data.
  1. Environmental: Monitoring CO2, humidity, and temperature to detect room occupancy changes.
  2. Controlled Wearable: Using smartphone accelerometer data in a "spinning" experiment to test the model's resistance to artificial noise.
  3. Clinical (Diabetes): Analyzing 12 weeks of data from Type 1 Diabetes patients, integrating continuous glucose monitors (CGM), Apple Watch metrics, and insulin logs.
  4. Behavioral/Spatial: Evaluating a decade of crime data in New Haven, CT, alongside usage statistics from the "SeeClickFix" mobile app.

Key Results and Insights

The study revealed that health interventions are structurally similar to the economic policy changes BSTS was originally designed to measure. A major finding was the framework's sensitivity: in tests, MhealthCI confidently detected interventions at one-third the effect size required by traditional ARIMA models.

In clinical applications, the model quantified that a 10-week exercise regimen for a Type 1 Diabetes patient significantly increased "time-in-target" glucose range (p = 0.014) and decreased "above-target" time (p = 0.002). Furthermore, the "paired covariate" method proved highly effective; in the spinning experiment, the model successfully "subtracted" simulated noise by using a second sensor that experienced the noise but not the intervention.

Limitations and Future Directions

While powerful, the framework is computationally intensive due to its reliance on MCMC sampling, which may limit its application for massive, real-time datasets. Additionally, the model assumes covariate independence—meaning the intervention itself should not change the covariates (e.g., exercise shouldn't fundamentally change a patient's diet if diet is being used as a control). Future work will focus on integrating more context-rich covariates, such as GPS tracks and high-precision biological markers, to further refine personalized intervention analysis.

Reference: Liu J, Spakowicz DJ, Ash GI, et al. (2021) Bayesian structural time series for biomedical sensor data: A flexible modeling framework for evaluating interventions. PLoS Comput Biol 17(8): e1009303.

Summary updated

BibTeX
@article{liu2021bayesian,
  author = {Jason Liu and Daniel J. Spakowicz and Garrett I. Ash and Rebecca Hoyd and Rohan Ahluwalia and Andrew Zhang and Shaoke Lou and Donghoon Lee and Jing Zhang and Carolyn Presley and Ann Greene and Matthew Stults-Kolehmainen and Laura M. Nally and Julien S. Baker and Lisa M. Fucito and Stuart A. Weinzimer and Andrew V. Papachristos and Mark Gerstein},
  title = {{Bayesian structural time series for biomedical sensor data: A flexible modeling framework for evaluating interventions}},
  journal = {PLOS Computational Biology},
  year = {2021},
  doi = {10.1371/journal.pcbi.1009303},
}
Figure