Marginalization, likelihood and structured models