Improving First and Second-Order Methods by Modeling Uncertainty