stan-dev / stan-dev/bayesplot

Add split-chain option to rank plots.

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

Nobody has claimed this yet.

Dominant language
R
Stars
442
Forks
93
Avg merge
3h 11m
Merged PRs (30d)
1

Description

This is again relevant to https://discourse.mc-stan.org/t/rank-plots-dont-save-you-from-symmetric-non-stationary-chains/37624/4

I suppose this would be relevant for all rank-based plots?

Using this to make my own version of split chains makes the problems super obvious:

n = 1000
chain1 <- -2 + 0.003 * 1:n + arima.sim(list(ar = 0.7), n = n, sd = 0.5)
chain2 <- 1 + -0.003 * 1:n + arima.sim(list(ar = 0.7), n = n, sd = 0.5)

# Split chains into first and second half
midpoint <- n/2
chains <- as_draws_array(list(
  chain1_first = list(theta = chain1[1:midpoint]),
  chain1_second = list(theta = chain1[(midpoint+1):n]),
  chain2_first = list(theta = chain2[1:midpoint]),
  chain2_second = list(theta = chain2[(midpoint+1):n])
))

mcmc_rank_overlay(chains, )
mcmc_rank_ecdf(chains, plot_diff = TRUE)

image
image

Contributor guide

Open the contributing guide

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 with the mcmc_rank_overlay and mcmc_rank_ecdf entry points, then trace the other rank-based plot functions to determine the shared scope for a split-chain option. Use the first- and second-half chain example as the behavior reference; done means the relevant rank plots consistently support split chains and expose the non-stationary behavior.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.