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

Combined central value for multiple measurements of one observable #127

Closed uschiLaa closed 4 years ago

uschiLaa commented 4 years ago

Hi Flavio team,

we are looking at the (B+->Kll) observable, and want to combine all available measurements to get a single measured central value and uncertainty. Is this something that can be done with Flavio and what functions should we use?

Thanks! Ursula

peterstangl commented 4 years ago

Hi @uschiLaa,

if you use the measurements already contained in flavio or if you create your own instances of flavio.Measurement, then these measurements have an instance of a subclass of flavio.statistics.probability.ProbabilityDistribution associated with them. E.g. if the measurement corresponds to just a central value and an uncertainty, it will be an instance of flavio.statistics.probability.NormalDistribution. (see API docs, https://flav-io.github.io/apidoc/flavio/statistics/probability.m.html)

If your instance of flavio.Measurement is e.g. called my_measurement, you can access these distributions with my_measurement._constraints.

If you want to combine several such distributions by multiplying them, you can use flavio.statistics.probability.combine_distributions (cf. API docs https://flav-io.github.io/apidoc/flavio/statistics/probability.m.html#flavio.statistics.probability.combine_distributions)

DavidMStraub commented 4 years ago

Perhaps flavio.combine_measurements? https://flav-io.github.io/apidoc/flavio/functions.m.html

DavidMStraub commented 4 years ago

It's even the example in the docstring :laughing:

uschiLaa commented 4 years ago

Thank you for the replies! I am aware of the combine_measurements function, but having difficult extracting the relevant information from the result. How can I know which measurements are being combined (i.e. what are the paper references for the experimental results that were used)? And how can I see the estimated central value when one of the measurements is encoded as a numeric distribution?

DavidMStraub commented 4 years ago

How can I know which measurements are being combined (i.e. what are the paper references for the experimental results that were used)?

Is this what you need?

Observable["dBR/dq2(B+->Kmumu)"].get_measurements()

And how can I see the estimated central value when one of the measurements is encoded as a numeric distribution?

pd = flavio.combine_measurements()
pd.central_value

should work

uschiLaa commented 4 years ago

Thanks David, that is exactly what I was looking for! How would get_measurements work for binned observables, i.e. how do I pass in q2min and q2max information?

DavidMStraub commented 4 years ago

That's not possible with this function, but should be easy to do by looping of the Measurement instances.

uschiLaa commented 4 years ago

Thanks David, this is all I needed to know!