Running brm doesnt work on mac but runs on windows

Hi all, I am new to brm() and wanted to use it to run a model for my analyses. I do get the following error-message as I call brm():
Stan model ‘anon_model’ does not contain samples.
Error in, sampler_params) : second argument must be a list

I m running the code on an M2 chip and sonoma as operating system. I installed the scode CLI and gfortran using the macrtools package.
I then installed the required packages from source. My model runs on a windows system using rtools perfectly fine. But I get the error above.

    data = df1,
    family = cumulative("probit"),
    prior = prior_spec,
    chains = 4,
    iter = 4000,
    warmup = 1000,
    control = list(adapt_delta = 0.80, max_treedepth = 10),
    save_all_pars = TRUE,
    init = 0 , 
    sample_prior = TRUE,
    seed = 42,
    file = paste("model_fits", paste0(model_name, ".r"), sep = "/")

  • Operating System: macos 14.0

I am looking forward to any help on this. I think it is likely that my environment is not setup properly to run brm(). I will add more specific information if needed.

Do you have xcode installed as well? I have not tried to run brms or Stan on the M series of chips without installing xcode first.

1 Like