nlmixrdevelopment / nlmixr

nlmixr: an R package for population PKPD modeling
https://nlmixrdevelopment.github.io/nlmixr/
GNU General Public License v2.0
114 stars 45 forks source link

Weighting MAP algorithm #609

Closed namtien0312 closed 2 years ago

namtien0312 commented 2 years ago

Dear Dr. @mattfidler

I want to modify (weighting) the MAP algorithm in nlmixr as presented in this article, in which they multiply the equation term by by some values (1, 0.5, 0.2, ...) with 1 illustrating the traditional MAP (est = "posthoc").

Are any solutions for me, I also tried to find the source code of posthoc in the R folder but I did not find it.

Thank you very much, Tien.

mattfidler commented 2 years ago

The posthoc code is in C++ in the inner.cpp code. It maximizes the focei likelihood which is also slightly different (but is likely equivalent to) what is presented in the paper.

Currently there isn't a simple way to specify a prior to flatten the term by some values..

mattfidler commented 2 years ago

I plan to eventually add a penalized likelihood as in the below:

https://monolix.lixoft.com/data-and-models/bayesianestimation/

This may be adapted to do something similar to the paper above

namtien0312 commented 2 years ago

Thank Dr for your explanation and suggestion in Monolix. I hope it is going to be available in nlmixr.

Tien.

FelicienLL commented 2 years ago

Hi, Correct me if I'm wrong, but for me, multiplying this term of the equation by 1, 0.5, 0.2... is the same as making a standard map estimation but with omega2 divided by 1, 0.5, 0.2... So I 'd just advise to update your omega matrix before starting the map estimation.

mattfidler commented 2 years ago

That ahould work for this problem. Thanks @FelicienLL

namtien0312 commented 2 years ago

Thank you two very much for the suggestion.

With the Bayes theorem, If I want to flat the prior term then I need to increase the SD of this distribution leaving more belief in the data. In the popPK with individual parameter estimation, the prior here is the p(theta_i), theta = (Cl, Vd, Q,..), and this distribution is dependent on omega, p(theta_i) ~ logN(theta_pop, omega). As result, is it true that I need to increase omega here to expand the prior distribution? And should we use multiplication instead of division here, Dr @FelicienLL? I am not from a mathematical background, thank you two again for the explanation!

By the way, Dear Dr @mattfidler,

I plan to eventually add a penalized likelihood as in the below:

https://monolix.lixoft.com/data-and-models/bayesianestimation/

This may be adapted to do something similar to the paper above

This algorithm here is the MAP for population-level (u, Beta, sigma, omega). Is the approach available in nlmixr? Or is the Bayesian method for population estimation available, such as illustrated here?

FelicienLL commented 2 years ago

That's it. Just increase the inter-individual variability. If you want to multiply prior weight by 0.5, it is the same as multiplying omega2 by 2.

mattfidler commented 2 years ago

The MAP estimates are not available yet. Nor is a full Bayesian estimation available. You can try stanette or torstan for full Bayesian estimation.

Eventually these may make it into the nlmixr core.

namtien0312 commented 2 years ago

Thank Dr. Matt Fidler for the information. Hope it will be available soon in nlmixr.

Tien.