Correction: Personalized glucose forecasting for type 2 diabetes using data assimilation

[This corrects the article DOI: 10.1371/journal.pcbi.1005232.].


Dual Unscented Kalman Filter
A dual unscented Kalman filter (UKF) was used for simultaneous estimation and tracking of model states and parameters. This methodology approximates the distribution of states by running the model with a simplex of sigma points as initial conditions. The process begins by initializing state and parameter estimates and covariances for a model system with n x states and n w estimated parameters.
Weighting schemes W for determining mean state estimates and covariances were assigned using the methodology described by Wan and van der Merwe [1]. Set weights for the state filter: Set augmented weights for the state filter: Set weights for the parameter filter:

UKF State Filter
The state filter of the dual UKF uses the most recent estimates of parameter means w k−1 , as well as the most recent estimate of state mean,x k−1 , and state covariance P x k−1 to approximate the posterior distribution of the model's mapping of the current state distribution into the future. First, compute sigma points around the current state estimate: where ( (n x + λ x )P x k−1 ) i is the i th column of the matrix square root. Apply constraints for real positivity to sigma points.
Compute the posterior sigma points χ * i,k|k−1 using the mapping (the model) f .
Compute the mean and covariance of posterior sigma points χ * i,k|k−1 , and add the assumed model process noise R v to the posterior covariance estiamte: Augment posterior sigma points: Compute measurement forecast: Compute Kalman gain, where R n denotes assumed measurement noise.
Update state covariance: Update state estimate:x where y k is the k th measurement.

UKF Parameter Filter
The parameter filter of the dual UKF uses the most recent estimates of parameter means, w k−1 , and their covariance P w k−1 , as well as state estimate,x k−1 , to approximate the posterior distribution of parameters, w k [2]. This is done by creating sigma points that approximate the distribution of w k , and collecting the measurement forecasts created by the state mappings performed with each of the parameter sigma points, W i,k|k−1 . First, iterate parameter estimates and their covariance: where and diag(·) indicates setting off-diagonal entries to 0. Compute sigma points around parameter estimate: Apply constraints for real positivity to sigma points.
PLOS 3/5 Compute Kalman gain: Update parameter covariance: Update parameter estimate:ŵ where y k is the k th measurement.
Assumed process noise covariance R n diag((q n · v obs ) 2 ) Assumed measurement noise covariance The assumed process and measurement noise variance, R v and R n , respectively, were computed as fractions (q v and q n ) of the time-averaged state values, v all . We considered model process noise to have a standard deviation of 40% of v all . R n was considered to have a standard deviation of 1% of average measurement values; although typical glucometers have error closer to 10%, we found it advantageous to artificially lower R n in order to weight measurements more severely and, thus, train the model more quickly. Time-averaged state values, v all , were computed using simulated initial states and nutrition.