Random Effect and Latent Variable Model Selection