always return a centroid with a fractional part which does not fall outside of the maximum-pixel boundary and can be thus corrected. For the 3x3 Square, it is rare for noise effects to skew the centroid outside the boundaries of the maximum pixel, and therefore the noiseless mathematical solution is a decent approximation of the required correction.

The situation is less good for the 5x5 algorithm, since noise effects in the outer pixels with low signal, skew more centroids outside of the central maximum pixel, and therefore a Monte-Carlo style simulation would be required in order to develop a correction algorithm numerically. On the other hand, as we showed in paper 1, the 5x5 algorithm gives better controids without correction.

The mathematical solution is simply the comparison of a theoretical probability distribution of centroids, to the real-world probability distribution. If the centroiding accuracy were perfect, then the probability distribution of intra-pixel centroids would simply be a straight line of slope equal to the ratio of the total number of events over the number of sampling bins within a pixel. The corrections need to be performed at a much higher resolution than the physical sampling (1/16th of a pixel), and so 