bayesplot icon indicating copy to clipboard operation
bayesplot copied to clipboard

Different rhat for Rstan and CmdStanR

Open Alex-Cremers opened this issue 3 years ago • 0 comments

Hello,

I have a model fitted with cmdstanR which did not converge properly. The Rhat for one of the parameters is 1.33 when I look at model_fit$summary(), however if turn the model into a stanfit object, the summary now indicates a Rhat of 1.48.

I first thought that the two summary functions call different rhat functions, but the following lines do show the same discrepancy:

bayesplot::rhat(model_fit,pars="alpha")
rstan_fit = rstan::read_stan_csv(model_fit$output_files())
bayesplot::rhat(rstan_fit,pars="alpha")

Is there a reason why this could happen, or it it a bug? If needed I can upload the draws for this particular parameter. Using posterior::rhat on the matrix of draws returns 1.33, as with the summary method for the CmdStanFit object.

Best regards,

Alex-Cremers avatar Jul 16 '22 11:07 Alex-Cremers