estimate_marginal function

Estimate marginal distribution using ML