Skip to content

Commit

Permalink
Use likelihood per dof in minimization
Browse files Browse the repository at this point in the history
  • Loading branch information
RuneDominik committed Oct 25, 2023
1 parent 2ea6395 commit 3aba5fd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ctapipe/image/muon/intensity_fitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,11 @@ def negative_log_likelihood(
# scale prediction by optical efficiency of the telescope
prediction *= optical_efficiency_muon

return neg_log_likelihood_approx(image, prediction, spe_width, pedestal)
# neg_log_likelihood_approx is build choosen to reseble a chi2,
# use chi2 per dof for numerical stability in minimization later
return neg_log_likelihood_approx(image, prediction, spe_width, pedestal) / len(
image
)

return negative_log_likelihood

Expand Down

0 comments on commit 3aba5fd

Please sign in to comment.