Changes and motivation
The changes in this pull request and their associated motivations are:
Explicitly computes the loglikelihood value at the unconditioned bestfit instead of just taking the max loglikelihood available in the scan range of the target parameter the user requested. In this way, even if the unconditioned bestfit is not within the scan range set by the user, the loglikelihood ratio will not be wrong.
Plots the -2 log likelihood ratio instead of the -log likelihood ratio so that it is easier to see if the resulting limit(s) is/are cutting at the anticipated values. Wilks' theorem said that under certain asymptotic and regularity conditions, the -2log likelihood ratio follows the chi2 distribution of the appropriate number of degrees of freedom. Perhaps it is just convention but usually the critical value is for the -2 log likelihood ratio test statistic instead of the - log likelihood ratio test statistic and it would be easier for the user to overlay the profiled loglikelihood ratio and the critical value as a function of the target parameter if the y-axis is -2 loglikelihood ratio instead.
Testing
The unit test that involves plot_likelihood_ratio was commented out because 'For now just test that it doesn't crash -- image comparison tests are tricky...'. To ensure that there are no breaking changes, the plot in the tutorial notebook was reproduced (but with -2 log likelihood ratio instead):
The first plot in this PR was also plotted using plot_likelihood_ratio from this commit.
Changes and motivation The changes in this pull request and their associated motivations are:
Testing The unit test that involves
plot_likelihood_ratio
was commented out because 'For now just test that it doesn't crash -- image comparison tests are tricky...'. To ensure that there are no breaking changes, the plot in the tutorial notebook was reproduced (but with -2 log likelihood ratio instead): The first plot in this PR was also plotted usingplot_likelihood_ratio
from this commit.