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

Đang mở
#1,070 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
62/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
backend, data

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Python
Star
26
Fork
25
Merge trung bình
4 giờ 25 phút
Pull request đã merge (30 ngày)
9

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của lanl/PyBNF

Tất cả issue của lanl/PyBNF

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.