Open danielinteractive opened 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.
@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.
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:
brms
is doing thisstan
andcmdstanr
might support this out of the box