zfit intensity pdf #258
Replies: 3 comments 1 reply
-
Hey @mayou36, thanks a lot for providing this example and for your thoughts! It's nice to see that it's indeed straightforward to implement your own PDF :) Once this example works well, I think it would be nice to host it in notebook form on the usage pages (where it CI runs it and it is easy to add references to A few questions/remarks (no particular order, just while reading):
Side note about the notebook idea: ideally, I want to move into this direction ComPWA/expertsystem#553. So, some quantum number conservation rule solver package, then a package that builds amplitude models (automated PWA formalisms), and finally, data + fitting. TensorWaves is then some steering package for PWA physicists that brings these packages together, while the code that |
Beta Was this translation helpful? Give feedback.
-
Ah yes, good point, I saw some notes on toy studies on the zfit docs. So in the notebook, would it be easy to create some intensity sample based on a custom PDF over a phasespace as domain? If so, it could indeed be hosted standalone on (what is now) the expertsystem pages (as a follow-up to generating the amplitude model).
Yes you're right, a
What @spflueger and I were looking for, was some sort of 'math language' (see expertsystem ADR-001), because the starting point for us is building arbitrary amplitude models, that can be easily tweaked and adjusted, or extended with other formalisms. Sympy offered that (with CAS, latex representation, lambdifying, etc.), but it does have its flaws -- it seems to have become an overly large framework with a massive inheritance structure and it has thousands of open issues, which make me a bit worried about its maintainability. At core though, all we need, is a way to express mathematics in some expression tree with symbols as placeholders for variables, that can then be converted to some computational backend for fitting (where you have to start distinguishing between variables for input data and/or parameters that are to be optimized). So this is the background for (1) using Sympy (while there is no better alternative for now) and (2) trying to follow a functional approach with function arguments only that become fit parameters only once we get to the minimizing. (The model that the expertsystem produces has 'parameters' but those are rather suggested values, like expected pole position.)
As for control flow in Sympy, we haven't had a case for that yet on the optimizer side (apart from |
Beta Was this translation helpful? Give feedback.
-
@jonas-eschle, this may be a first step: ComPWA/compwa.github.io#150. I convert that amplitude analysis notebook to a "Technical Report" and strip the tensorwaves part. The resulting notebook can be found at TR-020: Amplitude analysis with zfit. |
Beta Was this translation helpful? Give feedback.
-
Hi all,
after our last meeting, I started playing around with a proposed example.
Things are mostly quite straightforward. There is a little grinding with the concept of parameters: as far as I understand, in tensorvawes, there is no distinction between a parameter and the name of the parametrization? I guess it comes from the fact that these always coincide? For example a gaussian may has a mean that is defined by a parameter. But that parameter can be anything, it can also be shared in other distributions for example. Or how would a sum of two Gaussians be handled with a common mean?
Anyway, here is the snippet that is needed to make something into zfit (this is just a draft, no general converter, but it all seems pretty straightforward)
So while the whole point of zfit is to provide a stable API and base components so that it is easy to build stuff with it, nothing is in stone (yet) which is the main reason I would like to know better where things fail and how to improve the API or workflow (in case that is needed) to have it in "stone".
We can also make the PDF more general, there are normalization hooks, there is support for importance sampling by providing a sampler (such as phasespace).
The full example can be found here as a gist.
Beta Was this translation helpful? Give feedback.
All reactions