Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autosens munges the carb sensitivity #1444

Open
dburren opened this issue Dec 29, 2022 · 1 comment
Open

autosens munges the carb sensitivity #1444

dburren opened this issue Dec 29, 2022 · 1 comment

Comments

@dburren
Copy link

dburren commented Dec 29, 2022

Describe the bug
Our ISF describes how insulin affects our BG.
Our ICR describes how much insulin we need for carbs.
That's derived from old-pumping methods.
The more concise CSF is ISF/ICR (as used in the code already) and describes how each gram of carbs affects our BG.

When determine_basal adjusts the ISF based on sensitivityRatio (autosens) that makes sense as it's describing that insulin is affecting us more or less than "normal". However it does not also adjust the ICR, and consequently does adjust the CSF.

This seems fundamentally incorrect:
An increase in sensitivityRatio (needing more insulin) causes a decrease in ISF. Fine.
But with the current implementation it also results in a decrease in CSF, which is saying that carbs are somehow expected to affect our BG less by that same ratio.

Expected behavior
ICR to also be scaled by sensitivityRatio, so that csf is not affected.

oref0 0.7.1

@scottleibrand
Copy link
Contributor

IIRC we tried that, and it worked less well, despite being theoretically more correct. I think it had something to do with how well carbs and insulin matched up when taken together at mealtime. I don't remember a lot of details, but I do remember we did a big simplification of autotune to more directly calculate CR (instead of trying to derive it as ISF/CSF) in May of 2017, if that helps for searching git commit history...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants