Probfit iminuit version

61 views
Skip to first unread message

Kjertan Lyster

unread,
May 25, 2021, 5:50:22 AM5/25/21
to scikit-h...@googlegroups.com
Hi,

I have been using iminuit and probfit for a while now. As I was reinstalling Python on a new computer, I realised that the iminiuit version is 1.5.4 when installing probfit and not the most recent. Is this intentional? Should I update iminuit to the most recent one?

Best Regards,
Kjertan

Jonas Eschle

unread,
May 25, 2021, 6:35:01 AM5/25/21
to scikit-h...@googlegroups.com

Hi Kjertan,

if you upgrade, this will very likely break things as iminuit had a major change in its API for v2.

probfit is depreceated though and is not actively maintained anymore. Depending on your needs, I would suggest to use one of the recommended alternatives:
- for binned, histfactory-like fits, pyhf
- for general fits, especially unbinned, zfit

These are fitting libraries that provide building models and everything about it (since you used probfit, I assume this is your use case. Both can use iminuit but also offer alternative minimizers.

- If you wand to use iminuit directly and unleash the full power of it, e.g. if you have the CDF and your data, you can also build your likelihood with iminuit cost functions

If you have more questions on a specific library, it is maybe worth to write directly there on github by making an issue.

For an overview, you find the same information that I provided above (and a variety of other libraries) also on the Scikit-HEP page under fitting or statistics

Best regards,
Jonas

Jim Pivarski

unread,
May 25, 2021, 9:24:32 AM5/25/21
to Kjertan Lyster, scikit-h...@googlegroups.com
I just looked it up and probfit is pinned to iminuit < version 2.0.0:


iminuit 1.5.4 is the last version in the 1.x series. This is because probfit is no longer actively being developed. On the Scikit-HEP front page, it's marked as deprecated:


(though I see it's still getting basic maintenance). The intended replacement, for new project going forward, is zfit:


though if you have old scripts that just need to keep working, that doesn't mean you need to switch fitting libraries. If you want to use probfit in one project and iminuit 2.x in another, you would need to keep them in separate Python processes, in separate Python environments (using venv or conda).

(Also, it would be better to ask this sort of question in https://gitter.im/Scikit-HEP/community, so if anyone else runs into the same issue, they'll find this discussion.)

Hope that helps!
-- Jim



On Tue, May 25, 2021 at 4:50 AM Kjertan Lyster <kjerta...@gmail.com> wrote:
Hi,

I have been using iminuit and probfit for a while now. As I was reinstalling Python on a new computer, I realised that the iminiuit version is 1.5.4 when installing probfit and not the most recent. Is this intentional? Should I update iminuit to the most recent one?

Best Regards,
Kjertan

--
You received this message because you are subscribed to the Google Groups "Scikit-HEP forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scikit-hep-for...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/scikit-hep-forum/E2C73F3C-6AA2-4F6D-805C-F260162FA5F2%40gmail.com.

Jim Pivarski

unread,
May 25, 2021, 9:28:49 AM5/25/21
to Kjertan Lyster, scikit-h...@googlegroups.com, Jonas Eschle
(Sorry—I didn't see that Jonas already answered your question! That's another reason why it would be good to do this on a public forum. My inbox has a rather large event horizon.)



Hans Dembinski

unread,
May 25, 2021, 11:01:31 AM5/25/21
to Jim Pivarski, Kjertan Lyster, scikit-h...@googlegroups.com, Jonas Eschle
Hi,

I think the incompatibility in probfit can be resolved with moderate effort by writing a thin compatibility layer similar to the package six, which calls the right methods for iminuit v1.x and iminuit v2.x, respectively. This is to keep old code running, new users should not use probfit anymore. Fortunately, there are fewer and fewer reasons to rely on probfit.

Cost functions have been integrated directly into the iminuit package, making probfit largely obsolete for new code. The cost functions in iminuit are more powerful, too. For example, one can add them and add penalty terms to constrain parameters.

Some of the pdfs in probfit have been implemented in my other package numba-stats. In general, people should use the pdfs from scipy and contribute pdfs to scipy. Numba-stats mostly provides implementations of the scipy pdfs that work inside the Numba JIT.

What iminuit does not cover - it is outside of its scope -, is to provide a high-level way to defining and combining pdfs. I am talking about addable pdfs that are automatically normalised or computing pdf convolutions automatically.

Best regards,
Hans
> To view this discussion on the web, visit https://groups.google.com/d/msgid/scikit-hep-forum/CADXTekLkEDOxS7rDU-yt5WA0maEL-4bpRqyvsuMg5nThqLFQ4Q%40mail.gmail.com.

Kjertan Lyster

unread,
May 26, 2021, 9:40:56 AM5/26/21
to Scikit-HEP forum
Thank you all for these responses! I will try and update my code to reflect your input and move away from probfit. Really appreciate the help.

Best Regards,

Kjertan

Reply all
Reply to author
Forward
0 new messages