Inferring the number of planets N in an exoplanetary system from radial velocity ( RV ) data is a challenging task . Recently , it has become clear that RV data can contain periodic signals due to stellar activity , which can be difficult to distinguish from planetary signals . However , even doing the inference under a given set of simplifying assumptions ( e.g . no stellar activity ) can be difficult . It is common for the posterior distribution for the planet parameters , such as orbital periods , to be multimodal and to have other awkward features . In addition , when N is unknown , the marginal likelihood ( or evidence ) as a function of N is required . Rather than doing separate runs with different trial values of N , we propose an alternative approach using a trans-dimensional Markov Chain Monte Carlo method within Nested Sampling . The posterior distribution for N can be obtained with a single run . We apply the method to \nu Oph and Gliese 581 , finding moderate evidence for additional signals in \nu Oph with periods of 36.11 \pm 0.034 days , 75.58 \pm 0.80 days , and 1709 \pm 183 days ; the posterior probability that at least one of these exists is 85 % . The results also suggest Gliese 581 hosts many ( 7-15 ) “ planets ” ( or other causes of other periodic signals ) , but only 4-6 have well determined periods . The analysis of both of these datasets shows phase transitions exist which are difficult to negotiate without Nested Sampling .