We describe statistical inverse methods for the computation of initial asteroid orbits within the data processing and analysis pipeline of the ESA Gaia space mission. Given small numbers of astrometric observations across short time intervals, we put forward a random-walk ranging method, in which the orbital-element phase space is uniformly sampled, up to a limiting χ2-value, with the help of the Markov-chain Monte Carlo technique (MCMC). The sample orbits obtain weights from the a posteriori probability density value and the MCMC rejection rate. For the first time, we apply the method to Gaia astrometry of asteroids. The results are nominal in that the method provides realistic estimates for the orbital uncertainties and meets the efficiency requirements for the daily, short-term processing of unknown objects.