Photon statistics without counting photons

We give a detailed analysis of an indirect method used to obtain the photon distribution of a single-mode field using only on/off avalanche photodetectors. The method is based on measuring the field at different quantum efficiencies and then inferring the photon distribution by maximum-likelihood estimation. We address the case when only a limited range of quantum efficiency is available and when these values are not precisely known. The convergence of the method and its robustness against fluctuations are illustrated by means of numerically simulated experiments.