Genentech / jmpost

https://genentech.github.io/jmpost/
17 stars 4 forks source link

Design for prior predictive checks #167

Open danielinteractive opened 1 year ago

danielinteractive commented 1 year ago

Considering having a solution for prior predictive checks, as implemented in brms (using sample_prior="only"). This is indeed very relevant in the case where the longitudinal submodel is nonlinear and therefore, convergence can be quite sensitive to the choice of priors and initial values for parameter estimates.

To do:

gowerc commented 1 year ago

In terms of Stan's "native" support according to their documentation they just provide regular sampling functions and then get your to write custom code in the generated-quantities block

generated quantities {
  real alpha = normal_rng(0, 1);
  real beta = normal_rng(0, 1);
  real y_sim[N] = poisson_log_rng(alpha + beta * x);
}

I'm guessing this would mean we'd need to get each model to implement its own sampling component. Could get very tricky with the dynamic link functions as well.

danielinteractive commented 1 year ago

@gowerc ok - how does brms do this?

The longitudinal outcomes would be relatively easy to write as generated quantities. But the survival outcome would be more complicated. I think Yannik needed to follow a similar path recently, ending up implementing random number generator for the survival outcomes.