Covariate-dependent bayesian models for heterogeneous populations