Can be similar to what I did in the intervalcalc package
See:
https://github.com/medewitt/intervalcalc/blob/2b759d5ac483e1358ac3bd02b0148bd805db603b/R/fit_interval_data.R#L20
This one is a bit more complicated because I loop through several Stan fits, but it is something...