Using Statisticsto Automate Stochastic Optimization