Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Baker-Cousins style log likelihood #2

Closed
ashleyrback opened this issue Nov 6, 2014 · 0 comments · Fixed by #14
Closed

Add Baker-Cousins style log likelihood #2

ashleyrback opened this issue Nov 6, 2014 · 0 comments · Fixed by #14
Assignees
Labels
Milestone

Comments

@ashleyrback
Copy link
Contributor

Write a method to perform calculation of log likelihood, based on Baker-Cousins method of setting limits

Will form get_log_likelihood method in #4

@ashleyrback ashleyrback self-assigned this Nov 6, 2014
@ashleyrback ashleyrback added this to the Alpha milestone Nov 6, 2014
ashleyrback added a commit to ashleyrback/echidna that referenced this issue Jan 20, 2015
This is the class described in snoplusuk#4, and provides the functionality required
by snoplusuk#2, snoplusuk#5 and snoplusuk#6, although the structure is modified. As such this pull request
fixes snoplusuk#2, closes snoplusuk#4, resolves snoplusuk#5 and fixes snoplusuk#6.

The module contains three functions to calculate chi squared for a number given
number of observed events and number of expected events. The forms of chi
squared calculation included are Pearson's, Neyman's and the Poisson Likelihood
chi squared.

The module also adds the `ChiSquared` class that acts as a calculator for a
given `form` of chi squared calculation. It can also be initialised with
penalty term information via the keyword argument `penalty_term`. Or this can
be specified when calling the `get_chi_squared` method. The method takes two 1D
numpy arrays, representing the observed (or "data") spectrum and the expected
(or "MC") spectrum, as arguments and iterates over the array, calculating the
chi squared for each bin using the appropriate function, and adding a penalty
term if required. The method returns the total chi squared comparing the two
spectra.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant