  Stars which pass close to the Sun can perturb the Oort cloud, injecting
comets into the inner solar system where they may collide with the Earth. Using
van Leeuwen's re-reduction of the Hipparcos data complemented by the original
Hipparcos and Tycho-2 catalogues, along with recent radial velocity surveys, I
integrate the orbits of over 50 000 stars through the Galaxy to look for close
encounters. The search uses a Monte Carlo simulation over the covariance of the
data in order to properly characterize the uncertainties in the times,
distances, and speeds of the encounters. I show that modelling stellar
encounters by assuming instead a linear relative motion produces, for many
encounters, inaccurate and biased results. I find 42, 14, and 4 stars which
have encounter distances below 2, 1, and 0.5 pc respectively, although some of
these stars have questionable data. Of the 14 stars coming within 1 pc, 5 were
found by at least one of three previous studies (which found a total of 7
coming within 1 pc). The closest encounter appears to be Hip 85605, a K or M
star, which has a 90% probability of coming between 0.04 and 0.20 pc between
240 and 470 kyr from now (90% Bayesian confidence interval). However, its
astrometry may be incorrect, in which case the closest encounter found is the
K7 dwarf GL 710, which has a 90% probability of coming within 0.10-0.44 pc in
about 1.3 Myr. A larger perturbation may have been caused by gamma Microscopii,
a G6 giant with a mass of about 2.5 Msol, which came within 0.35-1.34 pc (90%
confidence interval) around 3.8 Myr ago.

Solar and Stellar Astrophysics;Earth and Planetary Astrophysics