  We use percent-level precision photometric redshifts in the UltraVISTA-DR1
near-infrared survey to investigate the changing relationship be- tween galaxy
stellar mass and the dark matter haloes hosting them to $z\sim2$. We achieve
this by measuring the clustering properties and abundances of a series of
volume-limited galaxy samples selected by stellar mass and star-formation
activity. We interpret these results in the framework of a phenomenological
halo model and numerical simulations. Our measurements span a uniquely large
range in stellar mass and redshift and reach below the characteristic stellar
mass to $z\sim2$. Our results are: 1. At fixed redshift and scale, clustering
amplitude depends monotonically on sample stellar mass threshold; 2. At fixed
angular scale, the projected clustering amplitude decreases with redshift but
the co-moving correlation length remains constant; 3. Characteristic halo
masses and galaxy bias increase with increasing median stellar mass of the
sample; 4. The slope of these relationships is modified in lower mass haloes;
5. Concerning the passive galaxy population, characteristic halo masses are
consistent with a simply less-abundant version of the full galaxy sample, but
at lower redshifts the fraction of satellite galaxies in the passive population
is very different from the full galaxy sample; 6. Finally we find that the
ratio between the characteristic halo mass and median stellar mass at each
redshift bin reaches a peak at ${\log(M_h/M_\odot)}\sim12.2$ and the position
of this peak remains constant out to $z\sim2$. The behaviour of the full and
passively evolving galaxy samples can be understood qualitatively by
considering the slow evolution of the characteristic stellar mass in the
redshift range probed by our survey.
