GetDist: Getting bestfit parameter values and minimum -loglikelihood from samples

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Subhajit Ghosh
Posts: 5
Joined: June 04 2018
Affiliation: University of Notre Dame
Contact:

GetDist: Getting bestfit parameter values and minimum -loglikelihood from samples

Post by Subhajit Ghosh » February 11 2023

Dear All,

Is there a function in GetDist MCSamples which returns bestfit parameter values and minimum -loglikelihood calculated from the chain files (samples) provided?

The naive use of getParamBestFitDict() is resulting in an error "Best fit can only be included if loaded from file and file_root.minimum exists (cannot be calculated from samples)".

Thanks in advance.

Best,
Subhajit

Subhajit Ghosh
Posts: 5
Joined: June 04 2018
Affiliation: University of Notre Dame
Contact:

Re: GetDist: Getting bestfit parameter values and minimum -loglikelihood from samples

Post by Subhajit Ghosh » February 12 2023

Let me clarify a bit.

I am asking this question in the context of analyzing Montepython output chains. In principle, we have access to the information about the priors of the parameters through the 'log.param' file. But I think GetDist does not read the 'log.param' file. However, is the prior information at all necessary since the output chains already provide -log(likelihood)?

For example, what will go wrong if one sorts the -log(likelihood) of the chains to find the minimum and corresponding data point as the best fit?

Thanks.

Best,
Subhajit

Antony Lewis
Posts: 1941
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: GetDist: Getting bestfit parameter values and minimum -loglikelihood from samples

Post by Antony Lewis » February 12 2023

You can get the best fit sample (not the same as the global best fit) using
https://getdist.readthedocs.io/en/latest/mcsamples.html#getdist.mcsamples.MCSamples.getLikeStats

Use Cobaya's minimize function if you actually want the best fit.

Post Reply