A processor-implemented method of determining an amount of glycemic dysfunction, the method comprising receiving continuous glucose monitoring, CGM, and insulin data pertaining to a subject, wherein the CGM and insulin data comprise an insulin bolus amount and a timing for the insulin bolus amount; identifying, using a blood glucose risk function, numerically optimal boluses to be inserted into a replay predictive function at times of historical boluses; performing a replay analysis on the CGM and insulin data with the optimal boluses at the times of the historical boluses using the replay predictive function and historical insulin data as inputs, wherein the output of the replay analysis comprises replayed CGM data for the optimal boluses at the historical bolus times and replayed insulin data for the optimal boluses at the historic bolus times; quantifying an amount of glycemic dysfunction using the replay analysis by: performing an insulin on board, IOB, assessment for historical data using the historical insulin data as input; performing an insulin on board, IOB, assessment for the optimal boluses at the historical times using the replayed insulin data for the optimal boluses at the historical times as input; and performing an IOB trace discrepancy analysis using as inputs the output of the IOB assessment for the historical data and the output of the IOB assessment for the optimal boluses at the historical times, wherein the output of the IOB trace discrepancy analysis comprises an IOB trace similarity score that is determined using a comparison of a first IOB trace based on a record of actual boluses and a second IOB trace of optimal boluses; and providing an output representative of the amount of glycemic dysfunction. receiving continuous glucose monitoring, CGM, and insulin data pertaining to a subject, wherein the CGM and insulin data comprise an insulin bolus amount and a timing for the insulin bolus amount; identifying, using a blood glucose risk function, numerically optimal boluses to be inserted into a replay predictive function at times of historical boluses; performing a replay analysis on the CGM and insulin data with the optimal boluses at the times of the historical boluses using the replay predictive function and historical insulin data as inputs, wherein the output of the replay analysis comprises replayed CGM data for the optimal boluses at the historical bolus times and replayed insulin data for the optimal boluses at the historic bolus times; quantifying an amount of glycemic dysfunction using the replay analysis by: performing an insulin on board, IOB, assessment for historical data using the historical insulin data as input; performing an insulin on board, IOB, assessment for the optimal boluses at the historical times using the replayed insulin data for the optimal boluses at the historical times as input; and performing an IOB trace discrepancy analysis using as inputs the output of the IOB assessment for the historical data and the output of the IOB assessment for the optimal boluses at the historical times, wherein the output of the IOB trace discrepancy analysis comprises an IOB trace similarity score that is determined using a comparison of a first IOB trace based on a record of actual boluses and a second IOB trace of optimal boluses; and performing an insulin on board, IOB, assessment for historical data using the historical insulin data as input; performing an insulin on board, IOB, assessment for the optimal boluses at the historical times using the replayed insulin data for the optimal boluses at the historical times as input; and performing an IOB trace discrepancy analysis using as inputs the output of the IOB assessment for the historical data and the output of the IOB assessment for the optimal boluses at the historical times, wherein the output of the IOB trace discrepancy analysis comprises an IOB trace similarity score that is determined using a comparison of a first IOB trace based on a record of actual boluses and a second IOB trace of optimal boluses; and providing an output representative of the amount of glycemic dysfunction.