Largest Rhat is NA when one parameter is fixed to a constant

No don’t add jitter. The suggestion to add jitter was from someone who did not know there is a proper fix for the diagnostic. Use the proper code for the diagnostic and you get the correct information. If that correct information is unclear, please ask again.

The suggestion to add jitter was from someone who did not know there is a proper fix for the diagnostic

Any idea when the proper fix will propagate to cmdstan? It’s all well and good to tell folks to use posterior, but they’re still going to get a false alarm from cmdstan/rstan at the end of the sampling period, right?

Ok, I’ll try that. But just to make sure we understand each other if I use the package you suggested, there should be no problems anymore, right? Or at least the problems I get from the values of my correlation matrix? You can check at my code if you want to (Convergence Error: Multilevel Model). The problem seems to stem from the L_u matrices. I’ll try to think about, but if I’m stuck I’ll definitely tell you! Thanks, Avehtari!

That what’s I was telling myself. You have to run the model and then use the posterior package, hence you’ll still get the warning messages. But maybe I missed something.

It has been fixed in RStan and part of master branch, but due to CRAN issues it’s unknown when it will be in CRAN. CmdStanR uses posterior so it’s fixed. The first post in this thread was using RStan, so I’ve focused answering in that context.

If I remember correctly CmdStan doesn’t give any warnings by default, but you need to call summary command and even then the interpretation of the results is left for the user. I don’t remember how CmdStan summary behaves in this case. If you are using CmdStan, can you test and report the behavior?


Could you tell me how to use posterior to fix my issues, please! I’m not sure what you meant with your previous message. Thanks.

If you don’t want to see the warnings when running RStan you can install the fixed version with

remotes::install_github("stan-dev/rstan", ref = "develop", subdir = "rstan/rstan", build_opts = "")

If you don’t want to install from github, you can ignore the warnings when running the older RStan and then use posterior package to compute the correct values. The use of posterior package is explained at I copy the main things here, where your_fit is your RStan fit

install.packages("posterior", repos = c("", getOption("repos")))
your_draws_df <- as_draws_df(your_fit)

And the output shows you the correct values.


Ok, now it’s much clearer what you were trying to say! Thank you so much!

1 Like