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

gaussian.py discrepancy between theory and simulated result #37

Open
qacwnfq opened this issue Aug 24, 2021 · 4 comments
Open

gaussian.py discrepancy between theory and simulated result #37

qacwnfq opened this issue Aug 24, 2021 · 4 comments

Comments

@qacwnfq
Copy link

qacwnfq commented Aug 24, 2021

Hey,

I was just running the gaussian.py example locally and I found

log(Z) = -14.94080654452895 [exact log(Z) = -11.512928331486771]

Is this discrepancy between the sampled and theoretical result expected?

I've appended the .txt files that are created during sampling to this issue.

Thanks!

levels.txt
sample.txt
sample_info.txt
sample_log_X.txt
sampler_state.txt
stats.txt
weights.txt

@qacwnfq
Copy link
Author

qacwnfq commented Aug 24, 2021

One thing I noticed in the prior is, that it is is not sampling symmetrically around 0.
Right now it is like this:

def from_prior(self):
      return np.random.uniform(-0.5*self.width, self.width,
                                  size=(self.ndim,))

I think it is meant to be like this:

def from_prior(self):
      return np.random.uniform(-0.5*self.width, 0.5*self.width,
                                  size=(self.ndim,))

But that doesn't fix the issue.

@qacwnfq
Copy link
Author

qacwnfq commented Aug 30, 2021

So if i check the posteriors for the C++ version of this example (PR #38) I get:
image

which is quite different from
image

There are some clear visible differences. I will try to investigate if they arise within the gaussian.py file.

@eggplantbren
Copy link
Owner

eggplantbren commented Aug 30, 2021 via email

@qacwnfq
Copy link
Author

qacwnfq commented Aug 31, 2021

So in the C++-Version it seems to get close enough to the analytical solution.
For now I will continue with the C++-Version :)

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

No branches or pull requests

2 participants