Skip to content

TeoTech2/majorana

Repository files navigation

Likelihood Analysis

This repository contains tools for likelihood ratio analysis, particularly focused on signal detection in physics data.

Likelihood Analysis

How to Use

The repository contains several Python scripts for performing likelihood analysis:

  • log_Analysis.py: Interactive analysis tool for examining data and calculating likelihood ratios
  • likelihood_ratio.py: Core implementation of likelihood ratio methods with interactive visualization
  • peak_fitter.py: Tools for fitting peaks in spectral data

Getting Started

  1. Clone this repository:

    git clone https://github.com/yourusername/majorana.git
  2. Install the required dependencies:

    pip install numpy scipy matplotlib pandas
  3. Run the interactive analysis tool:

    python log_Analysis.py
  4. For likelihood ratio simulation:

    python likelihood_ratio.py

Theoretical Background

The Asimov data set is a hypothetical data set in which the observed number is exactly equal to its expectation. For our experiment, this means setting

$$n = s + b.$$

Define the likelihood ratio as

$$\lambda = \frac{L(0)}{L(s)} = \frac{b^b e^{-b}}{n^n e^{-n}}.$$

The test statistic $q_0$ is defined by

$$q_0 = -2 \ln \lambda.$$

Taking the logarithm, we have:

$$\ln \lambda = \ln \left( \frac{b^b e^{-b}}{n^n e^{-n}} \right) = n \ln \frac{b}{n} - b + n.$$

Thus,

$$q_0 = -2 \ln \lambda = -2 \left[ n \ln \frac{b}{n} - b + n \right] = 2 \left[ n \ln \frac{n}{b} + b - n \right].$$

For $n = s + b$ we have that:

$$q_0 = 2 \left[ (s + b) \ln \left( \frac{s + b}{b} \right) - s \right]$$

Remember that the test statistic $Z = \Phi^{-1}(1 - p)$, where $p$ is the probability of an event occurring. Now, the pdf- probability density function is:

$$\rho : x \to \langle x|\theta\rangle$$

Where $\theta$ are the parameters of the function. However, we can also ask the dual question - that is: define

$$\mathcal{L} : \theta \to \langle x|\theta\rangle$$

If the probability of a coin flipping heads, $p_h$ is the parameter of a probability function $P(HH)$ then the likelihood function is:

$$\mathcal{L} : p_h \to [P(HH) = p_h^2]$$

So we see that the likelihood function evaluates the probability of an event not based on the signal, but the parameters of the underlying distribution. Therefore, if the Likelihood is high compared to its maximum value, we think that the underlying parameters are right, and if the Likelihood is low, the parameters are wrong. This is expressed by the test-statistic $\lambda$.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages