The stochastic gradient approximation: an application to Li nanoclusters.