  We present the first public release of our Bayesian inference tool, Bayes-X,
for the analysis of X-ray observations of galaxy clusters. We illustrate the
use of Bayes-X by analysing a set of four simulated clusters at z=0.2-0.9 as
they would be observed by a Chandra-like X-ray observatory. In both the
simulations and the analysis pipeline we assume that the dark matter density
follows a spherically-symmetric Navarro, Frenk and White (NFW) profile and that
the gas pressure is described by a generalised NFW (GNFW) profile. We then
perform four sets of analyses. By numerically exploring the joint probability
distribution of the cluster parameters given simulated Chandra-like data, we
show that the model and analysis technique can robustly return the simulated
cluster input quantities, constrain the cluster physical parameters and reveal
the degeneracies among the model parameters and cluster physical parameters. We
then analyse Chandra data on the nearby cluster, A262, and derive the cluster
physical profiles. To illustrate the performance of the Bayesian model
selection, we also carried out analyses assuming an Einasto profile for the
matter density and calculated the Bayes factor. The results of the model
selection analyses for the simulated data favour the NFW model as expected.
However, we find that the Einasto profile is preferred in the analysis of A262.
The Bayes-X software, which is implemented in Fortran 90, is available at
http://www.mrao.cam.ac.uk/facilities/software/bayesx/.
