flav-io / flavio

A Python package for flavour physics phenomenology in the Standard model and beyond
http://flav-io.github.io/
MIT License
71 stars 62 forks source link

absolute chi2 value #195

Closed girishky closed 1 year ago

girishky commented 1 year ago

Issue #134 discusses how to obtain pull in units of sigma using flavio.statistics.functions.pull which requires difference of chi2 value, calculable as [-2(FLL(NP)-FLL(SM)], and relevant dof. I was wondering how to obtain absolute chi2 value in the SM. (The quantity -2FL(SM) turn out to be a negative number so it is not absolute chi2). Let me know if I should provide a MWE to illustrate my issue. Thanks.

DavidMStraub commented 1 year ago

Twice the negative log likelihood and χ² can differ by constants, e.g. for a 1D normal distribution by ln(σ(2π)1/2).

girishky commented 1 year ago

OK..I see. The LL function has a factor $(2\pi \sigma^2)^{-n/2}$ multiplying exp function. Thanks...but isn't the constant you mentioned is $2n \ln[\sigma (2\pi)^{1/2}]$ (n=1 for 1D dist.) ?

DavidMStraub commented 1 year ago

Oh, perhaps I misunderstood your question. I wanted to point out that you don't need the absolute chi^2 to compute the pull, but probably this is not what you asked.

Perhaps you can have a look at appendix B of https://arxiv.org/pdf/1903.10434.pdf and see if that is helpful.

girishky commented 1 year ago

Thanks, David...I will have look. Yes, my query was about calculating $\chi^2$ (e.g. in table 3 of your paper).

peterstangl commented 1 year ago

If you want to obtain a total $\chi^2$ that is zero in the case where all theory predictions are equal to the experimental measurements, you should be able to get this by setting delta=True in the arguments of the log_likelihood method.

girishky commented 1 year ago

thanks @peterstangl. I think this is what I was looking for.