Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Enable (naive) minibatching within MCMC. #349

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

odunbar
Copy link
Member

@odunbar odunbar commented Jan 29, 2025

Purpose

Content

  • New method to decorrelate a vector of data sample vectors
  • New emulator posterior function that still enables us to build the (cumbersome) AdvancedMH.DensityModel object. using by defining x -> f(x, emulator, prior, data) in the factory
  • emulator posterior now taks 1/n * sum(log(p(y_i|x))) + log_prior(x)over the data vectory_i in Y. This is a naive formulation, requiring n` evaluations of the emulator for every MCMC step.
  • added a unit test where 100 slightly perturbed data samples, and acheive the same target.

Misc

The net result of (Barbenet, Doucet, Holmes 2017) ) is that minibatching within MCMC is a very technically complex problem, and for computational benefit without loss of accuracy requires a nested procedure to approximate the accept-reject mechanicsm, and futher surrogates of the log-likelihood. It may be that simple parallelization or alternative (parallel) sampling methods would be preferred

  • The ObservationSeries object contains both data samples and noise covariance. Here it appears that MCMC requires only the data samples, while the emulator uses the noise covariance (for decorrelation), this should be addressed in a future issue to do with data processing but not here

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

@odunbar odunbar changed the title Enable (naive) minibatching within MCMC. WIP: Enable (naive) minibatching within MCMC. Jan 30, 2025
@odunbar odunbar force-pushed the orad/obeservation-batches branch from f2d70ea to d2fffa1 Compare January 31, 2025 18:59
removed observationseries, implemented a proposal with AdvancedMH.DensityModel that can deal with multiple observed samples

format

test naive sampling

format
@odunbar odunbar force-pushed the orad/obeservation-batches branch from d2fffa1 to af0b191 Compare January 31, 2025 19:01
Copy link

codecov bot commented Jan 31, 2025

Codecov Report

Attention: Patch coverage is 85.71429% with 2 lines in your changes missing coverage. Please review.

Project coverage is 88.92%. Comparing base (2ad4cc7) to head (af0b191).

Files with missing lines Patch % Lines
src/MarkovChainMonteCarlo.jl 85.71% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #349      +/-   ##
==========================================
- Coverage   88.96%   88.92%   -0.05%     
==========================================
  Files           7        7              
  Lines        1359     1363       +4     
==========================================
+ Hits         1209     1212       +3     
- Misses        150      151       +1     

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

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.

1 participant