nectarchain.trr_verification_package.utils.ExponentialFitter#
- class ExponentialFitter(data, bin_edges)[source]#
Bases:
objectRepresents 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 the expected binned exponential distribution.
Compute the saturated minus-two log-likelihood for a Poisson model with the given exponential parameters.
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.