Shape constrained inference