Introduction

Many measurements in Physics are based on counting events belonging to a well defined `class'. They could be the number of electric pulses, registered within a given time interval, exceeding a properly set threshold, as in a Geiger counter; or the number of events observed, for a given integrated luminosity, in a region defined by properly chosen `cuts' in the multi-dimensional space defined on the basis of geometrical and kinematic variables of the final state particles, a typical problem in Particle Physics. However, the aim of physicists is not limited in counting how many events will occur in each `class' satisfying some detector related criteria, but rather in inferring the physical quantities which are related to them, as the intensity of radioactivity or the production rate of a given physical final state resulting from the collision of two particles, to continue with our examples. This also implies that the `experimentally defined class' (`being inside cuts') is only a proxy for the `physical class' of interest, that might be a radioactive particle in a given energy range, or a particular final state resulting from a collision. This is in analogy with the case when we are interested in counting the number of individuals of a population infected by a specific agent using as a proxy the number of individuals tagged `positive' by suitable tests, by their nature imperfect.1

If we change the conditions of the experiment, that is, going on with our examples, we place the Geiger counter in a different place, or we vary the initial energy of the colliding particles (or we tag somehow the final state), we usually register different numbers of events in our reference class. This could just be due to statistical fluctuations. But it could (also) be due to a variation of the related physical quantity. It is then crucial, as well understood, to associate an uncertainty to the `measured' variation.

If the observed numbers are `large', things get rather easy, thanks to the Gaussian approximation of the probability distributions of interest. When, instead, the numbers are `small' the question can be quite troublesome (see, e.g., Refs. [2,3,4,5,6,7]). For example, Ref. [3] focus on the “errors on ratios of small numbers of events”, leading the readers astray: we are usually not interested in the ratios of `counts', but rather on the ratios of radioactivity levels or of production rates, and so on.

The aim of this paper is to review these questions following consistently the rules of probability theory. The initial, crucial point is to make a clear distinction between the empirical observations (the numbers of event of a given `experimentally defined class') and the related physical quantities we are interested to infer, although in a probabilistic way. We start playing with the Poisson distribution in Sec. [*], referring to Appendix A for a reminder of how this distribution is related not only to the binomial (as well known), but also to other important distributions via the Poisson process, which has indeed its roots in the Bernoulli process. In Sec. [*] we show how to use the Bayes' rule to infer Poisson $\lambda$'s from the observed number of counts and then how to get the probability distribution of their ratio $\rho$ making an exact propagation of uncertainties, that is $f(\lambda_1/\lambda_2)$ from $f(\lambda_1)$ and $f(\lambda_2)$. Then in Sec. [*] we move to the inference of intensities of the Poisson processes (or `rates' $r$, in short), related to $\lambda$ by $\lambda\!=\!r\!\cdot\!T$, with $T$ being the `observation time' - it can be replaced by `integrated luminosity' or other quantities to which the Poisson parameter $\lambda$ is proportional. In the same section the `anxiety-inducing' [8] question of the priors, assumed `flat' until Sec. [*], is finally tackled and the conjugate priors are introduced, showing, in particular, how to apply them in sequential measurements of the same rate. The technical question of getting the probability distribution of the ratio of rates is tackled in Sec. [*]. Again, closed formulae are `luckily' obtained, which can be extended to the more general problem of getting the probability density function (pdf), and its summaries, of a ratio of Gamma distributed variables.

When the game seems at the end, in Sec. [*] we modify the `graphical' model (indeed a visualization of the underlying logical causal model) and restart the analysis, this time really inferring directly $\rho$, as it will be clear. The implications of the different models and of the priors appearing in each of them will be analyzed with some care. Finally, in Sec. [*] the same models are analyzed making use of Markov Chain Monte Carlo (MCMC) methods, exploiting JAGS. The purpose is twofold. First we want to cross-check the exact results obtained in the previous section, although the latter were limited to uniform priors of the `top parents' of the causal model. Second this allows not only to take into account more realistic priors, but also to enlarge the models including efficiencies and background, for which examples of graphical model are provided. Another interesting question, that is how to fit the ratio of rates as a function of another physical question will be also addressed, showing how to modify the causal model, but without entering into the details. The related issue of `combining ratios' is also discussed and it shows once more the importance of the underlying model.