On-Line Optimization of Stochastic Processes