Calculating the Mean Amplitude of Glycemic Excursions from Continuous Glucose Data Using an Open-Code Programmable Algorithm Based on the Integer Nonlinear Method

Xuefei Yu, Liangzhuo Lin, Jie Shen, Zhi Chen, Jun Jian, Bin Li, Sherman Xuegang XinComput. Math. Methods Medicine 2018 · DOI

TL;DR

This paper introduces MAGECAA v1.0, an open-source, programmable algorithm for calculating the Mean Amplitude of Glycemic Excursions (MAGE), a crucial metric for assessing blood glucose variability. By employing an Integer Nonlinear Programming (INLP) approach and a Differential Evolution algorithm, MAGECAA v1.0 offers a robust and accurate method that aligns well with manual calculations and existing software, addressing the need for reliable automated MAGE computation.

What Problem Does This Paper Address?

High glycemic variability, even in the absence of consistently high blood glucose levels, is increasingly recognized as a significant contributor to diabetic complications and increased mortality. Accurately quantifying this variability is essential for effective clinical management. The Mean Amplitude of Glycemic Excursions (MAGE) is a widely adopted "popular standard" for this purpose. However, traditional manual calculation of MAGE from continuous glucose monitoring (CGM) data is labor-intensive and prone to errors, especially with the large datasets generated by modern CGM devices (e.g., 288 data points per 24-hour period). While several software solutions exist, a notable issue is the reported poor agreement among them, creating uncertainty for clinicians and researchers. Furthermore, many existing tools lack open-code programmability, hindering further methodological research. This paper aims to address these limitations by developing and validating a novel, open-code, programmable algorithm for MAGE calculation.

Methods

The core of this paper is the development of a mathematical algorithm based on Integer Nonlinear Programming (INLP) to identify and count "valid extreme points" in CGM data. These points represent peaks and nadirs in glucose levels that exceed a defined threshold (Standard Deviation of Blood Glucose, SDBG). The problem of finding the optimal sequence of these valid extreme points is transformed into an INLP problem.

To solve this computationally challenging INLP, the authors employ a Differential Evolution (DE) algorithm, a population-based stochastic search technique known for its effectiveness in global optimization. The DE algorithm iteratively refines a population of candidate solutions (sequences of extreme points) through mutation and crossover operations, guided by an objective function that seeks to maximize the sum of valid glycemic excursion amplitudes.

The proposed algorithm is implemented as an open-code computer program named MAGECAA v1.0. This program automates the process of:

  1. Importing CGM data and calculating the SDBG threshold.
  2. Identifying all potential extreme points.
  3. Using the DE algorithm to find the optimal combination of valid extreme points.
  4. Calculating various MAGE metrics, including MAGE+, MAGE-, and MAGEa (an average of upward and downward excursions).
  5. Generating plots to visualize the identified extreme points.

Datasets

The MAGECAA v1.0 program was evaluated using CGM datasets collected from clinical practice. These datasets were obtained using CGMS® Gold™ (Medtronic®, USA) and included:

  • CGM recordings from 5 Type 1 Diabetes (TID) patients.
  • 116 CGM measurements from 58 Type 2 Diabetes (T2D) patients.
  • 127 CGM measurements from patients with gestational diabetes.

All data used were complete 24-hour CGM recordings. The study also involved a comparison with a manual calculation method (MAGEo) performed by a trained endocrinologist on a randomly selected subset of 60 CGM measurements.

Key Insights and Ideas

  • The "popular standard" needs a robust computational backbone: The paper highlights the critical need for reliable automated tools to calculate MAGE, given its importance in diabetes management and the limitations of manual methods.
  • INLP and DE offer a powerful combination: Transforming the MAGE calculation into an INLP problem and solving it with Differential Evolution provides a systematic and effective way to identify optimal sequences of glycemic excursions, overcoming the challenges of combinatorial complexity.
  • Open-code is crucial for scientific advancement: The authors emphasize the value of providing open-source code (MAGECAA v1.0) to facilitate further research into MAGE calculation methodologies and promote transparency.
  • MAGEa as a potentially more comprehensive metric: The paper introduces MAGEa, which considers both upward and downward glycemic excursions, suggesting it might be a more complete representation of glycemic variability than MAGEc (which is determined by the direction of the first excursion). The study shows a strong correlation between MAGEc and MAGEa, indicating MAGEa is a viable and potentially more informative alternative.
  • Addressing software disagreement: The study aims to alleviate concerns about the lack of agreement between different MAGE calculation software, suggesting that with sufficient data and robust algorithms, consistent results can be achieved.

Key Results

  • High agreement with manual method: The MAGECAA v1.0 program (MAGEC) demonstrated a highly significant linear correlation (r = 0.998, P < 0.01) with the original manual calculation method (MAGEo). The mean difference was very small (-0.03 ± 0.21), indicating robust performance.
  • Good agreement with existing software: Pairwise comparisons with two popular software products, Fritzsche and EasyGV, showed good agreement. Correlation coefficients ranged from 0.926 to 0.987 (P < 0.01). Bland-Altman plots confirmed that the mean differences between MAGECAA v1.0 and these software products were close to zero, suggesting that the worry about disagreement among different software products may not be necessary.
  • MAGEa shows strong correlation with MAGEc: The average of all valid excursions (MAGEa) showed a strong correlation (r = 0.993, P < 0.01) with the MAGE calculated based on the first excursion (MAGEC), with a mean difference of -0.05 ± 0.48. This supports MAGEa as a potentially useful index.
  • Computational efficiency: For batch calculations, the proposed method is noted to be more powerful than existing methods.

Limitations and Future Work

  • Computational time: While comparable to existing methods for single-person calculations, the paper notes that for batch calculations, the proposed method is more powerful. The exact computational time for different dataset sizes and complexities is not detailed.
  • MAGEa vs. MAGEc: While MAGEa is presented as a potentially more comprehensive metric, the paper acknowledges that MAGEc (based on the first excursion) is still widely used. Further clinical validation of MAGEa's utility in predicting diabetic complications would be beneficial.
  • Open-code for future research: The authors explicitly state that the open-code nature of MAGECAA v1.0 is intended to serve as an extra resource for peers interested in methodology research, implying a desire for further exploration and refinement of MAGE calculation techniques.

Summary updated

BibTeX
@article{yu2018calculating,
  author = {Xuefei Yu and Liangzhuo Lin and Jie Shen and Zhi Chen and Jun Jian and Bin Li and Sherman Xuegang Xin},
  title = {{Calculating the Mean Amplitude of Glycemic Excursions from Continuous Glucose Data Using an Open-Code Programmable Algorithm Based on the Integer Nonlinear Method}},
  journal = {Comput. Math. Methods Medicine},
  year = {2018},
  doi = {10.1155/2018/6286893},
}
Figure