queso icon indicating copy to clipboard operation
queso copied to clipboard

Add Capability to Marginalize Likelihood

Open pbauman opened this issue 8 years ago • 6 comments

This follows up on #528 to allow the marginalization of a "marginal parameter space". That is, if instead of your model looking like f(m), it looks like f(m,q) and you want to marginalize over q, you'll now be able to do that.

The code is written, but it will be a couple of more days before I can have time to write tests. That said, i wanted to open this up now to get feedback on the interface and on the clarity of the documentation (since the integration over the marginal space can be done in a couple of ways). As such, I'm labeling as do not merge until I push some tests (and squash in any fixes for bugs identified by the testing).

pbauman avatar Feb 02 '17 20:02 pbauman

That was fast.

dmcdougall avatar Feb 02 '17 20:02 dmcdougall

Codecov Report

Merging #539 into dev will increase coverage by 0.01%.

@@            Coverage Diff            @@
##             dev     #539      +/-   ##
=========================================
+ Coverage     56%   56.02%   +0.01%     
=========================================
  Files        186      186              
  Lines      18035    18050      +15     
=========================================
+ Hits       10101    10112      +11     
- Misses      7934     7938       +4
Impacted Files Coverage Δ
...c/stats/src/GaussianLikelihoodDiagonalCovariance.C 92.85% <100%> (-0.9%) :x:
...elihoodBlockDiagonalCovarianceRandomCoefficients.C 96.66% <100%> (-0.21%) :x:
...ts/src/GaussianLikelihoodBlockDiagonalCovariance.C 88.88% <100%> (-0.77%) :x:
src/stats/src/GaussianLikelihoodFullCovariance.C 93.33% <100%> (-0.79%) :x:
src/stats/src/GaussianLikelihoodScalarCovariance.C 100% <100%> (ø) :white_check_mark:
...aussianLikelihoodFullCovarianceRandomCoefficient.C 94.73% <100%> (-0.51%) :x:
src/stats/src/LikelihoodBase.C 78.37% <85.18%> (+18.37%) :white_check_mark:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 199283f...e339a52. Read the comment docs.

codecov-io avatar Feb 02 '17 20:02 codecov-io

:) That code was written together with #528 and #532. Instead of just letting it sit until I write the tests, I figured I could start getting feedback on the API and documentation now.

pbauman avatar Feb 02 '17 20:02 pbauman

OK, I have two tests now. This is ready as far as I'm concerned. Feedback welcome @dmcdougall, in particular is the documentation clear? I'm a little worried the marg_pdf_is_weight_func in the new constructor might be confusing.

I should note that I intend to open an issue after this is merged because one thing I'd like to do is generalize this to parallelize the quadrature loop. But that's a longer discussion. As is, this is just evaluating one quadrature point at a time in the marginalization step, which is fine if your model is cheap.

pbauman avatar Feb 09 '17 15:02 pbauman

Had forgotten to implement the new constructor for the Gaussian likelihood subclasses. Pushed in a commit that does so.

pbauman avatar Feb 10 '17 14:02 pbauman

Labeling do not merge again. Even though my tests are passing my application that is using this capability is not behaving as expected and I suspect one or several bugs still lingers here. Will update when its sorted, one way or another.

pbauman avatar Feb 14 '17 18:02 pbauman