eggplantbren / DNest4

Diffusive Nested Sampling
MIT License
62 stars 22 forks source link

Add gaussian example to C++ Examples (related to #37) #38

Open qacwnfq opened 3 years ago

qacwnfq commented 3 years ago

In #37 I opened an issue that the example gaussian.py does not produce a sampled log_Z which is close to the analytical log_Z. In order to further debug this, I added the same example to the C++ version where I get:

Analytical solution: -11.5129283315
log(Z) = -11.838912412347822
Information = 4.604287059911951 nats.
Effective sample size = 34762.69919895431

When checking the posterior samples everything looks perfect also: image

So the C++-version seems to work. I will now move on to explicitly check the posteriors for the python example. I mainly added this so that my code is visible and maybe it will help someone else in the future.