GithubHelp home page GithubHelp logo

flower-butterfly / histimator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from histimator/histimator

0.0 1.0 0.0 1.22 MB

A solution for performing maximum likelihood estimation on models built from histogram templates.

Home Page: https://histimator.readthedocs.io/en/latest/

License: Other

Python 7.59% Makefile 0.39% Jupyter Notebook 92.02%

histimator's Introduction

Histimator

Documentation Status

A solution for performing maximum likelihood estimation on models built from histogram templates.

Usage

the histimator core directory has a file called Models containing the core HistiModel class.

the model is initialised:

from histimator.models import HistiModel
model = HistiModel("model name")

Each channel is defined as:

from histimodel.Channel import HistiChannel
SR = HistiChannel("SignalRegion")

data can be added to the channels as:

SR.SetData([list of data points])

any number of samples are defined as:

from histimator.models import HistiSample
sig = HistiSample("Signal")
bkg = HistiSample("Background")

each of which needs a histogram:

sig.SetHisto(numpy.histogram)
bkg.SetHisto(numpy.histogram)

currently the only parameters available are an overal normalisation on these templates. this is given with a name an initial value (default 1) and a range (default [0.1,10]). Currently no implementation is actually in place to tell Minuit about this range...:

sig.AddNorm("some_norm",1,0,3)

Finally, the samples must be added to the channel and this added to the model.:

SR.AddSample(sig)
SR.AddSample(bkg)
model.AddChannel(SR)

This model can now be evaluated using probfit Binned Likelihood function:

from iminuit import Minuit
from probfit import BinnedLH
blh = BinnedLH(model.pdf, data, bins=10, bound=bound, extended=True)
m = Minuit(blh, some_norm=0.5, error_some_norm=1.5)
m.migrad()

this has various built in plotting functionality.

https://github.com/Histimator/Histimator/raw/master/docs/fitnorm.png

Credits

histimator's People

Contributors

vincecr0ft avatar yhaddad avatar

Watchers

 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.