nectarchain.trr_verification_package.utils.ExponentialFitter#

class ExponentialFitter(data, bin_edges)[source]#

Bases: object

Represents an exponential fitter class that computes the expected distribution and the minus 2 log likelihood for a given dataset and exponential parameters.

Attributes:

data (numpy.ndarray): The input data array. bin_edges (numpy.ndarray): The bin edges for the data.

Methods:
compute_expected_distribution(norm, loc, scale):

Computes the expected distribution given the normalization, location, and scale parameters.

expected_distribution(x):

Returns the expected distribution given the parameters in x.

compute_minus2loglike(x):

Computes the minus 2 log likelihood given the parameters in x.

Initialise the ExponentialFitter with data and bin edges.

Parameters:
datanumpy.ndarray

The observed data histogram.

bin_edgesnumpy.ndarray

The edges of the histogram bins.

Methods

compute_expected_distribution

Compute the expected binned exponential distribution.

compute_minus2loglike

Compute the saturated minus-two log-likelihood for a Poisson model with the given exponential parameters.

expected_distribution

Return the expected distribution for a given parameter vector.

compute_expected_distribution(norm, loc, scale)[source]#

Compute the expected binned exponential distribution.

Parameters:
normfloat

Normalisation factor.

locfloat

Location parameter of the exponential distribution.

scalefloat

Scale parameter of the exponential distribution.

Returns:
numpy.ndarray

Expected number of entries per bin.

compute_minus2loglike(x)[source]#

Compute the saturated minus-two log-likelihood for a Poisson model with the given exponential parameters.

Parameters:
xlist of float

Parameter vector [norm, loc, scale].

Returns:
float

Saturated minus-two log-likelihood value.

expected_distribution(x)[source]#

Return the expected distribution for a given parameter vector.

Parameters:
xlist of float

Parameter vector [norm, loc, scale].

Returns:
numpy.ndarray

Expected number of entries per bin.