You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I actually think that it might be better if likelihood_contour_data would not return the levels at all. In principle, the levels can always be changed without recomputing the contour data and this is not very clear at the moment. In addition to changing the DOF, one might also want to change n_sigmaafter one has computed the plot data. The fact that likelihood_contour_data has the n_sigma argument suggests that one has to recompute all the data in this case. But this is actually not necessary.
One idea for contours would be to use the levels argument in two different ways:
if it is a list, tuple, or array, it is treated as ever
if it is a dictionary, then the keys type and n_sigma are mandatory and the key dof is optional. The value of type could then be e.g. likelihood, chi2, log-likelihood.
By this, we could avoid additional functions or the need to use levels=[delta_chi2(n, dof) for n in n_sigma]. Calling contours would just look like e.g.
I suggest not using something other than a list/array for levels because it's the same name as the argument of matplotlib's contour, which just takes an int or list/array.
I also suggest not using dictionaries as function arguments, because that's very hard to document and use properly (Jupyter tab signature hints; type hints; ...). If you want to go down this road, I suggest to add all of them as keyword arguments.
As mentioned in issue #143,
I actually think that it might be better if
likelihood_contour_data
would not return thelevels
at all. In principle, the levels can always be changed without recomputing the contour data and this is not very clear at the moment. In addition to changing the DOF, one might also want to changen_sigma
after one has computed the plot data. The fact thatlikelihood_contour_data
has then_sigma
argument suggests that one has to recompute all the data in this case. But this is actually not necessary.One idea for
contours
would be to use thelevels
argument in two different ways:type
andn_sigma
are mandatory and the keydof
is optional. The value oftype
could then be e.g.likelihood
,chi2
,log-likelihood
.By this, we could avoid additional functions or the need to use
levels=[delta_chi2(n, dof) for n in n_sigma]
. Calling contours would just look like e.g.or
It is a bit confusing that
likelihood_contour_data
actually returns neither likelihood nor log-likelihood but chi2 values.The text was updated successfully, but these errors were encountered: