# Large R-Hat Statistics

**URL:** <https://discourse.pymc.io/t/large-r-hat-statistics/17056>\
**Category:** General\
**Created:** [May 29, 2025, 1:11pm UTC](https://discourse.pymc.io/t/large-r-hat-statistics/17056 "2025-05-29T13:11:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jordan\_Howell](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/jordan_howell/32/6067_2.png) [@Jordan\_Howell](https://discourse.pymc.io/u/Jordan_Howell)\
**Post date:** [May 29, 2025, 1:11pm UTC](https://discourse.pymc.io/t/large-r-hat-statistics/17056/1 "2025-05-29T13:11:35Z")

</div>

@pymc-bot

I received this warning when sampling my model:

```auto
The rhat statistic is larger than 1.01 for some parameters.

```

Should I loosen the priors to try and fix this? Here is my model:

```auto
with pm.Model() as promo_model:
    # Hyperpriors
    mu_global = pm.Normal('mu_global', mu=0, sigma=10)
    sigma_bl = pm.HalfNormal('sigma_bl', sigma=5)
    sigma_statc = pm.HalfNormal('sigma_statc', sigma=5)
    sigma_promo = pm.HalfNormal('sigma_promo', sigma=5)

    # Group-specific effects
    alpha_bl = pm.Normal('alpha_bl', mu=0, sigma=sigma_bl, shape=len(business_line_map))
    beta_statc = pm.Normal('beta_statc', mu=0, sigma=sigma_statc, shape=2)
    gamma_promo = pm.Normal('gamma_promo', mu=0, sigma=sigma_promo, shape=len(promo_type_map))

    # Expected mean
    mu = pm.Deterministic(
        'mu',
        mu_global + alpha_bl[bl_idx_promo] + beta_statc[statc_idx_promo] + gamma_promo[promo_idx_promo]
    )

    # Likelihood
    sigma = pm.HalfNormal('sigma', sigma=10)
    nu = pm.Exponential('nu', 1/30)
    likelihood = pm.StudentT('likelihood', nu=nu, mu=mu, sigma=sigma, observed=y_promo)

    # Posterior sampling
    trace_promo = pm.sample(1000, tune=1000, nuts_sampler="numpyro", return_inferencedata=True)

```

---

<div class="post-metadata">

**Author:** ![mmn](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/mmn/32/7510_2.png) [@mmn](https://discourse.pymc.io/u/mmn)\
**Post date:** [May 29, 2025, 3:14pm UTC](https://discourse.pymc.io/t/large-r-hat-statistics/17056/2 "2025-05-29T15:14:47Z")

</div>

Have you tried any prior predictive checks on the model?

In my somewhat limited experience, this is always a good first step to verify that the model setup is sufficient for comparison with the observation. It often helps me answer questions about the suitability of priors etc…

---

<div class="post-metadata">

**Author:** ![bob-carpenter](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/bob-carpenter/32/8124_2.png) [@bob-carpenter](https://discourse.pymc.io/u/bob-carpenter)\
**Post date:** [May 29, 2025, 8:11pm UTC](https://discourse.pymc.io/t/large-r-hat-statistics/17056/3 "2025-05-29T20:11:57Z")

</div>

> [@Jordan\_Howell](#):
>
> I received this warning when sampling my mode

Have you tried a non-centered parameterization of the hierarchical components? If your data plus prior are not very informative, it should work better than the centered parameterization you provided.

The doc `# Likelihood` occurs just before the priors, which could confuse readers.

Do you really expect `nu` to have a value of 30? If so, I’d suggest just replacing with a normal likelihood to simplify the computation. The model won’t change much because by the time you get a Student-t with 30 degrees of freedom it’s getting very close to a normal (which is the limit at infinite degrees of freedom).

---

<div class="post-metadata">

**Author:** ![Jordan\_Howell](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/jordan_howell/32/6067_2.png) [@Jordan\_Howell](https://discourse.pymc.io/u/Jordan_Howell)\
**Post date:** [May 30, 2025, 10:58am UTC](https://discourse.pymc.io/t/large-r-hat-statistics/17056/4 "2025-05-30T10:58:22Z")

</div>

Thanks Bob. I did non-centered parameterization, which fixed the r-hat but did still resulted in a bad energy plot with low BFMI. After a night of much needed sleep, I had to cut down on some of the features which were throwing the model off and now all looks great. Thank you for the help.
