Constantly getting the error: MCMCSamplingError #367
-
|
I get the error "MCMCSamplingError: MCMC sampling failed with a maximum R-hat value of 2220934037504.0" or other very large values when i run "model_diagnostics.plot_rhat_boxplot()" even though the model runs. I have tried increasing the parameters in the meridian.sample_posterior to meridian.sample_posterior(n_chains=7, n_adapt=2000, n_burnin=2000, n_keep=4000) but still get this error. My data has 2 geographies and 2 years of weekly data with 12 media channels and only controls are GQV and Price. Any suggestions to fix this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
It appears your MCMC sampler is not converging. Here are a few steps you can take to remedy the issue:
|
Beta Was this translation helpful? Give feedback.
The issue was there was a media channel that had 0 spend and impressions which after excluding this media channel from the model it was able work when i ran the "model_diagnostics.plot_rhat_boxplot()". The model spec and data loader all worked fine and even the meridian.sample_posterior() functions all worked normally so a suggestion would be if Meridian in the data loader could raise an error if it has a NaNs to prevent this type of issue in the future.