Skip to content

MCMC proposal bug-fixes and small refactor#448

Open
odunbar wants to merge 8 commits into
mainfrom
orad/audit-fix-1
Open

MCMC proposal bug-fixes and small refactor#448
odunbar wants to merge 8 commits into
mainfrom
orad/audit-fix-1

Conversation

@odunbar

@odunbar odunbar commented Jul 22, 2026

Copy link
Copy Markdown
Member

…ogic

Purpose

To-do

Content

  • Fix the issue where proposals default (via copied boilerplate) to RWM log-ratio framework that is incompatible with asymmetric densities.
  • This also requires a bug-fix in the Barker proposal (which assumes decorrelated sampling, so we use the cholesky factors to whiten)
  • In their place, we define the proper log ratio by using a correct transition density "q(u|u') - q(u'|u)"
  • We have a small refactor, to define the Markov kernel, as a Struct. This allows for kernels that can be represented by Distributions.jl, we make a single location to define the kernel, then rand(kernel) produces a proposal, and logpdf(kernel) produces the transition log-density. For kernels that aren't representable by Distributions.jl (i.e. Barker) we store the relevant parameters in the kernel, and use similar interface for readability via methods _barker_rand(kernel) and _barker_logpdf(kernel) with the analytical formulas inside.
  • We have unit tests that will catch future bugs in the proposals.

MISC

  • we also improved the stepsize criteria to a bisection method rather than a doubling approach

  • I have read and checked the items on the review checklist.

@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.02970% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.18%. Comparing base (26d7455) to head (b56663d).

Files with missing lines Patch % Lines
src/MarkovChainMonteCarlo.jl 97.02% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #448      +/-   ##
==========================================
+ Coverage   95.16%   95.18%   +0.02%     
==========================================
  Files          12       12              
  Lines        2441     2493      +52     
==========================================
+ Hits         2323     2373      +50     
- Misses        118      120       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[audit 2026-07-09] overly Symmetrised proposals in MCMC

1 participant