stan-dev / stan-dev/rstanarm

loo_subsampling for rstanarm

Open
#433 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
401
Forks
136
PR merge metrics
No merged PRs in 30d

Description

Summary:

Implement loo subsampling (and loo approximate posterior) for rstanarm

Description:

I got a question on how to use loo subsampling with rstanarm (see here:
https://discourse.mc-stan.org/t/extract-log-likelihood-function-from-rstanarm-model/14668/3).

I then realized I should implement this for rstanarm users in addition to brms users. The question is more or less how to do this in the optimal way. I see two ways:

  1. Expose the ll_fun() (or a wrapper as log_lik_function()) as a part of the API. Then the users can plug it in in the loo subsample themselves.
  2. Implement a loo_subsampling.stanreg function.

I do not think 1 and 2 are mutually exclusive. Maybe start with exposing a log_lik_function() function? This is probably quite quick to do (I can fix). Then I can implement 2 for the models where loo currently uses the ll_fun function.

Since I'm not very familiar with the rstanarm framework and I'm not sure about all parts so it would be great to get some feedback on how to connect loo subsampling to rstanarm in the best way.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the existing rstanarm integration around ll_fun() and how loo currently uses it. Compare exposing log_lik_function() with adding loo_subsampling.stanreg, then define tests that confirm rstanarm models support loo subsampling and approximate posterior workflows.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
analytics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.