Computational and Mathematical Methods in Medicine

Volume 2018, Article ID 6286893, 9 pages

https://doi.org/10.1155/2018/6286893

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

Correspondence should be addressed to Sherman Xuegang Xin; nc.ude.tucs@gxnix

Received 20 September 2017; Revised 18 January 2018; Accepted 7 February 2018; Published 8 March 2018

Academic Editor: Jesús Picó

Copyright © 2018 Xuefei Yu et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### Abstract

The mean amplitude of glycemic excursions (MAGE) is an essential index for glycemic variability assessment, which is treated as a key reference for blood glucose controlling at clinic. However, the traditional “ruler and pencil” manual method for the calculation of MAGE is time-consuming and prone to error due to the huge data size, making the development of robust computer-aided program an urgent requirement. Although several software products are available instead of manual calculation, poor agreement among them is reported. Therefore, more studies are required in this field. In this paper, we developed a mathematical algorithm based on integer nonlinear programming. Following the proposed mathematical method, an open-code computer program named MAGECAA v1.0 was developed and validated. The results of the statistical analysis indicated that the developed program was robust compared to the manual method. The agreement among the developed program and currently available popular software is satisfied, indicating that the worry about the disagreement among different software products is not necessary. The open-code programmable algorithm is an extra resource for those peers who are interested in the related study on methodology in the future.

#### 1. Introduction

Clinical researches have suggested that high glycemic variability may cause more serious damage to the body than high level stable blood glucose [1], which relates to the development of diabetic complication [2–6] and the increase of mortality in critically serious patients without diabetes [7, 8]. In such circumstances, how to quantitatively evaluate the glycemic variability in diabetic blood glucose monitor is essential for the clinical diagnosis and treatment. Several indexes have been proposed for the quantitative evaluation of the glycemic variability, such as MBG, SDBG, IQR, LAGE, M-value, %CV, J-index, IGC, GRADE, MODD, LBGI, HBGI, ADRR, TI, LI, PGS, CONGA, and MAGE [9–16]. Presently, clinicians and researchers trend to choose MAGE as the preferred index [17, 18], making it a “popular standard” in the quantitative evaluation of the within-day glycemic variability.

MAGE is an arithmetic average of either the upward or downward of all glycemic excursions exceeding the threshold (standard deviation of blood glucose (SDBG) obtained from all blood glucose concentrations within 24-hour period); the direction of the calculation is determined by the first countable excursion [19–21]. Following the original definition by Service et al. [19], clinicians and researchers applied the “ruler and pencil” graphical approach to calculate MAGE. However, this kind of manual approach is time-consuming and error-prone, when dealing with huge amount of data typically characterized by 288 observations in 5 minutes apart over a 24-hour period, generated from continuous glucose monitoring (CGM). Thus, the development of computer-aided programs to calculate MAGE becomes an urgently needed task.

To address the urgent need above, several automatic programs have been developed [22–25], making great contribution to the automatic calculation of MAGE. However, it was pointed out that the agreement among them is poor [26]. Therefore, more studies are required to explore the automatic calculation of MAGE. Currently available programs can be roughly divided into two groups. One group has detailed descriptions about algorithm with graphical display, such as the automated algorithm described by Baghurst [22] and the computer software described by Fritzsche et al. (Fritzsche) [23]. The other group only provides executable software for automatic calculation, without detailed descriptions of the algorithms used in the software, such as the web-based application “GlyCulator” [24] and the Excel-based workbook “EasyGV” [25]. However, to the best of our knowledge, all of these methods did not provide programmable open codes, which are important resources required for peers to implement more studies on methodology in this field.

Therefore, in this report, we developed a mathematical algorithm based on integer nonlinear programming method. Following the proposed mathematical method, a computer-aided program named MAGECAA v1.0 was developed. The code of our program is open; if peers are interested in it, please contact xuefeiyu@smu.edu.cn for downloading. To validate the developed program, comparison study was implemented using blood glucose CGM datasets obtained from T1D, T2D, and gestational diabetes patients against the manual method (MAGEo) and other currently popular software products.

#### 2. Materials and Methods

##### 2.1. The Proposed Mathematical Algorithm

Let represent the discrete blood glucose values obtained in CGM; then is a discrete function defined in time set . Let SDBG be the standard deviation of . A graph depicting the glycemic variability can be formed by connecting all the discrete values of function . When the difference of a peak and an adjacent nadir exceeds SDBG, the corresponding peak is labeled as a valid peak. The key point for the calculation of MAGE is to correctly count the valid peak or nadir.

Amplitude is the difference of functional values in a peak and a nadir of the function graph. A valid amplitude is labeled and counted when it is bigger than SDBG. To compute MAGE, these valid amplitudes of function should be firstly searched. From the mathematical perspective, a peak or nadir should be an extreme point of the function. These extreme points related to valid amplitudes are called valid extreme points. The MAGE computation problem can be solved by calculating all valid extreme points.

Suppose that is the sequence of all extreme points of function . We know that the local maximum points and local minimum points of function should be arranged as follows: interleaved between a maximum point and a minimum point. For simplicity, is denoted as , and is an arbitrary valid subsequence of sequence . These local maximum points and local minimum points can be staggered in subsequence . Thenwhere . This equation ensures that the selected extreme points are staggered.

Thus, the above MAGE computation problem can be transformed to an integer nonlinear programming (INLP) problem.

According to the principle of INLP problem, function (2) should have an optimum solution and an optimum value with respect to a constant ; it should also have an optimum value for constant , and

Suppose that is the maximal with respect to the optimal solution of function (2), and then the optimal solution represents the valid extreme points to compute MAGE.

If the extreme point is the local minimum point, then

If the extreme point is the local maximum point, then

Now, our object is to get the optimal solution of function (2). If the INLP problem is solved by enumeration algorithm, the amounts of different subsequences should be . For , the amounts of all subsequences are

It is difficult to directly solve function (2) when is large. A faster optimization algorithm is usually used to solve the above INLP problem. For example, a penalty function algorithm [27, 28] was used here to transform the above INLP problem (2) to an unconstrained optimization problem as follows.

Set

The new unconstrained integer optimization problem becomeswhere and and are penalty coefficients and tend to be .

When the optimum value , problem (9) has no optimal solution.

Differential evolution (DE) algorithm, a faster optimization algorithm proposed by Storn and Price [29], is a simple but powerful population-based stochastic search technique to solve global optimization problems over continuous domains. Many researchers modified DE algorithm to improve its performance when it was applied to a specific problem [30–33]. The idea of a modified DE algorithm proposed by Lin [34] to solve mixed-integer nonlinear programming problem is used here.

DE searches for a global optimal point in an -dimensional hyperspace. Let be the -dimensional search space of the INLP problem under consideration. The DE evolves a population of -dimensional individual vectors, that is, solution candidates, , , from one generation to the next. The evolution begins with a randomly initialized population of -dimensional integer parameter vectors in space . In each vector, integer parameters are sorted in an ascending order. Each vector forms a candidate solution to the unconstrained optimization problem. At each generation , DE employs the mutation and crossover operations to produce a trial vector for each individual vector , also called target vector, in the current population.

The details of the employment of the DE algorithm to solve the above INLP problem are as follows from (a) to (d).

*(a) Initialization.* A randomly initialized population is created to cover the entire search space uniformly as in the following form:where is a random number in the range and is expressed as the nearest integer vector to real vector .

*(b) Mutation Operation.* For each target vector at generation , randomly sample three other individuals , , and from the same generation, where , , and are random and mutually different integers generated over the range , which should be different from the current trial vector’s index . Then an associated mutant vector can be generated by using strategy:where is a factor in for scaling differential vectors.

*(c) Crossover Operation.* The crossover operation is applied to each pair of the generated mutant vector and its corresponding target vector to generate a trial vector .where is a crossover constant that is determined by users. is a randomly chosen index in which ensures that gets at least one parameter from . The integer parameters of target vector are also sorted from small to big.

*(d) Selection Operation.* The trial vector is compared to its corresponding target vector using the greedy criterion to decide whether a member of generation existed or not. If vector yields a smaller cost function value than , then is set to ; otherwise, the old vector is retained. The operation is expressed as follows:

The above (b) to (d) steps are repeated till the evolution times arrived to certain number (general ); from the last evolutionary generation, the individual vector with the smallest value of the objective function is the optimal solution of the problem of the current -dimensional extreme point combination. The algorithm will search from 3 to till the objective function obtains the minimum value so as to obtain the optimal extreme point combination and then use formulas (5)~(6) to calculate the MAGE value. Figure 1 shows the entire algorithm.