How to obtain Bayes Factor for model comparison with CmdStanR fit object?

Hi everyone -

I am trying to obtain Bayes Factors for model comparison (more than two models), and I used cmdstan_stan to fit all models. I’ve tried functions from different packages such as bayestestR and brms but failed because the CmdStanR fit object is incompatible with those functions according to the error message.

I also tried to convert the CmdStanR fit objects into RStan fit objects. Though the converting process is successful, the Bayes Factor using the bayesfactor() function takes forever and I never get the output.

I wonder how I should proceed, or at least try. Any answer/direction/advice/idea would be much, much appreciative. Thanks much.


Also, I wonder if, as the frequentist approach, I can obtain the Bayes Factor via exponentiating the difference in WAIC or LOOIC between each two models. Namely:

exp( (WAIC_min - WAIC) / 2)

But I am scratching my head over its implication that Information Criteria and Bayes Factor are directly interchangeable…