FelicienLL / mapbayr

Easy Maximum A Posteriori Bayesian Estimation of PK parameters in R.
21 stars 2 forks source link

Simplify model specification: don't duplicate ETA #189

Open FelicienLL opened 1 year ago

FelicienLL commented 1 year ago

Starting from version 1.0.8, mrgsolve can simulate from a specific set of ETAs thanks to the etasrc = "data" argument. This is an opportunity to remove the need to declare ETAs in $PARAM in the model code. Some issues remain pending about backward compatibility and the general workflow (from estimations to simulations). We are just thinking out loud here.

Think about:

The "posterior" simulation step:

use_posterior() currently returns the model object with updated values of ETA in $PARAM. This way, we can run "regular" simulations easily, nothing being specific to mapbayr. This would not be possible anymore since the information about ETA is not carried by the model object anymore. Also remind that use_posterior() can also return a Gaussian approximation of the posterior in $OMEGA, useful for a rough appreciation of parameter uncertainty. What to do?

model %>% data_set(data) %>% with_estimated_eta(est) %>% mrgsim()


Also remind that `use_posterior()` can also return a gaussian approximation of the posterior in `$OMEGA`, useful for a rough appreciation of parameter uncertainty. 

Some things that would need to ask for feature requests to mrgsolve: 
- possibility to store the information about ETA inside the model, say a `@eta` slot, and the possibility to ask for `etasrc = "etaslot"`. Information could be a matrix (i.e. one vector per individual) or a 3-dimension array (one matrix per individual) if a full posterior matrix is provided, whatever...
- possibility to read ETA from `idata_set` or `ev`?

More to come