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

Output problems for summary and stats files #12

Closed
jtlz2 opened this issue Apr 4, 2013 · 6 comments
Closed

Output problems for summary and stats files #12

jtlz2 opened this issue Apr 4, 2013 · 6 comments

Comments

@jtlz2
Copy link

jtlz2 commented Apr 4, 2013

Hi - some of the output files are not produced, but I haven't tracked down why yet (sorry!), e.g. 1-summary.txt. If the file does not already exist, it is produced but is empty.

1-post_separate.dat is empty when multimodal=True.

1-stats.txt is incomplete:

Global Evidence: -0.690049101357911621E+01 +/- 0.602774045152852864E-01

Local Mode Properties

Total Modes Found: 2

This is for all combinations of the verbose, write_output and multimodal keywords.

pymultinest.Analyzer(n_params = n_params).get_stats()['modes']
analysing data from chains/1-.txt
[]

is empty (whether multimodal is True or False), so I don't know where to get e.g. the MAP parameters from except by calculating those and other stats myself.

I guess you'll want a minimal example..?

@JohannesBuchner
Copy link
Owner

Please take a look at issue 3 (#3), it might be the same problem. Ultimately, it's a MultiNest problem I think, MultiNest shouldn't suddenly decide not to write out stuff. I am unsure what kind of likelihood functions trigger this problem.

You should however not rely on MultiNest writing out modes. If only one peak exists, then there will be no mode statistic written. You can get your statistics from looking at the distribution (equal weights, loaded for you in Analyser.get_equal_weighted_posterior) -- if you want to assume a Gaussian approximation there (which may or may not be justified). The MAP should be the last line in the prefix.txt file (loaded for you in Analyser.get_data). If you would like this functionality to be in PyMultiNest perhaps we can think of a generic way to do it.

@jtlz2
Copy link
Author

jtlz2 commented Apr 19, 2013

Hey - yes I think that's the same problem. I'm very keen to help track down the problem as I had high hopes for PyMultiNest, and if I can't get it working soon I'll have to revert to MultiNest itself..

It would be really good to have the multiple mode statistics - should I rather write to Farhan about this?

I've coded up a simplified version of the object-detection example, if it's any use, where A and sig are fixed and the search is for two gaussians in x,y only. 6 modes are reported (I think some are edge artifacts), but no stats are written except what I describe above: prefix-stats.dat is:

Global Evidence: -0.142335426023810392E+02 +/- 0.597318229859429492E-01

Local Mode Properties

Total Modes Found: 6

and prefix-summary.txt is empty.

Shall I keep simplifying the example until it starts working (as for your demo)?

It would definitely be good to be able to access all of the stats from within PyMultiNest (assuming they can be recovered, and if I've understood you correctly).

So let me know how I can help!

@JohannesBuchner
Copy link
Owner

Yes, please write him with your code. However, I would like to stress again that I think this is not a Python issue and you will get the same result if you write your likelihood function in C or Fortran. We don't do anything magical in PyMultiNest. This is somehow a weird bug in MultiNest that gets only triggered sometimes. If you can find a simple likelihood function that triggers this issue, Farhan will be able to investigate writing a C/Fortran function. Alternatively, you can log the values your likelihood function returns.

@jtlz2
Copy link
Author

jtlz2 commented Apr 19, 2013

Point taken - I'll get on it :)

@JohannesBuchner
Copy link
Owner

possibly resolved with issue #16. If not, please re-open.

@jtlz2
Copy link
Author

jtlz2 commented Jul 3, 2013

This is fantastic news - thank you - that exactly fixes it!

On 3 July 2013 03:25, Johannes Buchner notifications@github.com wrote:

possibly resolved with issue #16#16.
If not, please re-open.


Reply to this email directly or view it on GitHubhttps://github.com//issues/12#issuecomment-20386114
.

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