Brms without rStan but with CmdStanR?

Hi, my R does not have rStan because I could not get the Makevars to work. Instead, I use CmdStanR and it works.

The Brms package seems to require rStan to function properly. Please correct me if I am wrong. I also see that Brms has a backend option with CmdStan, but I need to research more on this. Can I install and run Brms properly on my machine? Thanks

Yup. You just need to install both brms & cmdstanr, run cmdstanr::install_cmdstan(), then use the backend argument when using brms::brm() thereafter, for example:

brms::brm( 
    ... # model stuff here
    , backend = "cmdstanr"
)
3 Likes

@mike-lawrence thanks for the suggestion! I’m just curious how people actually go about installing brms without rstan? Trying to install brms without rStan installed seems to result in an error because it is a dependency, i.e.,

install.packages("brms", dependencies = FALSE)

results in

ERROR: dependency ‘rstan’ is not available for package ‘brms’
* removing ‘brms’

You need to have the rstan package installed, but you don’t need to actually be set up to compile and run models with rstan.