cta-observatory / ctapipe

Low-level data processing pipeline software for CTAO or similar arrays of Imaging Atmospheric Cherenkov Telescopes
https://ctapipe.readthedocs.org
BSD 3-Clause "New" or "Revised" License
63 stars 267 forks source link

Improve pixel likelihood calculation in muon and image/pixel_likelihoods #1272

Open maxnoe opened 4 years ago

maxnoe commented 4 years ago

The log likelihood functions first calculate the likelihood and then take the log numerically.

The formulas look like the log-likelihood could be written down directly.

The likelihood is essentially a poissonian convolved with a gaussian, at low signal a full possonian approach must be adopted, which requires the sum of contibutions over a number of potential contributing photoelectrons (which is slow and can fail at high signals due to the factorial which mst be calculated).

This is wrong! First, one can simplify the log-likelihood analytically instead of naively calculating first exp and then log of partial terms.

Second, the factorial is not needed at all as it is constant under differentiation with respect to the parameters, so can be discarded completely.

maxnoe commented 4 years ago

The likelihood in the muon intensityfitter was improved in #1390