Optimization of stochastic uncertain systems: large deviations and robustness