This invention relates to a method and a device for predicting the glucose concentration of a subject and recommending therapeutic action. The responses of the user's glucose to administered doses of insulin, dietary carbohydrates, and other factors influencing glucose concentration are measured individually for a given user. Once these responses are learned as a function of time, the method and device can receive information about the factors which have been recently or will soon be administered and can recommend which other factors should also be administered.
Please help me write a proper abstract based on the patent claims. CLAIM: 1. A medical device for measuring the change in a user's glycemic state in response to outside forces comprising a) a memory module; b) a processor module; c) an electronic communication module; and d) wherein the memory module is configured to receive and store a plurality of glucose concentrations as a function of time that were generated by the user's use of a continuous glucose monitor, and e) wherein the memory module is configured to receive and store the amount and type of insulin the user injected at the time it was injected, the amount of carbohydrates the user consumed at the time they were consumed, and doses of other factors that may affect glucose, and f) wherein the processor module is configured to: i. derive rates of change in the user's glucose concentration as a function of time from the plurality of glucose concentrations stored in the memory module; ii. derive a glucose response as a function of time that is a fit to the plurality of glucose concentrations, insulin doses, carbohydrate doses, and doses of other factors that may affect glucose as a function of time stored in the memory module, the fit being based on a mathematical model; iii. integrate the glucose response as a function of time to obtain the user's total glucose response to insulin doses, carbohydrate does, and doses of other factors that may affect glucose, and g) wherein the electronic communication module is configured to transfer the glucose response functions and their integrated values to a display module or to another medical device, possibly an insulin pump. 2. A medical device for recommending the type and size of a user's insulin dose comprising a) a memory module; b) a processor module; and c) an electronic communication module d) wherein the memory module is configured to receive and store i. a confidence interval of the response of the user's glucose concentration to insulin doses, carbohydrates doses, and doses of other factors that may affect glucose, and ii. a record of insulin doses previously administered to the user as a function of time, iii. a record of carbohydrates consumed and doses of other factors that may affect glucose administered to the user as a function of time, e) wherein the processor module is configured to use a mathematical model to calculate an optimal dose of insulin to be taken by the user in real time by projecting a time series of future glucose concentrations over a predetermined amount of time and minimizing an error function that penalizes deviations away from a predetermined ideal glucose level f) wherein the electronic communication module is configured to send the optimal dose of insulin to a display module or to another medical device, possibly an insulin pump. 3. The medical device of claim 1 wherein the mathematical model is a linear regression where the dependent variable is change in glucose over possibly overlapping time intervals and the independent variables are doses of insulin, dietary carbohydrates, and other factors that may affect glucose summed over windows of time prior to the time window during which the glucose change is being regressed. 4. The medical device of claim 1 wherein the mathematical model is a linear regression where the dependent variable is change in glucose over possibly overlapping time intervals and the independent variables are doses of insulin, dietary carbohydrates, and other factors that may affect glucose multiplied by a polynomial dependent on the time delay between when the dose was administered and when the glucose response is being measured. 5. The medical device of claim 2 wherein the mathematical model's error function penalizes deviations of the glucose concentration below the predetermined ideal glucose level more than deviations of the glucose concentration above the predetermined ideal glucose level, whereby a glucose concentration below the ideal level is made less likely. 6. The medical device of claim 1 wherein the doses of other factors that may affect glucose include duration of exercise engaged in by the user. 7. The medical device of claim 2 wherein the doses of other factors that may affect glucose include duration of exercise engaged in by the user.