Bayesian methods for the analysis of ultra-high-energy cosmic rays