SMS dit: Statistical quality control: a loss minimization approach