Optimal way to parse parameters (fmincon).

Hi there,
My question is very straightforward: for a function that depends on multiple parameters, say f(a,b,c), what is the optimal way to parse the fixed parameters (in this example "b" and "c") when calling fmincon.
However, in my experiments using "global" actually improved performance slightly.
To give you a background, I ran several Monte Carlo experiments (10MM) where each run calls fmincon once. Thus, even a slight performance improvement might reduce the computational time substantially.
Thanks,

 Accepted Answer

John D'Errico
John D'Errico on 6 Apr 2017
Edited: John D'Errico on 6 Apr 2017
I honestly don't think we can KNOW the truly optimal way. It may easily depend on release, since TMW can change things at their whim, and they are not going to worry about how a change in perhaps the parser might impact something subtle like this.
It will SURELY depend on the exact implementation of how you pass the variables. Again, subtle differences might make subtle changes in the time.
I'd suggest you run the test, and pick the way that is fastest for you, on your problem.

More Answers (0)

Categories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!