Professional Documents
Culture Documents
Mathematical Biosciences
journal homepage: www.elsevier.com/locate/mbs
a r t i c l e i n f o a b s t r a c t
Article history: Insulin-Dependent Diabetes Mellitus (IDDM) is a chronic disease characterized by the inability of the
Received 21 January 2008 pancreas to produce sufficient amounts of insulin. Daily compensation of the deficiency requires 4–6
Received in revised form 24 September insulin injections to be taken daily, the aim of this insulin therapy being to maintain normoglycemia –
2008
i.e., a blood glucose level between 4 and 7 mmol/l. To determine the quantity and timing of these injec-
Accepted 6 October 2008
Available online 30 October 2008
tions, various different approaches are used. Currently, mostly qualitative and semi-quantitative models
and reasoning are used to design such a therapy. Here, an attempt is made to show how system identi-
fication and control may be used to estimate predictive quantitative models to be used in design of opti-
Keywords:
Diabetes
mal insulin regimens.
Mathematical model The system was divided into three subsystems, the insulin subsystem, the glucose subsystem and the
System identification insulin–glucose interaction. The insulin subsystem aims to describe the absorption of injected insulin
Predictor from the subcutaneous depots and the glucose subsystem the absorption of glucose from the gut follow-
Glucose dynamics ing a meal. These subsystems were modeled using compartment models and proposed models found in
Insulin dynamics the literature. Several black-box models and grey-box models describing the insulin/glucose interaction
were developed and analyzed. These models were fitted to real data monitored by an IDDM patient. Many
difficulties were encountered, typical of biomedical systems: Non-uniform and scarce sampling, time-
varying dynamics and severe nonlinearities were some of the difficulties encountered during the model-
ing. None of the proposed models were able to describe the system accurately in all aspects during all
conditions. However, all the linear models shared some dynamics. Based on the estimated models,
short-term blood glucose predictors for up to two-hour-ahead blood glucose prediction were designed.
Furthermore, we explored the issues that arise when applying prediction theory and control to short-
term blood glucose prediction.
Ó 2008 Elsevier Inc. All rights reserved.
1. Preface the deficiency 4–6 insulin injections have to be taken daily, the
aim being to keep the blood glucose level as constant as possible.
In January 2002, the first author was diagnosed with Diabetes To determine the amount and timing of these injections different
Type 1 and soon realized the difficulty of maintaining normoglyce- approaches are used. Mostly qualitative and semi-quantitative
mia. The question was raised whether control theory could be ap- models and reasoning are used to design such a therapy. Most pa-
plied to the problem. To analyze the system using methods of tients monitor their blood glucose using personal glucose meters,
control theory, a model of the system is essential. This paper is and determine their own insulin injections based on these results.
an attempt to estimate such a model based on home-monitored Poorly controlled blood glucose levels may result in severe compli-
data, typically found in a diabetes diary. The models used were pri- cations. Hypoglycemia – i.e., low blood glucose levels – may lead to
marily linear and were found to be partly insufficient to describe brain damage [2], coma and eventually death. On the other hand,
the system. hyperglycemia – i.e., high blood glucose levels – can result in
chronic damages such as retinopathy, kidney failure and amputa-
2. Introduction tion due to angiopathy. All patients set their own insulin regime
with aid from their physician based on HbA1c, personal observa-
Diabetes Mellitus is a disease characterized by the inability of tions and a qualitative estimate of the glucose data. These regimes
the pancreas to produce sufficient amounts of insulin. To cover are to their nature rigid and non-flexible. They form the basis for
the therapy and patients often have to – and are encouraged to –
* Corresponding author. Tel.: +4646 222 8791; fax: +4646 138118.
alter their injection doses when their behavior deviate from the
E-mail address: Rolf.Johansson@control.lth.se (R. Johansson). routine the regime was based on. In these situations, the patients
0025-5564/$ - see front matter Ó 2008 Elsevier Inc. All rights reserved.
doi:10.1016/j.mbs.2008.10.008
102 F. Ståhl, R. Johansson / Mathematical Biosciences 217 (2009) 101–117
Blood System
Pancreas (glucose)
Feedback
Glucagon
Insulin
IDT Fig. 2. The partitioning of the system.
Liver
: flow
15
Blood Glucose
: affect sampled
splined
10
[mmol/l]
Fig. 1. Overview of the glucoregulatory system. IIT, insulin independent tissue; IDT,
insulin-dependent tissue. 5
Ingested Carbohydrates
100
slow
have to rely on their own knowledge and understanding of the dis- fast
ease to correct their doses. Many patient would benefit from some
[g]
50
sort of decision support in these situations. Such a tool would re-
quire a model of the effect of regime changes on blood glucose lev- 0
els. This paper addresses the question of how such models could be
Insulin Injections
retrieved from patient data. 20
Insulatard
The glucoregulatory system controls glucose metabolism and 15 Humalog
Units
to consist of three main parts: the Glucose Sub-Model (GSM), the Fig. 3. Diary of insulin intake, ingested carbohydrates, and blood glucose samples
Insulin Sub-Model (ISM) and the Glucose/Insulin interaction Model during a typical day.
(GIIM). The GSM describes the absorption of glucose from meal, the
ISM the absorption of insulin from insulin injections and the GIIM 3.1. Non-uniform sampling and data reconstruction
the interaction of glucose and insulin in the blood system and or-
gans (Fig. 2). These three parts will be modeled separately using The glucose sampling was based on a sampling schedule follow-
mainly compartment models and linear black-box models [7,8]. ing the daily routine. To capture the rapid dynamics caused by the
In addition, several previous quantitative approaches to data-based intake of carbohydrates, samples were taken before and 1.5 h after
modeling exist [9–14]. In particular, Sparacino et al. [12] presented each meal. Sampling was also scheduled at the late Insulatard
low-complexity prediction strategies (prediction horizon 30 min) injection. Additional to these measurements further unscheduled
based on continuous blood glucose measurement. The purpose of samples were collected, making the average sampling frequency
this paper is to evaluate various different data-based modeling ap- 9.3 samples/day.
proaches to Diabetes Mellitus. Based on daily monitoring of blood Whereas the data were infrequently and non-uniformly sam-
glucose, these models will be used for prediction of future blood pled, the identification methods used here require uniformly sam-
glucose values as support for determination of insulin therapy. pled data. To fulfill this demand, spline interpolation of the data
To find the best model, various different model validation criteria were used. To avoid under- and overshoot artefacts caused by
will be used [8, Chapter 9]. Given data on present and previous the splines, linearly interpolated help spots were added to the ori-
blood glucose values, the aim was to predict the glycemic behavior ginal data, a method used in [16] as well. In order for these spots
for the next 2 h with a reasonable accuracy. This target accuracy not to influence the spline in a negative way, different weights
was defined as a standard deviation of the prediction error less were assigned the true data and the help spots during the spline
than 0.5 mmol/l. Although cross validation was used, the models interpolation. The time frame was chosen to 15 min intervals, the
were estimated and validated using primarily one patient’s data. reason being mainly to accommodate the timing accuracy of meal
It would be preferable to validate the models using other patients’ intake and insulin injections of the diary. For purposes of system
data as well, but due to the scarcity of data this was not possible. identification, removal of outliers, detrending were done as part
This is of course a significant limitation, which has to be regarded of standard data pre-processing [8].
when evaluating the validity of the models .
3.2. Insulin and carbohydrate modeling
3. Methods and experimental conditions
The timing and dose of each injection were noted. The injec-
The blood glucose data primarily used in this paper were col- tions were considered to take place instantaneously:
lected during the first six months of a newly diagnosed type-1 pa- X
tient. The glucose testing was undertaken using a personal blood uIT ðtÞ ¼ DIT;k dðt t k Þ ðInsulatardÞ; ð1Þ
k
glucose tester, Accu-check Compact, Roche Diagnostics [32]. Meals, X
insulin injections and glucose samples were noted and registered uHum ðtÞ ¼ DHum;k dðt tk Þ ðHumalogÞ; ð2Þ
in a diary (Fig. 3). k
F. Ståhl, R. Johansson / Mathematical Biosciences 217 (2009) 101–117 103
where DIT;k and DHum;k are the Insulatard and Humalog doses (U) at clude the important nonlinearity of dose-dependent dynamics. The
time t k . nonlinear models, on the other hand, are often too complex to be
Intake of food was noted semi-quantitatively using predefined feasible for routinely use. However, there is one model that has
meals (Appendix A), each meal being quantified using three levels; been proposed, that both enhances the simplicity of the compart-
small, normal and large, for example: ment models as well as featuring the important nonlinearity of
dose-dependent dynamics – i.e., the model proposed by Berger
Time Food Type and Rodbard [24]. It will be used here to represent insulin absorp-
tion of the slow-acting insulin. The linear relationship between
08.45 Breakfast Normal
peak time and insulin dose does not exist for rapid-acting insulin.
12.30 Lunch Large
Glucose clamp studies show that the absorption rate is indepen-
16.00 Snack Small
dent of insulin dose in the range 0.05–0.4 U/kg for these insulins
18.15 Dinner Normal
[25]. Therefore, these injections will be modeled using a classical
compartment model. Together the long-lasting and rapid-acting
insulin absorptions form the total insulin flux (Fig. 4):
The predefined meals were determined by estimating the com-
position and size of some standard meals as published by nutri- Isub ðtÞ ¼ IsubIT ðtÞ þ IsubHum ðtÞ: ð5Þ
tionist [17] with a balance considering carbohydrate intake only.
Insulatard, IsubIT ðtÞ, was modeled using the Berger model [24].
The carbohydrates were divided into two different main types; fast
According to this model the amount of remaining insulin in the de-
and slow. Mono- and disaccharides were considered fast carbohy-
pot is:
drates and the rest were considered slow. All meals were consid-
ered to be ingested within 15 min. Thereby the carbohydrate 100 ts
AðtÞ ¼ 100 ; ð6Þ
intake can be mathematically expressed as: T s50 þ t s
X
uslow ðtÞ ¼ C slow;k dðt tk Þ; Slow carbohydrates; ð3Þ where T 50 is the time when half of the dose has been absorbed. The
Xk linear dependency between the absorption halftime and dose is ex-
ufast ðtÞ ¼ C fast;k dðt tk Þ; Fast carbohydrates; ð4Þ pressed as
k
T 50 ¼ a50 uIT ðtÞ þ b50 : ð7Þ
where C slow;k and C fast;k are the amounts [g] of slow and fast carbo-
The rate of absorption is
hydrates ingested at time t k , respectively. Modeling of metabolic
transformation can be approached by means of compartment mod- dA s ts T s50
¼ uIT ðtÞ: ð8Þ
els – i.e., specialized state-space models – where the structure of dt t ðT s50 þ t s Þ2
the system is postulated, a so-called grey-box model consisting of
interacting separate entities, called compartments [7]. Among these Dividing dA/dt with the distribution volume, V yields the insulin
compartments energy and material flow as described by different absorption rate
rate constants, cij . The state-space model identification was ap- s ts T s50
proached by various means of system identification such as state- IsubIT ðtÞ ¼ uIT ðtÞ
t ðT s50 þ t s Þ2
space model identification or ARMAX models [8,21,22,20]. Model
validation of the estimated models were made according to statisti- ¼ fsub ðuIT ðtÞ; tÞ uIT ðtÞ ½mmol=ðliter timeÞ: ð9Þ
cal model validation criteria including Akaike information criterion
The monomeric insulin Humalog, IsubHum ðtÞ, was modeled according
(AIC), final prediction error (FPE), minimum description length
to the compartment model (Fig. 5). Mass balances for each compart-
(MDL), variance accounted for (VAF), root-mean-square error
ment give the following system:
(RMS), residual correlation [8].
c11 0 1 Hum
x_ Hum ðtÞ ¼ xHum ðtÞ þ u ðtÞ; ð10Þ
4. Modeling of insulin and carbohydrate subsystems c21 c22 0
IsubHum ðtÞ ¼ ð 0 1=V ÞxðtÞ: ð11Þ
Type-1 diabetics are treated with a therapy with the intention
to mimic the normal behavior in a healthy person. Basal injection The transfer function becomes
of slow-acting insulin is taken once or twice a day. It serves to pre-
HsubHum ðsÞ ¼C Hum ðs I AHum Þ1 BHum ; ð12Þ
serve a basal level of insulin required to maintain normal activity.
Bolus injections are rapid-acting insulin injections taken to coun-
c21 1=V
¼ : ð13Þ
teract the massive glucose flux following a meal. The slow-acting ðs þ c11 Þ ðs þ c22 Þ
insulin used here is InsulatardTM and the rapid-acting insulin is Discretization yields
HumalogTM. Whereas InsulatardTM (Novo Nordisk [42]) is an inter-
mediate/long-lasting insulin of NPH-type, HumalogTM (Lilly [43])
is a rapid-action monomeric insulin. Approximate time-action pro-
files are provided by the manufacturers and in the review [6].
ISM
4.1. The insulin subsystem
Humalog
Comp. Model(2)
The dynamics of insulin is one of the most important factors Isub
affecting the outfall of the therapy. Much research is targeted at +
developing new insulin analogs, both long-lasting and rapid-acting Insulatard
Berger Model
ones. However, the mathematical modeling of the insulin action is
still quite poorly developed. Most models are either compartment
models or highly sophisticated nonlinear physiological models
[6,23]. The compartment models are linear and thereby do not in- Fig. 4. The insulin sub-model (ISM).
104 F. Ståhl, R. Johansson / Mathematical Biosciences 217 (2009) 101–117
Discretization yields:
0 1 0 1
40 d11 0 0 0 b1
Bd d22 0 B
0 C slow B b2 C
C
B 21 C
xslow
kþ1 ¼B Cx þ B C uslow ; ð28Þ
30
@ d31 d32 d33 0 A k @ b3 A k
d41 d42 d43 d44 b4
in
20
Gk slow ¼ ð 0 1=V Þ xslow
k ; ð29Þ
with the discrete-time transfer function relationship
10
in Bslow ðz1 Þ slow
Gk slow ¼ C slow ðzI Uslow Þ1 Cslow uslow
k ¼ u : ð30Þ
Aslow ðz1 Þ k
0
0 5 10 15 20 In an oral glucose tolerance test, Dalla Man et al. [27] estimated the
Time [h] glucose absorption rate from the gut. Three different models were
fitted to the data corresponding to the fastest carbohydrates here
Fig. 6. Insulin absorption.
F. Ståhl, R. Johansson / Mathematical Biosciences 217 (2009) 101–117 105
0.05
0.03
0
[mmol/(l · min)]
0.025
−0.05
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0.02
0.2
0.015 0.15
0.1
0.01
0.05
0.005 0
−0.05
0 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0 50 100 150 200 250 300
Time [min] Time lag τ [h]
Fig. 8. Cross correlation function between blood glucose change and carbohydrate
Fig. 7. Gut absorption simulating digestion of 10 g fast and 10 g slow carbohydrates
inputs for slow (upper diagram) and fast (lower diagram) carbohydrate inputs,
at t = 0.
respectively, vs. time lag s [h].
4 4
2 2 1
0 200 400 600 800 0 200 400 600 800
Interpolated
MiniMod
h=90 [min] h=120 [min] 0
18 18
16 16
14 14 −1
12 12
10 10 −2
8 8
6 6
−3
4 4
2 2 0 2000 4000 6000 8000 10000 12000 14000 16000 18000
0 200 400 600 800 0 200 400 600 800
Time [15 min]
Fig. 9. Comparison between the reconstructed data and the original data for some
different resampling frequencies h = 30, 60, 90, 120 min for patient number 46. Fig. 10. Data segmentation using Matlab command segment. The variation of three
(out of 12) parameters.
tential close to the 100 min resampled data. Whereas this signal
16
failed to reproduce some of the fast oscillations, it still made good
Blood Glucose (mmol/l)
estimates of the original data. The average RMS between the 100- 14
min signal and the original MiniMed signal was less than 1 mmol/l
for the 56 data records considered. 12
1 1 160
0.8 0.8
0.4 0.4
120
0.2 0.2
Frequency
0 0
0 10 20 30 0 10 20 30 100
Time lag [h] Time lag [h]
Slow Carbohydrate Fast Carbohydrate 80
1.4 1.4
1.2 1.2
60
1 1
0.8 0.8
40
0.6 0.6
0.4 0.4
20
0.2 0.2
0 0
0 10 20 30 0 10 20 30 0
2 4 6 8 10 12 14 16 18
Time lag [h] Time lag [h]
Blood Glucose [mmol/l]
Fig. 12. Autocorrelation functions of inputs: autocorrelation function of Humalog
Fig. 14. Empirical frequency functions of blood–glucose sample distribution,
dose (upper left); autocorrelation function of Insulatard dose (upper right);
apparently with a non-symmetric distribution.
autocorrelation function of slow carbohydrate intake (lower left); and autocorre-
lation function of fast carbohydrate intake (lower right).
0.8
Feedback
0.4
x_ GIIM ¼ AxGIIM þ Bu; ð34Þ
y ¼ CxGIIM ; ð35Þ
0.2
where xGIIM are the different states of the system, and
T
0 uðtÞ ¼ Ginfast Ginslow IsubHum IsubIT ; ð36Þ
yðtÞ ¼ GðtÞ: ð37Þ
−0.2
0 5 10 15 20 25 The models investigated were not formulated in the state-space for-
Time lag [h]
mat, however, but used the polynomial representation of the sys-
Fig. 13. Autocorrelation function of blood glucose correlation change tem. Each model was analyzed with respect to Bode diagrams and
Dyk ¼ yk yk1 . pole-zero diagrams to investigate possible pole-zero cancellations.
The predictive capability of the models was inspected by comparing
the 8-step prediction with the splined data, the VAF serving as a
comparison tool [22]. The best model according to this criteria is
erature based parameter values for the glucose and insulin subsys- then subject to a nonlinear transformation, using a simple Wiener
tems the Glucose Insulin Interaction Model (GIIM) was estimated model. First, however, the ARMA model is reviewed in order to
using the estimation data and validated with the validation data. serve as a reference for the other models, giving an indication of
The validation was based on different fitting criteria, such as the the benefit of the use of the sub-models and the different glucose/
AIC, FPE, VAF and residual correlation [8, Chapter 9]. insulin interaction models.
The approach was to firstly investigate linear models. The sim-
plest model with a physiological interpretation is the model pro- 6.1. ARMA model identification
posed by Ackerman et al. [30]:
dG Previous attempts to predict future blood glucose values given
¼ aGðtÞ þ bIðtÞ þ Gin ðtÞ; ð32Þ past and present values have previously been reported in
dt
dI [9,10,12]. Postulating an uncorrelated stochastic process feðtÞg as
¼ cGðtÞ þ dIðtÞ þ Isub ðtÞ; ð33Þ input, only previous values of the variable of interest are used for
dt
estimation of the ARMA model for the output fyðtÞg – i.e., fyðtÞg
where GðtÞ is the blood glucose concentration and IðtÞ is the plasma blood glucose, feðtÞg abstract – with
insulin level. Additional states can be added, with or without phys-
iological interpretation, thereby the general linear model is given: Aðz1 ÞyðtÞ ¼ Cðz1 ÞeðtÞ: ð38Þ
108 F. Ståhl, R. Johansson / Mathematical Biosciences 217 (2009) 101–117
This model may help to get an estimate of the approximate degree 8-step-ahead prediction, ARMA model
10
of the dynamics. First the AR-model is estimated, and thereafter dif- Measured Output
ARMA Fit: 56.15%
ferent orders of the C-polynomial were tested. As can be seen in
Fig. 16, all validation criteria yield the same result suggesting
sixth-order model dynamics. Now, to make the prediction error
white the C-polynomial is estimated as well. This yields the follow-
5
ing model:
is shown.
Fig. 18. Blood glucose 8-step-ahead (two-hour-ahead) prediction, ARMA model
(blue graph) and measured blood glucose (black graph). (For interpretation of the
references to color in this figure legend, the reader is referred to the web version of
this paper.)
Model fit vs No. parameters
0.18
AIC Choice
MDL Choice
0.16 Best Fit 6.2. Linear models – ARMAX
0.1 Aðz1 ÞyðtÞ ¼ B1 ðz1 ÞGin ðtÞ þ B2 ðz1 ÞIsub ðtÞ þ Cðz1 ÞeðtÞ:
Sets of system orders and time delays were tested according to Ta-
0.08
ble 1. In Table 2, the proposed model structures of the various dif-
0.06
ferent validation criteria can be seen. Noteworthy is that the MDL
criterion indicates that the inputs did not contribute enough to
0.04 compensate for the added complexity of the model. Here, the model
structure selected by AIC was chosen with residual correlation as
0.02 seen in Fig. 19. Apparently the residuals were not uncorrelated,
and thus a colored noise model had to be estimated. Various differ-
0
1 2 3 4 5 6 7 8 9 10 ent orders of the C-polynomial were tested and evaluated according
System order n to best fit, thus yielding the following model:
0.8
Table 1
ARX model structure investigated.
0.6
Parameter nA nB1 nB2 k1 k2
Range 5–10 0–3 0–3 0–3 0–3
0.4
0.2
Table 2
ARMAX model structure chosen.
0
Parameter Loss MDL AIC
nA 6 6 6
−0.2 nB1 2 0 1
0 5 10 15 20 25 30 35 40 45 50
nB2 2 0 2
Time lag τ k1 0 0 2
k2 3 0 0
Fig. 17. Residual autocorrelation analysis, ARMA model.
F. Ståhl, R. Johansson / Mathematical Biosciences 217 (2009) 101–117 109
0.8
0.6
0.4
0.2 0
−0.2
0 5 10 15 20 25 30 35 40 45 50
−5
Time lag τ [h] 0 100 200 300 400 500 600 700
Fig. 19. Residual autocorrelation analysis for ARX model. Fig. 21. Blood glucose 8-step-ahead (two-hour-ahead) prediction, Subspace-based
model identification (blue graph) and measured blood glucose (black graph). (For
interpretation of the references to color in this figure legend, the reader is referred
to the web version of this paper.)
The correlation of the residuals may indicate that the noise dynam-
ics differ from the other system dynamics.
6.2.1. Prediction
can be seen. The VAF was significantly lower than that for the AR-
In Fig. 20, the 8-step-ahead prediction using this model can be
MAX model.
seen. The improvement from the ARMA-model is quite small. Dif-
ferent weighting values were tested to investigate whether the
6.4. The general transfer function model (GTFM)
model improves when the real measurements were given a higher
weight. No improvement was found by weighting the real mea-
Considering the high level of correlation in the residuals in the
surements heavier than the interpolated values.
previous models it may be an idea to consider separating the
dynamics in the system. By the general transfer function model
6.3. Subspace-based model identification
the different inputs and the noise model all have different
dynamics:
According to the validation criteria, the best model was found
for n = 6 with s = 8. However, this model was unstable with a B1 ðz1 Þ B2 ðz1 Þ Cðz1 Þ
Aðz1 ÞyðtÞ ¼ u1 þ u2 þ eðtÞ: ð45Þ
pole-pair outside the unit circle. The second best model (n = 4, 1
F 1 ðz Þ 1
F 2 ðz Þ Dðz1 Þ
s = 6) was also the model of least complexity. The predictive prop-
The model was estimated for the sets of orders in Table 3. The val-
erties of the subspace-based models were comparable to the AR-
idation criteria all selected the model structure seen in Table 4. Esti-
MAX models. In Fig. 21, the 8-step prediction of the n = 6, s = 9
mating the parameters gave the model:
−5
0 100 200 300 400 500 600 700 Table 3
Sets of system orders to evaluate for GTFM of Eq. (45).
Fig. 20. Blood glucose 8-step-ahead (two-hour-ahead) prediction, ARMAX model
(blue graph) and measured blood glucose (black graph) vs. time [15 min]. (For nA nB1 nB2 nF 1 nF 2 nC nD k1 k2
interpretation of the references to color in this figure legend, the reader is referred 3–6 2–3 2–3 2–3 2–3 0–3 0–3 0–2 0–2
to the web version of this paper.)
110 F. Ståhl, R. Johansson / Mathematical Biosciences 217 (2009) 101–117
Coherence
Coherence
5 2 3 1 1 3 2 0 0 0.6 0.6
0.4 0.4
0.2 0.2
Autocorrelation function, Residuals
1.2 0 0
0 2 4 6 0 2 4 6
Frequency −4
x 10 Frequency −4
x 10
1
0.7 1
0.6
0.8
Coherence
Coherence
0.8 0.5
0.4 0.6
0.3 0.4
0.6
0.2
0.2
0.1
0.4 0 0
0 2 4 6 0 2 4 6
Frequency −4
x 10 Frequency −4
x 10
0.2
Fig. 24. In the upper graphs, the unwindowed coherence spectra from insulin and
glucose inputs to blood glucose output and in the lower graphs coherence spectra
0
using a Hanning window (L = 128).
−0.2
0 5 10 15 20 25 30 35 40 45 50
data can be transformed before the linear models were fitted.
Time lag τ [h]
Two different transformations of the blood glucose data were con-
Fig. 22. Residual autocorrelation analysis, general transfer function model of Eq. sidered below. Another possibility is the Hammerstein and Wiener
(45). models [8]. A Hammerstein model is basically a nonlinear transfor-
mation of the inputs thereafter the normal linear models is used.
Some simple transformations are considered in the NARMAX sec-
8-step-ahead prediction, GTFM model tion below. The Wiener model consists of making a nonlinear
10
Measured Output
GTFM Fit: 60.83%
transformation of the output of the linear model. In the GTFM-
Wiener model section below, Chebychev polynomials were consid-
ered for such a nonlinear function of the output.
5
6.5.1. Data transformations
Previously, the log-normal character of the blood glucose sam-
ples was investigated. A test of log-normality was undertaken, and
passed for p < 0.05. Thus, a natural nonlinear transformation is to
take the natural logarithm of the glucose data
0
ylog ¼ logðyÞ: ð53Þ
This concept was tested for all the models discussed above, but
without improvement (Fig. 25). Another transformation proposed
by Kovatchev et al. [35] is:
−5
0 100 200 300 400 500 600 700
ykov ¼ 1:794ðlogðyÞ1:026 1:861Þ: ð54Þ
Fig. 23. Blood glucose 8-step-ahead (two-hour-ahead) prediction, General Transfer This transformation was also used in these models, but without fur-
Function Model (blue graph) and measured blood glucose (black graph) vs. time
[15 min]. (For interpretation of the references to color in this figure legend, the
ther success.
reader is referred to the web version of this paper.)
6.5.2. NARMAX
From the coherence diagrams in Fig. 24, there appears to be a
6.5. Nonlinear models poor linear relationship between the inputs and the output. To
overcome this it is possible to apart from using the ordinary glu-
To clarify the linear relationship between the input variables cose and insulin inputs take nonlinear transformations of them
and the blood glucose values the coherence was investigated. In and use as regressors. Systematically, this is done using for exam-
Fig. 24, the plain and windowed coherence plots can be seen. The ple neural networks or radial basis functions. It is also possible to
windowed plots indicate that it may be insufficient to use these in- use other variables which lack obvious physiological explanation
puts to explain the glucose response, possibly caused by factors as regressors. One such variable is the time of the day. As men-
such as high levels of disturbance affecting the system, non-repre- tioned in the physiology chapter the dynamics of the system is be-
sented inputs and nonlinearities in the dynamics. Since the linear lieved to vary over the day. Basically any variable believed to affect
models proved insufficient to represent the system indicating non- or correlate with the output may be used to try to explain the
linear relationships, supported by the coherence plots, nonlinear behavior of the output.
models must be considered. Here, a number of possible opportuni- For the models presented above the following simple nonlinear
ties for making the models nonlinear are investigated. First, the functions were tried to create new inputs:
F. Ståhl, R. Johansson / Mathematical Biosciences 217 (2009) 101–117 111
−4
0 100 200 300 400 500 600 700 7.1. Interpolation of blood glucose curve
Time [15min]
The interpolation routine used may be a poor method to recon-
Fig. 25. Cross validation of 8-step-ahead (2 h) prediction based on subspace-based
identification using log-normal transformation and Kalman filter with VAF 97% and struct the data and thus introduce false dynamics in the time ser-
prediction error rb 2 ¼ 0:196. ies. The data were sampled at an average of 9.3 samples/day.
Assuming that 8 h a day is spent sleeping when no sampling is
undertaken, this corresponds to a sampling period of approxi-
ui;j ¼ ui1 uj2 i; j 2 f0; . . . ; 3g: ð55Þ mately 100 min. These samples were interpolated using a least
squares splining method to get a sampling rate of 15 min. The
The time of the day was also tried as an input. No significant
spectrum of the sampled and interpolated signal was compared
improvement could be seen.
with the spectrum of an average of patients monitored by Mini-
Med, a sampling device collecting samples every fifth minute.
6.5.3. GTFM-Wiener
The MiniMed samples were also resampled at different rates up
The linear model can be extended by a nonlinear function on
to every third hour and interpolated using the same method as
the output. Such a model is called a Wiener model:
for the meter monitored data to get samples every 15 min. The
B1 ðz1 Þ B2 ðz1 Þ Cðz1 Þ spectra of these new signals were also compared to the interpo-
Aðz1 ÞyðtÞ ¼ u1 þ u2 þ eðtÞ;
F 1 ðz1 Þ F 2 ðz1 Þ Dðz1 Þ ð56Þ lated data. The spectrum of the interpolated data falls between
yw ðtÞ ¼ hðyðtÞÞ; the spectra of the signal sampled at 60 min and the signal resam-
pled at every 120 min. These signals were compared to the original
where h(y(t)) is a nonlinear function. Here, Chebychev polynomials signal and evaluated according to their ability to resemble the ori-
were used to represent this function. Polynomials of order 1–25 ginal signal. The 60-min signal has little trouble following the ori-
were tested and evaluated using the Akaike criteria. Using this poly- ginal signal. On the other hand, the 120-min signal failed to model
nomial, the prediction improved somewhat (Fig. 26). the most rapid oscillations and has a significantly higher maximum
error. The interpolated data had an average sampling rate of every
100 min. The rapid changes in blood glucose concentration were
often experienced as hypoglycemia and thus call for sampling to
8-step-ahead prediction, GTFM-Wiener establish glycemic status. Thus, the rapid changes were often cap-
10
Measured Output
tured in these extra, unscheduled samples. More effort is required
GTFM−Wiener Fit: 64.11% to analyze optimal sampling schedules and robust and correct
interpolation techniques.
5
The only quantity of the system accessible to measurements is
the blood glucose concentration. Glucose flux from the absorption
of meals and the insulin absorption from the subcutaneous depots
are not available for measurements. This constitutes a significant
difficulty in the estimation of the sub-models and their output im-
0 pact on the GIIM. The absorption of rapid-acting insulin and the
glucose flux from carbohydrate intake are almost always present
at the same time, making it difficult to access the influence of each
input. This problem is difficult to avoid, since separating the insulin
injections and carbohydrate intake may create unacceptable risks
for the patient. This is undoubtly one of the major problems in ef-
−5
0 100 200 300 400 500 600 700 forts to model and estimate the system under these conditions. The
only possibility to get reliable estimates of these sub-models is to
Fig. 26. Blood glucose 8-step-ahead (two-hour-ahead) prediction, GTFM-Wiener
conduct clinical experiments such as glucose clamp techniques or
model (blue graph) and measured blood glucose (black graph) vs. time [15 min].
(For interpretation of the references to color in this figure legend, the reader is tracer methods. Such experiments are cumbersome and not appro-
referred to the web version of this paper.) priate for routinely use.
112 F. Ståhl, R. Johansson / Mathematical Biosciences 217 (2009) 101–117
7.3. The sub-models ‘deteriorate’ or ‘depreciate’ the result. Additionally, there is a con-
siderable intrapersonal variability in the absorption of insulin due
The energy intake was considered to consist solely of slow and to injection site, depth of the deposition and variations in periph-
fast carbohydrates. As food contains two other major sources of en- eral turn-over rate. Variation in glucose absorption can be expected
ergy (i.e., fat and protein), this assumption is not true. Metabolic as well, an uncertainty that cannot be modeled at all, thereby lim-
conversion of fat and proteins into glucose and free fatty acids iting the prediction capacity unless it somehow can be retrieved in
(FFAs) may take place in the liver in the post-absorptive stage. an on-line setting.
Therefore, fat and proteins also have an impact on the metabolism
of the body with direct and indirect influence on the GIIM. Regard- 7.4. Unrepresented inputs
ing carbohydrates there is a vast spectrum of various different
mono-, di- and polysaccharides and to simply division their The modeling was based on measurements and estimates of
absorption dynamics in two categories is probably an over- blood glucose, size and timing of insulin injection doses and meals.
simplification. However, there may be other inputs with important influences on
The fast carbohydrates were modeled using a second-order the dynamics of the system. One such input may be physical exer-
compartment model. Looking at the absorption profile from [27], cise. Apart from having blood glucose lowering effect due to the
this seems to be a plausible model to represent the absorption. utilization of glucose in the muscle cells, exercise also has a posi-
The slow carbohydrates were modeled using a fourth-order com- tive effect on insulin sensitivity. Thus, the effect of insulin is also
partment model. Slow carbohydrates first have to be digested into enhanced. This variable was not considered mainly due to difficul-
glucose before absorption and therefore have a delay between in- ties in quantifying it properly. Another variable of interest is the
take and absorption. The fourth-order compartment model creates time of the day. The dynamics of the system is believed to vary
such a delay in the absorption. As mentioned above, fat and protein over the day, especially in the morning as compared to the rest
have not been regarded. Apart from providing energy they influ- of the day. In this paper this variable has simply been tried as a
ence the absorption dynamics. regressor, but without much success. An alternative would be to
The GSM used in this paper was kept very simple for a number divide the day in different segments and with multiple sets of
of reasons. Firstly, this paper deals with the entire glycemic system parameters, one set for each segment. Finally, alcohol intake also
and a thorough modeling would simply take too much effort. Sec- has to be considered as a specific input. The metabolism of alcohol
ondly, the information about the contents of the meals is rather disturbs the endogenous glucose production, and thus has a glu-
scarce in the diabetes diary. Meals are simply noted as breakfast, cose lowering effect. This variable was not been considered, mainly
lunch, dinner and an estimate of their size; small, normal or large. due to that such consumption has not been noted in the diary.
Thirdly, the accuracy in the model has to stand in proportion to the
accuracy of the inputs. Notes on the exact amounts of carbohy- 7.5. The linear models of GIIM
drates, protein and fat in the diary is simply not realistic.
Whether these simple models are too simplified to describe the In Figs. 27 and 28, a comparison between the Bode diagrams of
absorption in an acceptable way remains to be investigated. Most the previous models can be seen. The transfer functions fall into
likely research has to be targeted at physiological modeling and two separate categories – i.e., the subspace-based models, the AR-
understanding of how the digestive and absorbative processes MAX and the GTFM models. The subspace-based models put more
are influenced by the composition of the meals. However, it has emphasis at the higher frequencies, while the ARMAX and GTFM
to be borne in mind that the data available cannot be assumed to have a typical low pass performance. Since these models have
very accurate. For this effort also has to be put on developing sim- the best predictive capability, they probably also best resemble
ple and accurate ways to estimate the content of a meal. In Austra- the true system. Therefore, focus will be on these two models.
lia, food producers can now have their products measured with the There are some important differences between the models. There
glycemic index analysis and labelled with the glycemic index on is a resonance peak in the insulin/GIIM transfer function in the
the package. Thereby, the consumers can easily get an estimate
of the glycemic effect of the product. Glycemic Index is a debated
issue, and it has some serious shortcomings in describing the 1 Bode diagram
10
absorption profile of meal – for reviews of glycemic index and its
usage, see [29,36–40,26]. 10
0
el for the rapid-acting insulin and the Berger model for the slow- 10
−1
acting insulin [24]. The rapid-acting insulin had a very fast onset,
which the second-order model is able to represent. The dynamics
−2
10
This is of course not optimal since these average parameter values 100
10 3 Subspace(n=6,s=9)
GTFM
PredictionError[mmol/l]
10 2.5
−1
10
−2 −1 0 1 2
10 10 10 10
ARMAX
Subspace(n=4,s=6)
100 Subspace(n=6,s=9) 1.5
GTFM
Phase (degrees)
1
−100
−200
0.5
−300
−400 0
−2 −1 0 1
10 10 10 10 1 2 3 4 5 6 7 8 9 10
Frequency [rad/15min] PredictionHorizon [15min]
Fig. 28. Comparison Bode diagrams. GSM/GIIM to blood glucose for various Fig. 30. The prediction standard deviation vs. prediction horizon [15 min].
identification methods.
noise dynamics. In the ARMAX model, the residuals are still corre- Fit 99.97% Fit: 93.99%
insulin/GIIM dynamics the pole pair close to the real one is present.
Likewise all models agreed that the glucose/GIIM transfer function −5 −5
0 200 400 600 0 200 400 600
has a pole pair somewhere in the vicinity of 0.5–0.6 ± (0.5–0.8)i.
This may indicate that these dynamics are essential parts of the 8-step-ahead Prediction Infinite Horizon
10 10
system. The best model according to VAF for the 8-step-ahead pre- Fit: 60.83% Fit: 11.41%
diction is the GTFM. In Fig. 30, the models prediction error stan-
dard deviation can be seen for predictions between 1 and 10 5 5
steps forward. Whereas the GTFM was the best model in the whole
range, the result was not undisputed; the best linear model is obvi- 0 0
ously not capable of describing the system very well. As seen in
Figs. 30 and 31, the predictive capacity degraded very fast as the
−5 −5
prediction horizon increased. Already with four-step-ahead (1 h) 0 200 400 600 0 200 400 600
4
Spectrum for disturbance at output y
10
ARMAX
Subspace(n=4,s=6)
10
3 Subspace(n=6,s=9) After 8 steps these prediction problems escalated, making the pre-
GTFM
dictions rather poor. In the last diagram the pure simulation
10
2
ðs ¼ 1Þ can be seen. In Fig. 32, the simulation can be seen clearer.
In the upper diagram, the simulated data and the splined data can
be seen again. The model had obvious problems with the magni-
1
10
0
tude. In the lower diagram, the output of the model was simply
scaled with a factor of 2.5. In Fig. 33 the system was simulated
Power
10
−1
using varied inputs; ui;sim ¼ ð1 0:25Þui . This is supposed to repre-
10
sent the natural uncertainty in the absorption processes.
10
−2 Judged from the target objective of two-hour-ahead prediction
with a prediction error smaller than 1 mmol/l in 95% of the cases,
10
−3 the 8-step prediction accuracy was insufficient for all the models.
The models had difficulty with the high peaks and the low bottoms
10
−4
of the data. Whereas this is probably an artefact of nonlinearities in
the system, it could also be an effect of underestimated GIIM gains
10
−5
−2 −1 0 1
due to correlated inputs with cancelling effects. This problem can
10 10 10 10
Frequency [rad/15min] be seen even clearer in the simulation of the GTFM. By simply scal-
ing the output, the simulated output resembles the true data at
Fig. 29. Bode diagram. Noise dynamics for various identification methods.
114 F. Ståhl, R. Johansson / Mathematical Biosciences 217 (2009) 101–117
Fig. 32. Simulated model (GTFM) output (green) and real data (blue) vs. time 7.7. Two-hour-ahead predictors
(upper diagram). Scaled simulated data and real data vs. time (lower diagram). (For
interpretation of the references to color in this figure legend, the reader is referred Whereas the best two-hour-ahead cross-validated predictors
to the web version of this paper.)
were found by means of subspace-based identification (Fig. 25)
and Wiener-model identification (Fig. 26), the prediction did not
10 uniformly meet our accuracy target of 0.5 mmol/l in transients
(Fig. 25). Whereas the two-hour-ahead prediction error standard
deviation rb ¼ 0:44 is within the target limits, there are transient
events with prediction error of larger magnitude.
5 8. Conclusions
Fig. 33. Simulated data using inputs varied ±25%. The number of measurements may be too few and the interpo-
lation method not optimal, resulting in a poor reconstruction of
some periods. In other segments of the data the model is com- the blood glucose curve.
pletely out of track. The system was hard to identify using these data. The inputs act
Looking at the coherence spectra between the insulin and glu- simultaneously, making it difficult to estimate the sub-models
cose input to the GIIM and the glucose output, there appears to and to extract the specific impact of each input on the output.
be a poor linear relationship among these variables. This may in For accurate identification of the insulin and glucose dynamics,
part be explained by that there are unrepresented inputs that have it would be desirable to have an experiment design with decor-
a significant impact on the glucose concentration. Even so, linear related insulin and glucose intakes.
modeling would expect higher coherence for the relationship of The system is nonlinear and can thus not be represented by the
GSM/GIIM and ISM/GIIM, as these two variables undoubtedly are linear models.
the most important inputs. The sub-models used to describe the glucose flux and the insulin
A simple way to make the system nonlinear is to transform the absorption were probably too simple or irrelevant to accurately
data. In the data chapter the log-normal nature of the blood glu- describe these processes.
cose samples was reviewed and the log-normality hypothesis The diary estimates of the size and timing of the meals and insu-
was not rejected ðp < 0:05Þ. Therefore, a natural transformation lin injections were not sufficiently accurate.
would be to take the natural logarithm of the data. This transform Unrepresented variables are probably relevant to describe the
and the transform suggested by Kovatchev et al. [35] were tested system – e.g., physical activity and alcohol intake.
on the linear model without improvement. The coherence dia-
grams did not improve either. Instead some simple Hammerstein Apart from these difficulties, some other interesting properties
and Wiener models were considered to extend the GTFM. The of the system are:
Hammerstein models used did not improve the model perfor-
mance. Using a Wiener model with a Chebychev polynomial non- The system dynamics are time-varying especially during the
linearity, the prediction accuracy improved somewhat. ‘honeymoon’ phase [18,19].
F. Ståhl, R. Johansson / Mathematical Biosciences 217 (2009) 101–117 115
The first author would like to express his gratitude towards his
three supervisors Rolf Johansson, Christian Liisberg and Mona Lan-
din-Olsson for their guidance and many helpful discussions. We
would also like to thank Per Hagander at the Department of Auto- Symbol Description Units
matic Control, Lund University, for his interest and help in provid- Greek letters
ing contacts and Jette Randløv and Jon Hansen at Novo Nordisk AS g Absorption efficiency (–)
for literature suggestions and valuable comments on the prelimin- Cfast C-matrix of the disc. Fast carb (–)
ary manuscript. We are also grateful to Novo Nordisk for providing compartment model
the MiniMed data and for financial support. CHum C-matrix of the disc. Humalog (–)
As continuation, the DIAdvisorTM project within the European compartment model
FP7-ICT program will pursue research on prediction and predictive Cslow C-matrix of the disc. Slow carb (–)
control of blood glucose concentration. compartment model
Ufast U-matrix of the disc. Fast carb (–)
Appendix A. Predefined meals compartment model
UHum U-matrix of the disc. Humalog (–)
In the diary the meals were noted using the semantic expressions compartment model
small, normal and large. Below follows a definition of these standard Uslow U-matrix of the disc. Slow carb (–)
meals in terms of fast and slow carbohydrate content. These defini- compartment model
tions have been based on the patient’s estimate of the amount in-
Roman letters
gested, the weighing of some groceries and by the use of [17].
a Constant in the Ackerman model ðmin1 Þ
116 F. Ståhl, R. Johansson / Mathematical Biosciences 217 (2009) 101–117
[8] R. Johansson, System Modeling and Identification, Prentice-Hall, Englewood [25] J. Brange, A. Vølund, Insulin analogs with improved pharmocokinetic profiles,
Cliffs, NJ, 1993. Adv. Drug Delivery Rev. 35 (1999) 307.
[9] T. Bremer, D. Gough, Is blood glucose predictable from previous values? A [26] D.R.L. Worthington, Minimal model of food absorption in the gut, Med. Inform.
solicitation for data, Diabetes 48 (1999) 445. 22 (1) (1997) 35.
[10] R. Bellazzi, P. Magni, G.D. Nicolao, Bayesian analysis of blood glucose time [27] C. Dalla Man, A. Caumo, C. Cobelli, The oral glucose minimal model: estimation of
series from diabetes home monitoring, IEEE Trans. Biomed. Eng. 47 (7) (2000) insulin sensitivity from a meal test, IEEE Trans. Biomed. Eng. 49 (5) (2002) 419.
971. [28] L. Heinemann, C. Weyer, M. Rauhaus, S. Heinrichs, T. Heise, Variability of the
[11] F. Ståhl, Diabetes mellitus modelling based on blood glucose measurements, metabolic effect of soluble insulin and the rapid-acting insulin analog insulin
Master Thesis TFRT-5703, Department of Automatic Control, Lund University, aspart, Diabetes Care 21 (11) (1998) 1910.
Sweden, April 2003. [29] D. Jenkins, T. Wolever, A. Jenkins, Starchy foods and glycemic index, Diabetes
[12] G. Sparacino, F. Zanderigo, S. Corazza, A. Maran, A. Facchinetti, C. Cobelli, Glucose Care 11 (2) (1988) 149.
concentration can be predicted ahead in time from continuous glucose [30] E. Ackerman, L. Gatewood, J. Rosevear, G. Molnar, Model studies of blood–
monitoring sensor time-series, IEEE Trans. Biomed. Eng. 54 (5) (2007) 931. glucose regulation, Bull. Math. Biophys. 27 (Special issue) (1965) 21.
[13] P. Dua, F.J. Doyle III, E.N. Pistikopoulos, Model-based blood glucose control for [31] L. Ljung, System Identification Toolbox for Matlab, MathWorks, 2002.
type 1 diabetes via parametric programming, IEEE Trans. Biomed. Eng. 53 (8) [32] R. Diagnostics, Accu-Check Compact Glucose (07 2001).
(2006) 1478. [33] E. Carson, T. Deutsch, H. Leicester, A. Roudsari, P. Sonksen, Challenges for
[14] D.J. Cox, L. Gonder-Frederick, L. Ritterband, W. Clarke, B.P. Kovatchev, measurement science and measurement practice: the collection and
Prediction of severe glycemia, Diabetes Care 30 (6) (2007) 1370. interpretation of home-monitored blood glucose data, Measurement (1998)
[15] D.R.L. Worthington, The use of models in the self-management of insulin- 281.
dependent diabetes mellitus, Comput. Methods Programs Biomed. 32 (1990) [34] R. Basu, B. Di Camillo, G. Toffolo, A. Basu, P. Shah, A. Vella, R. Rizza, C. Cobelli,
233. Use of a novel triple tracer approach to assess postprandial glucose
[16] R. Bellazzi, C. Siviero, M. Stefanelli, G. Nicolao, Adaptive controllers for metabolism, Am. J. Physiol. Endocrinol. Metab. 284 (2003) E55.
intelligent monitoring, Artif. Intell. Med. 7 (1995) 515. [35] B. Kovatchev, D. Cox, L. Gonder-Frederick, W. Clarke, Symmetrization of the
[17] Livsmedelsverket, Livsmedelstabell – Energi-och Näringsämnen 2002, blood glucose measurement scale and its applications, Diabetes Care 20 (1997)
Livsmedelsverket, Stockholm, 2002. 1655.
[18] S. Carlström, C.-A. Ingemansson, Juvenile diabetes with long-standing [36] J.B. Miller, Importance of glycemic index in diabetes, Am. J. Clin. Nutr. 59
remission, Diabetologia 3 (1967) 465. (Suppl.) (1994) 747.
[19] R. Illig, A. Prader, Remission in juvenile diabetes, Lancet 30 (1968) 1190. [37] M. Gannon, F. Nuttall, Factors affecting interpretation of postprandial glucose
[20] L. Ljung, System Identification: Theory for the User, second ed., Prentice-Hall, and insulin areas, Diabetes Care 10 (6) (1987) 759.
Upper Saddle River, NJ, 1999. [38] F.X. Pi-Sunyer, Glycemic index and disease, Am. J. Clin. Nutr. 76 (Suppl.) (2002)
[21] K.J. Åström, B. Wittenmark, Computer-Controlled Systems, third ed., Prentice- 290S.
Hall, Upper Saddle River, NJ, 1997. [39] T.M.S. Wolever, D.J.A. Jenkins, The use of the glycemid index in predicting the
[22] L.R.J. Haverkamp, State space identification, theory and practice, Ph.D. Thesis, blood glucose response to mixed meals, Am. J. Clin. Nutr. 43 (1986) 167.
Delft University of Technology, Delft, The Netherlands 2000. [40] S.K. Foster-Powell, J. Brand-Miller, International table of glycemic index and
[23] M. Hanss, O. Nehls, Simulation of the human glucose metabolism using fuzzy glycemic load values: 2002, Am. J. Clin. Nutr. 76 (2002) 5.
arithmetic, in: Fuzzy Inference Proceedings Society, 2000, NAFIPS, 19th [41] M. Kozek, N. Jovanovic, Identification of Hammerstein/Wiener nonlinear
International Conference North America, 2000, p. 201. systems with extended Kalman filters, Proc. Am. Control Conf. (2002) 969.
[24] M. Berger, D. Rodbard, Computer simulation of plasma insulin and glucose [42] Novo Nordisk AS, www.novonordisk.com.
dynamics after subcutaneous insulin injection, Diabetes Care 12 (10) (1989) 725. [43] Eli Lilly and Company, www.lilly.com.