Skip to content

Phase out functions that reside in posterior #295

Open

Description

@sims1253

bayesplot is still offering metrics like rhat that now reside in the posterior package. Not do both packages implement them, the implementations differ (afaik posterior is the up-to-date one while bayesplot is lacking behind).
Bayesplot should either just wrap posterior or completely remove those functions to have a single space for them I think.

Activity

  1. jgabry commented on Dec 2, 2022

    @jgabry
    Member

    Thanks for opening the issue. The situation is a bit confusing because the functions unfortunately have the same name but do different things. bayesplot's rhat function isn't computing rhat itself, it's just provided for convenience to extract the rhat values. That means that for a model fit using CmdStanR the rhat values should be the same as the ones computed by posterior. For RStan models we get the old version of Rhat because RStan is lagging behind and hasn't updated to using posterior yet.

    Maybe the rhat() function in bayesplot should be deprecated in favor of a function named extract_rhat()? That would avoid confusion about what's going on under the hood. What do you think?

  2. sims1253 commented on Dec 2, 2022

    @sims1253
    ContributorAuthor

    I agree, that renaming the functions could help with clarity. It would also prevent masking when loading posterior and bayesplot together.

  3. utkarshpawade commented on Apr 14, 2026

    @utkarshpawade
    Contributor

    hi @jgabry it seems like there are roughly three directions this could go:

    1. Deprecate rhat()/neff_ratio() in favor of extract_rhat()/extract_neff_ratio() (as suggested above) to avoid masking with posterior.
    2. Thin wrappers around posterior::rhat() / posterior::ess_*() so bayesplot always reflects the up-to-date implementations.
    3. Remove them entirely and point users to posterior.
  4. jgabry commented on Apr 14, 2026

    @jgabry
    Member

    I think option 1 is actually the only option because the versions in posterior are doing something different, they're not replacements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions