Learning probability density functions from marginal distributions with applications to Gaussian mixtures