  When searching for exoplanets, one wants to count how many planets orbit a
given star, and to determine what their orbital parameters are. If the
estimated orbital elements are too far from those of a planet truly present,
this should be considered as a false detection. This setting is a particular
instance of a general one: aiming to retrieve which parametric components are
in a dataset corrupted by nuisance signals, with a certain accuracy on their
parameters. We exhibit a detection criterion minimizing false and missed
detections, either as a function of their relative cost, or when the expected
number of false detections is bounded. If the components can be separated in a
technical sense discussed in detail, the optimal detection criterion is a
posterior probability obtained as a by-product of Bayesian evidence
calculations, and we discuss how it can be calibrated. We show on two
simulations emulating exoplanet searches that it can significantly outperform
other criteria. Finally, we show that our framework offers solutions for the
identification of components of mixture models, and Bayesian false discovery
rate control when hypotheses are not discrete.
