Reconstructing Control-IQ+'s 30-minute forecast
Control-IQ+ bases every decision on a forecast of glucose 30 minutes ahead. From 154 forecasts stored in our pump's log, a simple formula reproduces it to within about 0.1 mmol/L. It extends the last 15 minutes' trend, and overshoots when a rise is slowing. We tested what happens if the newest reading counts more.
Updated on 25 November 2026. The formula is now fitted with the readings the pump had about 30 seconds before each basal change, when Control-IQ+ actually calculates (see the corrected timing post). The fit got tighter and the numbers below changed slightly; the conclusions didn’t.
Everything Control-IQ+ does starts with one number: its forecast of the sensor value 30 minutes from now. If the forecast is 10.0 mmol/L or more, the pump may give an automatic correction. At 8.9 or more it raises basal insulin; at 6.25 or less it lowers it (these are the thresholds while awake). The first post found that the forecast at automatic corrections ran a median 2 mmol/L above what happened. The second found that it is built on a reading that can be up to five minutes old.
This post asks how the forecast is made. Our pump’s log turned out to be enough to reconstruct it closely, and to test a simple idea: what if the newest reading counted for more?
This is one child’s pump and sensor data, summarised as aggregates. It’s an observation, not a study, and not advice. Nothing here is something a user can change: the forecast is built into the pump. We haven’t changed anything because of it; questions like this go to our diabetes team.
What Tandem says
Tandem doesn’t publish the formula. The Tandem Mobi user guide says the algorithm “uses continual feedback of Estimated Glucose Values (EGVs) from a Continuous Glucose Monitor (CGM), user-reported carbohydrate entries, insulin delivery history, and user weight to predict estimated blood glucose 30 minutes in the future” (section 32.11, page 404). The FDA’s decision memorandum for the original Control-IQ (DEN190034, 2019) describes it the same way, and notes that users must enter their weight and total daily insulin. The University of Virginia researchers who developed the algorithm describe it as using “CGM-based patient state estimation” (Brown et al., 2018).
None of these says how the inputs are combined, or how much each one counts. That’s what the log can show.
What the pump lets us see
The pump doesn’t log its forecast at every cycle. We checked a full day of the raw log from Tandem’s cloud service, and there is no such field. But every time Control-IQ+ gives an automatic correction, it stores a glucose value with it, and that value behaves like the 30-minute forecast. From 2026-09-28 to 2026-11-25 there were 160 automatic corrections; 154 of them had a complete half hour of readings before them (the rest followed a gap in the sensor data). Their stored forecasts ran from 10.0 to 20.9 mmol/L.
For each one we took the readings the pump had logged when that cycle calculated, 30 seconds before the pump logged its basal change (as in the previous post), and looked for a formula that turns the last half hour of readings into the stored forecast.
The formula
A plain straight line through the recent readings doesn’t fit. Extending the last 15 minutes’ slope for 30 minutes missed the stored forecast by 0.9 mmol/L on average, and a line through the last 20 minutes by 0.9. But a weighted sum of the recent changes fits almost exactly:
forecast ≈ 0.93 × current reading + 0.43 mmol/L
+ 1.33 × the last 5-minute change + 1.49 × the one before + 1.25 × the one before that
+ 0.14 × the change 15–30 minutes ago
In words: take the current reading, and add about 1.4 times the rise of the last 15 minutes, with the three newest 5-minute changes counting about equally. The older changes barely count. The first two terms pull the result slightly toward 5.7 mmol/L. If glucose rose 1.5 mmol/L in the last 15 minutes, the forecast lands about 2.0 mmol/L above the current reading (a little less at high values): the rise is assumed to continue for roughly another 20 minutes.
Tested fairly, each forecast predicted by a formula fitted on the other 153, it reproduced the stored value to within a median 0.1 mmol/L (mean 0.11, 90% within 0.24). Tandem lists insulin delivery history and carbohydrate entries among the inputs, yet the formula uses neither. Adding insulin on board, which the pump also stores with each correction, made no measurable difference, and the fit was this close without carbohydrates. That doesn’t mean they aren’t used. Automatic corrections only come when no bolus has been given in the last hour, so at these moments their effect may be small or similar from case to case. What we can say is that at these moments the sensor curve explains almost all of the forecast.
Two checks
A formula fitted to 154 numbers could fit by accident. Two checks say it doesn’t.
A turning point. On 2026-11-25 at 11:53:49 the pump logged a basal change and a correction a second before the newest reading arrived, with a stored forecast of 13.4 mmol/L (242 mg/dL). We refitted the formula without that correction. Fed the readings the pump had, it gives 241.4 mg/dL, within a mg/dL. Fed the reading that arrived a second later, the first one down, it gives 11.3 mmol/L. The formula independently confirms that the cycle used the older reading.
Every basal decision. The user guide says when Control-IQ+ changes basal insulin while awake: it lowers it when the forecast is 112.5 mg/dL (6.25 mmol/L) or less, stops it at 70 mg/dL (3.9) or less, and raises it at 160 mg/dL (8.9) or more (Tandem Mobi user guide, section 28.3, page 287). We ran the formula on all 10,461 awake basal decisions, none of which were used to fit it:
- When the pump lowered or stopped basal (4,172 decisions), the formula’s forecast was above 6.5 mmol/L in only 7 of them.
- When it raised basal (559), the formula’s forecast was at least 9.3 in 95% of them, and below 8.6 in only 0.
Both match the guide’s thresholds. One thing doesn’t: in 1,975 decisions the formula’s forecast was 8.9 or more and the pump still kept the programmed rate. Something else limits basal increases. The guide says the maximum rate depends on the correction factor, the total daily insulin and the insulin on board (page 283), which may be part of it, but the log doesn’t show the limit.
What the formula does well, and badly
With the formula we can compute Control-IQ+’s forecast at every reading, not just at corrections, and compare it with what the sensor showed 30 minutes later. That’s 16,196 readings. Averaged over all of them, the forecast was off by 1.2 mmol/L, with almost no overall bias. But the average hides where it goes wrong:
- When a rise is slowing (up at least 0.5 mmol/L in 15 minutes, last step smaller than the one before), the forecast was a mean 2.1 mmol/L too high.
- When glucose was falling, it was 1.2 mmol/L too low.
- When glucose was flat, it was close: off by 0.8 on average, with little bias.
Both errors come from the same thing. The formula assumes the last 15 minutes continue, and gives the newest change no more weight than the two before it. When a rise is turning, the newest change is the first to show it, and the formula averages it away. That fits what we saw in the first post: corrections that came when the rise was already over.
What if the newest reading counted more?
That was our feeling: give the newest change more weight, and the forecast would notice a turn sooner. We tested it by keeping the formula’s total weight on the last 15 minutes and moving it toward the newest step. λ says how fast the weight falls off: at λ = 0.5 each step counts half as much as the one after it, and at λ = 0 only the newest step counts. We also tried halving the whole trend. Each cell is the average error in mmol/L, with the average bias in brackets (positive = too high):
| Forecast | All | Rise slowing | Rise steady | Falling | Flat |
|---|---|---|---|---|---|
| Control-IQ+ (reconstructed) | 1.2 (−0.1) | 2.4 (+2.1) | 1.6 (+0.5) | 1.6 (−1.2) | 0.8 (−0.1) |
| Newest step counts more (λ = 0.5) | 1.1 (−0.1) | 2.1 (+1.9) | 1.6 (+0.8) | 1.5 (−1.2) | 0.8 (−0.1) |
| Newest step only (λ = 0) | 1.1 (−0.1) | 1.8 (+1.4) | 1.8 (+1.3) | 1.5 (−1.2) | 0.8 (−0.1) |
| Half the trend | 1.0 (−0.1) | 1.6 (+1.1) | 1.4 (−0.3) | 1.3 (−0.5) | 0.8 (−0.1) |
| Newest step only, half the trend | 0.9 (−0.1) | 1.4 (+0.8) | 1.3 (0.0) | 1.2 (−0.4) | 0.7 (−0.1) |
The feeling was right, as far as it goes. Putting all the trend weight on the newest step cut the error when a rise was slowing from 2.4 to 1.8 mmol/L, and the overall error from 1.21 to 1.12. It costs a little when a rise is steady (1.6 to 1.8): one 5-minute change is noisier than three.
But the bigger problem is the size of the trend, not only how it’s spread. Halving it helps at least as much, and combining both gave the lowest errors of these five in every situation. The forecast is simply too eager to extend a trend.
There’s a catch, and it matters most for a small child. The forecast also decides when to cut insulin before a low. Of the 79 readings followed by a low (3.9 mmol/L or less) 30 minutes later, Control-IQ+’s forecast was low enough to lower basal at 67 of them and to stop it at 28.
| Forecast | At or above 10.0: followed by under 10.0 | Before a low: low enough to lower basal | Before a low: low enough to stop basal |
|---|---|---|---|
| Control-IQ+ (reconstructed) | 971 of 1,923 (50%) | 67 of 79 | 28 of 79 |
| Newest step counts more (λ = 0.5) | 910 of 1,877 (48%) | 70 of 79 | 31 of 79 |
| Newest step only (λ = 0) | 878 of 1,883 (47%) | 70 of 79 | 31 of 79 |
| Half the trend | 672 of 1,527 (44%) | 67 of 79 | 9 of 79 |
| Newest step only, half the trend | 591 of 1,473 (40%) | 70 of 79 | 7 of 79 |
Moving weight to the newest step keeps the early warning before lows: the forecast was low enough to stop basal before 31 of 79 lows, against 28 now. Halving the trend loses most of it: only 9. A calmer forecast is a better forecast on average and a slower alarm before a low. That’s a trade-off for the people who design the algorithm, not something to settle from one family’s log.
For the automatic corrections themselves: with only the newest step counting, 32 of the 154 corrections would not have met the forecast condition (10.0 or more). Thirty minutes later, those 32 moments were at a median 8.2 mmol/L, against 9.9 for the corrections that would still have come.
How good could it be?
As a reference, we fitted the formula to what actually happened instead of to Control-IQ+’s stored forecasts, using the same readings: fitted on 2026-09-28 to 2026-10-27 and tested on the rest. On the test period it was off by 0.88 mmol/L on average, against 1.17 for Control-IQ+’s formula, and by 1.1 instead of 2.3 when a rise was slowing.
Its shape is in the chart above. It puts most of the weight on the newest change, and a negative weight on the one before. In other words, it reacts to the change in the trend: a rise that’s slowing pulls the forecast down. That’s the “more weight on the newest reading” idea taken one step further.
This reference flatters itself in one way. It was fitted to glucose under Control-IQ+, which was already acting on its own forecast. A forecast that learns from those outcomes partly learns what the pump did next. It shows how much information is in the last half hour of readings, not what a different algorithm would achieve.
What this can’t tell us
- What would actually happen. All of this scores forecasts against what happened with the real Control-IQ+. A different forecast would have changed basal and corrections, and so the glucose that followed. Answering that takes a simulator or a trial.
- Whether it’s the same for everyone. One child, one pump, one software version. The formula’s numbers might depend on settings such as weight or total daily insulin, which we can’t vary.
- The forecast outside corrections. The formula was fitted only at corrections, when glucose was 10–21 mmol/L by the forecast and rising. The basal check suggests it holds lower down too, but we can’t see the pump’s own forecast there.
- Tandem’s real method. This is a description of what the forecast does, not of how Tandem computes it. Tandem lists more inputs than our formula needs.
Questions for Tandem
- Is the 30-minute forecast, in practice, a weighted extension of the last 15 minutes of sensor data, as it looks from the outside? How much do insulin delivery and carbohydrate entries change it?
- Has a forecast that weights the newest reading more, or reacts to a slowing trend, been evaluated, including its effect on early warnings before lows?
- What limits basal increases when the forecast is above 160 mg/dL?
- Could the forecast be shown to users and their care teams?
Caveats
- The stored value we treat as the forecast is undocumented. Its match with the basal thresholds supports that reading.
- The simulation compares formulas on the same moments. Errors are against the sensor, which itself lags blood glucose by several minutes.
- Situations are defined by simple rules on the last 15 minutes. Other definitions would give somewhat different numbers.
The analysis script and a description of the method are in the site’s repository.