ENH: add optimization to search locally for better parameter values