Skip to content

Commit

Permalink
Use weighted risk
Browse files Browse the repository at this point in the history
As per jxx123#63
  • Loading branch information
drozzy authored Sep 12, 2023
1 parent 8a9e530 commit 6b0b068
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion simglucose/analysis/risk.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@ def risk_index(BG, horizon):
rh = 10 * fBG[fBG > 0]**2
LBGI = np.nan_to_num(np.mean(rl))
HBGI = np.nan_to_num(np.mean(rh))
RI = LBGI + HBGI
weight_rl = len(rl) / horizon
weight_rh = len(rh) / horizon

RI = weight_rl * LBGI + weight_rh * HBGI
return (LBGI, HBGI, RI)

0 comments on commit 6b0b068

Please sign in to comment.