Latent indices in assortative matching models