the relationship connecting the stellar mass of a galaxy to the mass of its dark matter halo. In the standard picture of galaxy formation, gas can only cool and form stars if it is in a virialized gravitationally bound dark matter halo [@whiterees78]. In this model the gas cooling rate, the star formation rate and thus the properties of the galaxy depend mainly on the virial mass of the host halo. Thus we expect the stellar mass of a central galaxy to be strongly correlated with the virial mass of the halo in which the galaxy formed. As we discussed in the last section, this corresponds to the virial mass for central galaxies, and to the maximum mass over the halo’s history for satellite galaxies. In the rest of this work, unless noted otherwise, the halo mass $M$ will represent: $$M = \begin{cases}
          M_{\rm vir} & \text{for host halos}\\
          M_{\rm max} & \text{for subhalos}
       \end{cases}
\label{eqnmmax}$$

Note that we have also experimented with instead using the present mass for subhalos, and found that we were not able to reproduce the galaxy clustering properties [see also @conroy06].

The stellar-to-halo mass relation {#s:galaxymap}
---------------------------------

In order to link the stellar mass of 