Generalized deviations in risk analysis