Giter Site home page Giter Site logo

marinang / lauztat Goto Github PK

View Code? Open in Web Editor NEW
17.0 2.0 2.0 6.29 MB

Pure python statistic tools for high energy physics.

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%
hep high-energy-physics statistics python-statistics experimental-physics particle-physics

lauztat's Introduction

lauztat

https://travis-ci.org/marinang/lauztat.svg?branch=master Build Status Test Status Coveralls github Codacy Badge PyPI PyPI - Python Version

Pure python statistics tools for high energy physics using zfit as a backend for maximum likelihood fits.

Tests for discovery, upper limits and confidence intervals are provided based on likelihood ratios in a frequentist approach (using pseudo-experiments) or using asymptotic formulae from "Asymptotic formulae for likelihood-based tests of new physics" [arxiv:1007.1727].

lauztat has been developed at EPFL, Lausanne Switzerland (laus' or lauz is how the cool kids call Lausanne).

The project is currently being ported and slighty redesigned to scikit-hep/scikit-stats package.

Installation

Install lauztat like any other Python package:

pip install lauztat                       # maybe with sudo or --user, or in virtualenv

Dependencies

Getting started

Usual HEP results can be recast in terms of hypothesis testing where you have to choose a null H0 and an alternative H1 hypothesis, H0 being the one you want to disprove. To do a test you will need your data (and weights), a model, a loss function builder and a minimizer as input to a calculator (FrequentistCalculator or AsymptoticCalculator).

Discovery:

if you do a measurement to find signals S in a dataset and you find an excess, this test answers "is the data compatible with the background only ?" with:

  • H0: background only (S = 0)
  • H1: presence of a signal (S ≠ 0)

The test return a p-value or a significance Z. If Z ≥ 3 there is an evidence and if Z ≥ 5 a discovery of a signal.

Examples of significance computations for a gaussian peak over an exponential background are provided for the asymptotic calculator and the frequentist calculator and can be ran in mybinder.

Upper limit:

if you find a small signal excess in a dataset, but not enough to claim an evidence or a discovery, you can exclude large signal yields S:

  • H0: background + some signal (S = S0)
  • H1: S < S0

S0 is adjusted to a predefined p-value, typically 5%. S0 is the upper limit on the signal yield S with 95 % confidence level (CL = 1 - p ; p = 5 % ⟺ CL = 95%).

Examples of CLs upper limits on the signal yield for a gaussian peak over an exponential background are provided for the asymptotic calculator and the frequentist calculator and can be ran in mybinder.

Confidence interval:

if you do a measurement of a parameter α with an estimator ᾰ, given an observation ᾰobs what value of α are not rejected at a certain confidence level (typically 68%)?

  • H0: α ≤ α down or α ≥ αup
  • H1: αdown < α < αup

αdown and αup are adjusted such the test returns a p-value of 32%.

Examples of confidence intervals on the mean of a gaussian peak are provided for the asymptotic calculator and the frequentist calculator (Feldman and Cousins confidence interval [arxiv:9711021]) and can be ran in mybinder.

lauztat's People

Contributors

codacy-badger avatar marinang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.