Info

This question is closed. Reopen it to edit or answer.

Varying results from the fmincon function

2 views (last 30 days)
Ben
Ben on 12 Feb 2012
Closed: MATLAB Answer Bot on 20 Aug 2021
Hi there!
I'm using the fmincon function to find the values of a vector (153 x 1) that optimise a user defined function. I'm finding that the fmincon function yields different results depending on the computer I run it on even though the function specification is the same in each case (i.e. the start estimate, solution tolerance, function evaluation tolerance, constraint tolerance are all the same). Unfortunately, I'm neither a mathematician nor expert in the use of MatLab so I'm concerned about which of my results are most reliable (or correct). Should I expect different results from different computers? I've deliberately omitted the finer details of my problem specification from this post simply for conciseness, but if it would help, just give me a yell and I'll post whatever is required!
Thanks for your help,
Ben

Answers (2)

Leonabil
Leonabil on 29 May 2012
A similar problem here. I got different answers running the same problem on the same computer under the same conditions!!! weird stuff!! Did you sort this out? Any advice? Thanks for posting, Cheers

Ben
Ben on 31 May 2012
To be honest, I never really got to the bottom of the problem (at least not conclusively), but the evidence suggests that my problem suffers computational instability - As I understand it, when a computer performs a calculation, it does so to a level of precision which is set by the processor design. This level of precision will therefore differ from one computer to the next depending on the processor they use. This will lead to very small differences in the answers obtained from one computer compared to that of another. This difference is usually negligible, but when computers perform many iterations of the same calculation, this difference can get magnified on each successive iteration and therefore become increasingly non-negligible. Obviously, the extent to which a problem exhibits this phenomenon depends upon the number of iterations being performed and the characteristics of the calculation (s) itself. This explanation certainly fits the evidence I observed (e.g. using a different computer but with the same processor specification yeilded the same results) though I found no conclusive proof.
Your problem sounds slightly different though. I found that the same computer always yeilded the same results, but it seems from your post that you are getting different results from the same computer. I'm no expert, but if I were you, I'd first look at the possibility that your problem is not converging at all - check the exit flag for that. Failing that, perhaps look at whether your problem has multiple solutions - try different starting estimates and specifically, try using the solution from one run as the starting point of another.

Products

Community Treasure Hunt

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

Start Hunting!