jxx123 / simglucose

A Type-1 Diabetes simulator implemented in Python for Reinforcement Learning purpose
MIT License
232 stars 109 forks source link

Clarity on calculation of parameters apha and beta #75

Closed edger-asiimwe closed 5 months ago

edger-asiimwe commented 5 months ago

The empting rate, kempt(qsto) of the liquid compartment of the stomach in this code is described below which I understand is kqut in this case.

if Dbar > 0:
    aa = 5 / 2 / (1 - params.b) / Dbar
    cc = 5 / 2 / params.d / Dbar
    kgut = params.kmin + (params.kmax - params.kmin) / 2 * (
        np.tanh(aa * (qsto - params.b * Dbar)) -
        np.tanh(cc * (qsto - params.d * Dbar)) + 2)
else:
    kgut = params.kmax

In this paper, A System Model of the Oral Glucose Absorption: Validation on Gold Standard Data shows that the parameters alpha (aa) and beta (cc) are as follows: image Translating it to python would yield the code below

aa = 5 / ( 2 * Dbar * (1 - params.b))
cc = 5 / (2 * Dbar * params.d)

I understand both yield the same result. For purposes of consistency and readability of the code with the equations in the @paper, do you think we can adopt the later option for this case?

@jxx123

jxx123 commented 5 months ago

Sure, do you mind sending me a Pull Request? I can stamp it.

edger-asiimwe commented 5 months ago

I have updated the parameter alpha and beta via this pull request

Thanks!