neg_log_likelihood_approx#

ctapipe.image.pixel_likelihood.neg_log_likelihood_approx(image, prediction, spe_width, pedestal)[source]#

Calculate negative log likelihood for telescope.

Gaussian approximation from [DNR09], p. 22 (equation between (24) and (25)).

Simplification:

\[ \begin{align}\begin{aligned}θ = σ_p^2 + μ · (1 + σ_γ^2)\\→ P = \frac{1}{\sqrt{2 π θ}} · \exp\left(- \frac{(s - μ)^2}{2 θ}\right)\\\ln{P} = \ln{\frac{1}{\sqrt{2 π θ}}} - \frac{(s - μ)^2}{2 θ}\\ = \ln{1} - \ln{\sqrt{2 π θ}} - \frac{(s - μ)^2}{2 θ}\\ = - \frac{\ln{2 π θ}}{2} - \frac{(s - μ)^2}{2 θ}\\ = - \frac{\ln{2 π} + \ln{θ}}{2} - \frac{(s - μ)^2}{2 θ}\\- \ln{P} = \frac{\ln{2 π} + \ln{θ}}{2} + \frac{(s - μ)^2}{2 θ}\end{aligned}\end{align} \]

We keep the constants in this because the actual value of the likelihood can be used to calculate a goodness-of-fit value

Parameters:
image: ndarray

Pixel amplitudes from image (\(s\)).

prediction: ndarray

Predicted pixel amplitudes from model (\(μ\)).

spe_width: ndarray

Width of single p.e. peak (\(σ_γ\)).

pedestal: ndarray

Width of pedestal (\(σ_p\)).

Returns:
ndarray