Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RF] RooHypatia2 Analytical integral integration #7254

Open
1 task
quaglia90 opened this issue Feb 19, 2021 · 4 comments
Open
1 task

[RF] RooHypatia2 Analytical integral integration #7254

quaglia90 opened this issue Feb 19, 2021 · 4 comments

Comments

@quaglia90
Copy link

quaglia90 commented Feb 19, 2021

  • Checked for duplicates

The PDF RooHypatia2 implemented in master has wrong commented code for the analytical integral.
The version copied and adapted of the function is somehow linked to an old version.
The Version i am using in my analysis has different evaluate() and analyticalIntegral implementation.
In attachment the class i am using for my analysis.

RooIpatia2.zip

@quaglia90 quaglia90 added the bug label Feb 19, 2021
@quaglia90
Copy link
Author

The function here seems to well behave for the analytical integral only when z=0,beta=0, lambda <-1 strictly
In the current master implementation some of the logics on the parameter and sigma,lambda interplay seems to be not implemented

@guitargeek guitargeek self-assigned this Feb 19, 2021
@guitargeek guitargeek changed the title RooHypatia2 Analytical integral integration [RF] RooHypatia2 Analytical integral integration Jun 22, 2022
@dajiaonao
Copy link
Contributor

The function here seems to well behave for the analytical integral only when z=0,beta=0, lambda <-1 strictly In the current master implementation some of the logics on the parameter and sigma,lambda interplay seems to be not implemented

Hi, I'm also trying to use the analytical integral and I think the problem is that currently the RMS is used as the sigma parameter, but for z=0, beta=0, 0>lambda >-1 the RMS is infinity. In Ipatia2, the definition of sigma changes when lambda moves from (-oo,-1] to (-1,0). This actually could cause problems in the fit as the shape does not change smoothly. Similar behavior happens in the current version due to the definition change of sigma for zeta->0 and zeta=0.

The definition of sigma in the current version is inconsistent in the evaluate() function and analyticalIntegral function (though commented out). When beta=0, zeta=0, the analytical integral could work for -1<lambda<0, but the sigma is not the RMS. This need to be fixed either in the code, or in the documentation.

I suggest to update the analyticalIntegral code to be consistent with evaluate(). So the RMS will be:

  1. beta=0, zeta=0, lambda<-1: non-standard student t pdf, RMS = sigma/sqrt(-2(lambda+1))
  2. beta=0, zeta=0, 0>lambda>-1: non-standard student t pdf, RMS is infinity
  3. beta=0, zeta>0: RMS = sigma
  4. other: RMS is complicated, as given in https://en.wikipedia.org/wiki/Generalised_hyperbolic_distribution

The user should use the pdf in two modes as the definition of sigma is different: 1) zeta=0, lambda<0; and 2) zeta>0. The analytical integral is provided for mode 1) when beta=0.

@dajiaonao
Copy link
Contributor

Hi @guitargeek , this is Dongliang. I tried to modify the RooHypatia2 code to make the analytical integral work. In the attached code, local_pdf/RooHypatia2.cxx and local_pdf/RooHypatia2.h are the modified code. And, local_pdf/RooHypatia2b.cxx and local_pdf/RooHypatia2b.h are the modified code with the class name also changed to enable a comparison with the default version. The script comparePdf.py is used to make the comparison and you should find the two curves (blue for the default one, and red dash for the modified) agree. I guess this means the analytical integral works?
Hypatia2_test.zip

@dpiparo
Copy link
Member

dpiparo commented May 17, 2024

Could you submit a PR containing the fix and the test so that we can treat this useful contribution according to the usual workflow?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants