pzivich / Delicatessen

Delicatessen: the Python one-stop sandwich (variance) shop 🥪
https://deli.readthedocs.io/en/latest/index.html
MIT License
22 stars 2 forks source link

Pharmacokinetic models #46

Open pzivich opened 2 months ago

pzivich commented 2 months ago

Is your feature request related to a problem? Please describe.

Add more support for pharmacokinetic models (like existing dose-response models). This topic area is a bit unfamiliar to me, but I can add the models from Bonate's book as I read through it. This issue will be a place for me to collect those models. I will also need to look around for external software or examples to compare to.

These would replace the current estimating_equations/dose_response.py file with the more general estimating_equations/pharmacokinetics.py file. Since all imports are done in estimating_equations/__init__.py this won't change anything on the user side.

Describe the solution you'd like

Add corresponding estimating equations

Describe alternatives you've considered

None

Additional context

Bonate PL. "Pharmacokinetic-Pharmacodynamic Modeling and Simulation" 2nd edition.

pzivich commented 2 months ago

E_max pharmacokinetic model from pg 101 of Bonate.

E = {E_max C} / {E_50 + C}

where E is the observed effect, E_max is max effect, EC_50 is the concentration with 50% of maximal effect, and C is concentration. Score function is given in Equations 14 and 15 on pg 102.

\psi_emax = (Y - {E_max C} / {EC_50 + C}) (C / {EC_50 + C}) \psi_ec50 = (Y - {E_max C} / {EC_50 + C}) ( {-E_max C} / {EC_50 + C}^2)

Figure 1 of Chapter 3 might be good to replicate?

Another option is the simulation on pages 135-136 shown in Figure 5.

Better yet, there is an example on 151 with data in Table 9 and SAS code in Appendix 2 to compare against

pzivich commented 2 months ago

Example with data from Table 22 on page 185

pzivich commented 2 months ago

This also links back to #6

pzivich commented 2 months ago

More model options (and software to check against)

https://cran.r-project.org/web/packages/DoseFinding/DoseFinding.pdf

pzivich commented 2 months ago

I am going to update how the log-logistic models work. They are going to be replaced with a general function, rather than have the parameter-specific models. This is going to come with #50

pzivich commented 1 week ago

Some notes on E-max models

https://blog.djnavarro.net/posts/2024-01-09_emax-models/

pzivich commented 1 week ago

A side-note here: The DoseFinding documentation claims that " the toxicology literature this model is also called four-parameter log-logistic (4pLL) model". I think this is untrue. When comparing to Ritz et al., their 4P log-logistic model is of a different form. Further, comparing DoseFinding's sigEmax and drc's drm with fct=LL.4() give different results. Specifically, the lower limit and upper limit are close but do not match.

I spent like a week on this issue. What I've learned is that the language is a mess. Always look at the math

pzivich commented 4 days ago

New structure in v2.3 with E-max and 4P-log-logistic models. There are some other models I may consider adding in the future. But for near future, don't have any specific to add