probfit
probfit copied to clipboard
Make the try_* functions into FitStatistic.grid_search methods?
I just read through the tutorial and I think maybe one aspect of the probfit
API could be improved.
At the moment there are try_uml
and try_binlh
functions that evaluate the unbinned or binned likelihood function for a grid of values and return the best result as a dict
.
Wouldn't it be nicer to have a FitStatistic.grid_search(parameters)
method?
(I didn't look if the different fit statistics, a.k.a. cost functions, have a base class, but that's what I mean with FitStatistic
here, i.e. UnbinnnedLH
and Chi2Regression
and ...)
I was gonna remove them though it's there since this thing is call distfit... Do you think they are useful? If so, yes it should be a method instead of a function.
Yes, I think having a grid_search
method as well as a quick way to visualize model vs. data (and maybe residuals) to find good start values for MIGRAD
and debug what the model is doing is very useful.
http://code.google.com/p/pyminuit/wiki/FunctionReference#scan((param,_bins,_low,high),...[,_corners[,_output]])
Scan does something else though...
Oh... it's pyminuit scan not minuit scan.
Related suggestion for improvement: the six functions fit_uml
, try_uml
, fit_binx2
, try_chi2
, fit_binlh
and try_binlh
in oneshot.py are not included in the [probfit docs]((http://iminuit.github.io/probfit/search.html?q=fit_uml)
Either remove them or add them to the docs.
If they are kept, I would suggest to make the fit_*
methods simply return minuit
instead of (fval, minuit)
, as fval
is simply available as minuit.fval
, right?