Functions with same evaluation outputs and same starting point have different fminsearch outcomes?
Mostrar comentarios más antiguos
Hi guys,
I have two numerical functions f1 and f2 and for some reason, I cannot show the detailed codes for them. Basically, f2 is the vectorized version of f1.
These two functions have the same values for any inputs. Given the same starting point, however, the fminsearch gives different minimizer and different minimized function value.
What could be the reason behind it?
Thanks,
Jialin
Respuesta aceptada
Más respuestas (1)
Walter Roberson
el 18 de Jul. de 2017
0 votos
fminsearch uses a random number generator so it will not produce the same results unless the random seed is rese
1 comentario
Mukul Rao
el 19 de Jul. de 2017
Editada: Alan Weiss
el 19 de Jul. de 2017
Hi Walter, thanks for pitching in. While random number generators are used by many of our solvers, especially global optimization solvers, it is not the case with fminsearch. It's based on the Nelder Mead algorithm, MATLAB's implementation of this algorithm is deterministic. I have verified this looking at the source code for "fminsearch" and also getting in touch with my colleagues in development. You can also try running the fminsearch algorithm on the same problem with the same initial conditions several times, it always returns the same solution (I've tried this on R2017a).
Categorías
Más información sobre Mathematics and Optimization en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!