neg_log_likelihood_approx¶
-
ctapipe.image.
neg_log_likelihood_approx
(image, prediction, spe_width, pedestal)[source]¶ Calculate negative log likelihood for telescope.
Gaussian approximation from [denaurois2009], 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} \]and since we can remove constants and factors in the minimization:
\[- \ln{P} = \ln{θ} + \frac{(s - μ)^2}{θ}\]- 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
- float