optRisk function

Generic function for the computation of the minimal risk