stan-dev / stan-dev/rstan

function to thin extracted posterior

Open
#40 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
R
Stars
1.1k
Forks
266
Avg merge
2h 56m
Merged PRs (30d)
1

Description

Tamas Papp has some utilities that may be useful to include as part of RStan itself:

https://github.com/tpapp/my-stan-utils

These include a function to thin the extracted draws from a fit using thin_subarrays, and example of which is

posterior <- extract(fit, permuted=TRUE)

thinned_posterior <- thin_subarrays(posterior, 1:30)

With permuted=TRUE, it's OK to just take the first ones, as the permutation has already shuffled (including shuffling across chains).

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

Review the linked my-stan-utils project, focusing on thin_subarrays and the extract(fit, permuted=TRUE) example. Determine where this utility belongs in RStan; done means RStan includes an equivalent function that supports the shown posterior-thinning workflow.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.