cmdstan
cmdstan copied to clipboard
diagnose counting warmup draws
Summary:
make examples/bernoulli/bernoulli
examples/bernoulli/bernoulli sample save_warmup=1 data file=examples/bernoulli/bernoulli.data.R output file=output.csv
Edit output.csv and add a divergence to the post warmup samples. (here's one: output.csv.txt)
bin/diagnose output.csv
The output will include:
Checking sampler transitions for divergences.
1 of 2000 (0.05%) transitions ended with a divergence.
There is 1 divergence (we added it -- there should be a bunch during warmup), but there are only 1000 post warmup draws.
Current Version:
v2.25.0
the diagnose command depends on stan::mcmc::chains
went spelunking through the logic, and while only the sampling draws from the csv file are analyzed,
there's a bunch of logic that looks at the CSV header and if save_warmup is specified, it uses that somehow.
most def a bug - if not a bug, some programmer's random brain fart - not going to git blame to find out who farted.