Global optimization of statistical functions with simulated annealing