paul-buerkner / brms

brms R package for Bayesian generalized multivariate non-linear multilevel models using Stan
https://paul-buerkner.github.io/brms/
GNU General Public License v2.0
1.28k stars 186 forks source link

multiresponse modeling #1509

Open TinyvanBoekel opened 1 year ago

TinyvanBoekel commented 1 year ago

Would it be possible to make brms suitable for multiresponse modeling, i.e., to have several measured responses that are supposed to be generated from linked models (in most cases represented by ordinary differential equations, ODEs). These measured responses will be characterized by a covariance matrix, i.e., the responses will in many cases be correlated somehow. Just as a simple example, suppose a chemical reaction of A -> B -> C where all three components are measured and the fate of all three components is represented by different but linked equations (ODEs) that share parameters. The goal is then to estimate these shared parameters (including the unknown experimental covariance matrix). Stan is able to handle this type of modeling but it would be so much easier if it can be done in brms as well.

paul-buerkner commented 1 year ago

Thank you for opening this issue! The goal is to get this to work in brms 3.0+

wds15 commented 1 year ago

As I myself want to use brms for PK/PD models (PK: drug concentration over time; PD: effect of concentration over time) I had to look into this. From my basic understanding it is possible to do it with some caveats and a big&dirty trick: The parameters which are shared between the two non-linear models must be declared as missing data. Doing so makes these parameters being modelled as their own response and I can use these parameters as inputs to the PK and the PD model. I am sure missing data bits were not intended in brms for this purpose, but it does seem to work ok. Getting joint models to work more easily would be great to have indeed. If it is worthwhile I will try to come up with a more simple example compared to what I am looking at right now... which is the PK/PD model for Warfarin.