Model Selection Through Sparse Maximum Likelihood Estimation for Multivariate Gaussian or Binary Data