Complier errors M1 Pro Macs

I have just migrated to Mac and for some reason my code does not work. The example code runs fine though which is surprising.

But when I run my code which works fine on Windows gives the following errors

Any suggestions ?

This is merely a guess based on the error message but I wonder whether you are running into the same error as 2.16.1 and adapt_delta.

That thread seems to indicate that using control = list(adapt_delta = 0.8) leads to some problems with rstan 2.12.2. You could delete the control argument to test. The thread also indicates that switching to cmdstanr might be an option.

@stijn Thank you. That worked. However if I cannot change adapt_delta manually in case of divergences. I might indeed have to move to cmdstan. I however am worried my system my not be able to run the model using cmdstan since on cmdstan there is no way to specify which parameters to save samples for and considering that in my case there are significantly high number of parameters, that might be an issue.

Unless you can suggest a work around?

I think you could try to install the github version of rstan which is not available on CRAN yet.

install.packages("rstan", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))

Or any of the proposed solutions in this thread: Can't install latest version of Rstan

If the worry has to do with memory, than cmdstanr might still be fine because it does not keep all samples in memory (or at least there is an option to not do that) but saves them to a .csv file.

Tried installing rstan from source worked. Thanks

1 Like