Skip to content

Add split-chain option to rank plots. #333

@sims1253

Description

@sims1253

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions