mh given several beta values pools every chain into one samples.txt, so its credible intervals mix tempered and untempered draws

オープン
#1,070 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
62/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
backend, data

調査の方向性

Start by tracing how mh reads the beta configuration and writes Results/samples.txt, then check the code paths that produce credible intervals and histograms. Reproduce with the supplied two-beta configuration and compare each chain’s draws with the pooled results. Done when multiple beta values are rejected at startup with guidance to use pt, or each beta’s draws and summaries are written separately.

索引モデルが issue の本文から書いたものです。

説明

bug low priority silent-incorrectness

Given several values for beta, mh runs one chain per beta and appends every chain's draws to the same Results/samples.txt. The credible intervals and histograms are computed from that pooled file, so the reported posterior mixes tempered and untempered draws. It is not the posterior at any one beta. The only notice is the existing warning "You specified multiple beta values with the method mh. This is an odd thing to do."

Found while reviewing #1066. Reproduced on main at cbb8159c. mh is deprecated, which lowers the priority, but the result is silently wrong.

Reproduction

Analytic target. Each parameter has variance 1, so the chain at beta = 1 should have sd 1 and the chain at beta = 0.25 should have sd 2:

edition = 2
objective = gaussian, mean = 0 0, variance = 1 1
uniform_var = g1 -10 10
uniform_var = g2 -10 10
random_seed = 1
output_dir = out
job_type = mh
population_size = 2
beta = 1 0.25
step_size = 1
max_iterations = 2000
burn_in = 200
sample_every = 1

pybnf -c x.conf -o:

  • It exits 0 with "Fitting complete". samples.txt holds 3600 draws, 1800 from each chain.
  • Split by chain (run0, run1 in the draw names), the draws have sd 1.86 and 1.94 for g1 and g2 in one chain, and 1.04 and 1.01 in the other. Those are close to the beta = 0.25 and beta = 1 answers of 2 and 1.
  • Pooled, the sd is 1.53 and 1.55, against about 1.58 for an even mix of the two. That is not the posterior at either beta.
  • credible95.0_final.txt reports g1 in [-2.79, 3.45] and g2 in [-3.08, 3.16]. Those are the pooled file's 2.5% and 97.5% points. The beta = 1 answer is ±1.96.
What should happen

Refuse more than one beta for mh at start, pointing to pt for a temperature ladder, as #860 now does for am, dream, p_dream and hmc. Otherwise, write each beta's draws, intervals and histograms separately.

主要言語
Python
スター
26
フォーク
25
平均マージ
4時間 25分
マージ済み PR(30日)
9

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

lanl/PyBNF のほかの issue

lanl/PyBNF の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。