-
Notifications
You must be signed in to change notification settings - Fork 8
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
Question regarding Gaussian shells example: what is logz? #62
Comments
OK, I just realised that the log-likelihood function does not contain the prior. Replacing in the above script function Below the new script:
I thought I should delete my issue, but I leave this here instead in case somebody finds it useful. |
Sorry for the late reply- Indeed the Bayesian evidence is analytically the integral of the likelihood times the prior over all of parameter space (https://en.wikipedia.org/wiki/Marginal_likelihood). Here "likelihood" and "prior" are literal to the Bayesian terminology. This is contrary to what I would call a "loss" function that you might use for numerical optimization, which manually applies Bayes' rule in the function to optimize. |
Though I have not used nested sampling before, I know that it does calculate the log-evidence of the model.
I have been looking at the very nice example regarding the Gaussian shells.
I have run the example code and indeed it runs exactly like detailed in the documentation.
However: I am not entirely sure what logz is. Is it the negative log-evidence or the log-evidence?
As an attempt to find out for myself, I decided to integrate the likelihood function provided by
Models.GaussianShells()
(which I suppose implicitly defines a "flat" uniform prior on the two parameters).To that end, I wrote the following function:
When calling
checkinteral()
I obtain the result of25.1327...
which I cannot make it agree with thelogz=-1.75
given in the example, i.e. `log(25.1327)=3.2241'.Furthermore (because one verification is hardly ever sufficient!), I did an additional check, this time integrating using the package
HCubature
. The additional check is implemented as follows:Calling
onemorecheck()
gives me again25.1327...
.Could somebody please help me out? Thanks.
The text was updated successfully, but these errors were encountered: