Problematic sampiling with brms after updating cmdstan

Hi All,

I can really use your help!

I updated cmdstan and brms. I get the following error when I start sampling, and then it ‘settles’ for a while, but at the end Rhats are very high. I tried y ~ x + (x|group) with two different datasets and different variables that previously had no issues and gave good results. This also happens for logistic…

We have a deadline and the main workhouse is out of service… :(
Any idea whats going on??


model = brm(y~ x+ (x | group), data = df ,chains = 4, warmup  = 2000, iter    = 2250,  cores   = 4,backend='cmdstan')

This is cmdstanr version 0.6.1
- CmdStanR documentation and vignettes:
- CmdStan path: C:/Users/user/Documents/.cmdstan/cmdstan-2.32.2
- CmdStan version: 2.32.2

> packageVersion("brms")
[1] ‘2.20.3’

No idea what’s going on yet unfortunately, but cmdstanr::install_cmdstan() has a version argument, so you could install 2.31.0 or an older version of those worked for you.

1 Like

Thanks. Do I need to uninstall anything, or just re-install a previous version?

Do the warnings occur only a handful of times at the start of sampling, or do they occur frequently throughout sampling or error?

1 Like

Only a handful of times at the start of sampling

Then like the warning says, it’s likely safe to ignore - it’s just the sampler initially exploring the parameter space.

If you’re concerned or would like someone to investigate more, then you’ll need to share a reproducible example so that we can debug locally


I agree with everything @andrjohns said, but if you are really running into convergence issues (e.g. high R-hats) with the same model and data that ran fine before then that is somewhat alarming (I assume that’s what you mean by “previously had no issues”). If you could share a reproducible example where the behavior is fine with an older version of the software (cmdstan and/or brms) and problematic with a newer version of the software that would be really helpful.


I think this is just cmdstan being more verbose with warnings. I.e. the “problem” existed before but wasn’t communicated in bright red letters. And, as @andrjohns said, if it only happens a few times early on, you can do as the warning says and ignore it.

1 Like

Many thanks everyone. I hope that indeed this is just a verbose warning… I
If you can teach me how to move from one cmdstan to another on the same computer, I can try generating some replicated example to compare rhats with the same model and data.

  1. When installing cmdstan, do you have to remove the previous version?
  2. Can I switch from one version of cmdstand to another with setting PATH or is there another way?


You should be able to tell cmdstanr which cmdstan to use via cmdstanr::set_cmdstan_path().

You don’t have to remove old versions, they’re installed in their own directories.

1 Like