  We carry out a Bayesian analysis of dark matter (DM) direct detection data to
determine particle model parameters using the Truncated Marginal Neural Ratio
Estimation (TMNRE) machine learning technique. TMNRE avoids an explicit
calculation of the likelihood, which instead is estimated from simulated data,
unlike in traditional Markov Chain Monte Carlo (MCMC) algorithms. This
considerably speeds up, by several orders of magnitude, the computation of the
posterior distributions, which allows to perform the Bayesian analysis of an
otherwise computationally prohibitive number of benchmark points. In this
article we demonstrate that, in the TMNRE framework, it is possible to include,
combine, and remove different datasets in a modular fashion, which is fast and
simple as there is no need to re-train the machine learning algorithm or to
define a combined likelihood. In order to assess the performance of this
method, we consider the case of WIMP DM with spin-dependent and independent
interactions with protons and neutrons in a xenon experiment. After validating
our results with MCMC, we employ the TMNRE procedure to determine the regions
where the DM parameters can be reconstructed. Finally, we present CADDENA, a
Python package that implements the modular Bayesian analysis of direct
detection experiments described in this work.
