Statistics for Optimization, model uncertainty, and testing in risk and insurance