Add samples to existing brmsfit?

Is there a way to add samples to an existing brmsfit object? Something like update(fit, iter=2000, add = TRUE) that would then skip the warmup and continue adding samples. If there were 1.000 post-warmup samples, running the above would bring it to 3.000.

I have tried hacking together a solution merging brmsfit objects by manipulating fit$fit (a stanfit object). The goal was to be able to do something like this:

fit1 = brm(model1, data1, prior1, iter=2000, chains=2)
fit1 = brm(model1, data1, prior1, iter=2000, chains=4)
fit_all = merge_brm(fit1, fit2)  # contains 6 chains

It works when using hypothesis and others, but crashes the R session when simply printing the fit summary, indicating that something is wrong.

1 Like

This will be possible once Stan itself supports it, which is currently not the case.

To combine multiple fitted models, use combine_models.

1 Like

Don’t know how I missed that. Thank you!