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

Constraining two Wilson coefficients in a Likelihood fit #137

Closed dlanci closed 3 years ago

dlanci commented 3 years ago

Hi,

I was wondering whether it would be possible to constrain the values of two Wilson coefficients in the log-likelihood function

def FLL(x):

    Re_C9, Re_C10 = x
    w = Wilson({'C9_bsmumu': Re_C9, 'C10_bsmumu': Re_C10},
                scale=4.8,
                eft='WET', basis='flavio')
    return `L.log_likelihood(par,` w)

i.e. to fit with the constraint C9NP=-C10NP

Thanks, Davide

DavidMStraub commented 3 years ago
def FLL(x):

    Re_C = x[0]
    w = Wilson({'C9_bsmumu': Re_C, 'C10_bsmumu': -Re_C},
                scale=4.8,
                eft='WET', basis='flavio')
    return `L.log_likelihood(par,` w)
dlanci commented 3 years ago

Thank you! Davide

dlanci commented 3 years ago

Thank you for your prompt answer!

Unfortunately when I then plug the FLL above in

cdat = fpl.likelihood_contour(FLL,
                                   x_min=x_min, x_max=x_max, y_min=y_min, y_max=y_max,
                                   n_sigma=(3, 4, 5),
                                   steps=30, label='global')

The displayed likelihood contour is a vertical band in the C9_bsmumu and C10_bsmumu plane, although I would naively expect it to appear as a diagonal band. Is there something I'm missing in the usage of fpl.likelihood_contour function or maybe in my understanding of the way the constrain is implemented?

ex
DavidMStraub commented 3 years ago

The way I've written it, it's a one-dimensional function (x[0]). You can convert it back to something two-dimensional with something like

def L2D(xy):
    C9 = xy[0]
    C10 = xy[1]
    return FLL([(C9-C10) / 2])

This is quick and dirty (and I haven't tried it), but these are all just Python problems. You can look at the API docs to see which signatures the functions have and then plug it together how you want.

dlanci commented 3 years ago

OK! In fact the pull was calculated correctly. The quick and dirty trick works flawlessly, and for now its super good

Thanks Davide