Skip to main content

Pure python statistic tools for high energy physics.

Project description

https://travis-ci.org/marinang/lauztat.svg?branch=master Build Status Test Status Coveralls github Codacy Badge https://mybinder.org/badge_logo.svg PyPI PyPI - Python Version https://zenodo.org/badge/DOI/10.5281/zenodo.2593789.svg

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).

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

lauztat-1.1.2-py3.7.egg (40.7 kB view details)

Uploaded Source

lauztat-1.1.2-py3-none-any.whl (31.6 kB view details)

Uploaded Python 3

File details

Details for the file lauztat-1.1.2-py3.7.egg.

File metadata

  • Download URL: lauztat-1.1.2-py3.7.egg
  • Upload date:
  • Size: 40.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for lauztat-1.1.2-py3.7.egg
Algorithm Hash digest
SHA256 deee302bc4c7417cdff827feaa66007bd4be89a3135f8042dba4a887ca68608d
MD5 c060b15cf16ea3e3a1454c0e0116724f
BLAKE2b-256 f6efb48caeb1d62901f022b2cfd8ee5e2641ed623bbb0753051f32d2183a9a8e

See more details on using hashes here.

File details

Details for the file lauztat-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: lauztat-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 31.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for lauztat-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7bc1044f492421b51d5546ac94de7cd97ab94b08476b2a61ac229eb1523d378f
MD5 83b130e80527c4f8ad0edf9b3d68a9d5
BLAKE2b-256 9aad727ed1bcf8a3270c90bdd6bbbf66cabd33ee37a780f1fc8d6f1b003f7b45

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page