Rebuild brmsfit from cmdstan CSV files

I fit a model using brms some time ago. Now on my computer I can find the CSV files containing the draws (using the cmdstanr backend) but not the associated brmsfit object. I still have the script that includes my call to brms. Is there a good way to rebuild the brmsfit object using the original call and the saved CSVs without refitting?

@paul.buerkner

You can try to load the CSV via cmdstanr, creat an empty brmsfit object and then combine the two by copying code over from brms:::.fit_model_cmdstanr (see brms/backends.R at master · paul-buerkner/brms · GitHub for the code). Not the most elegant solution but I don’t have a move convenient idea right now.

3 Likes