Skip to content

Feature Request: public subset() method for psis objects #343

Description

@utkarshpawade

There is currently no public API in the loo package to subset a psis object by observation index. Downstream packages that need this functionality are forced to manually manipulate the internal structure of psis objects.

For example, bayesplot has had this workaround sitting with a FIXME comment : https://github.com/stan-dev/bayesplot/blob/master/R/ppc-loo.R#L722-L738

Would it be possible to export a subset.psis() S3 method or a subset_psis() helper? That way downstream code can drop the fragile workaround and rely on a stable API.

Activity

  1. avehtari commented on Mar 30, 2026

    @avehtari
    Member

    Good point, thanks for opening the issue. As this has been quite stable there doesn't seem to be need to hurry, and it might better to delay this until the bigger refactoring is done

  2. jgabry commented on Mar 31, 2026

    @jgabry
    Member

    I started this a long time ago but abandoned it (I don't remember why): #110. I agree it's worth having, but yeah we should wait until the bigger refactor.

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