Finding floating point errors in optimization

Use this forum to post Vensim related questions.
Post Reply
LAUJJL
Senior Member
Posts: 1477
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Finding floating point errors in optimization

Post by LAUJJL »

Hi

When I run an optimization, some simulations cause floating point errors and I do not find where the floating point error
occured. Vensim tells me the first simulation where the floating point error happened, but if I make a simple simulation with the values of the parameters that caused the floation point error, the simulation does not tell any floating point error. It only says that a queue has gone negative. In fact it has gone to a value of -0.000000001. Is it the cause of the floatinf point error?
Regards.
tfhavel
Junior Member
Posts: 11
Joined: Wed Jan 30, 2008 9:41 pm

Re: funny things that happen during optimization

Post by tfhavel »

Well, I usually get a few floating point errors during optimization, which seems to be benign (although I wish someone would confirm this!). Occasionally I get one which causes the optimizer to quit, however (and I have no idea what the difference between them is). Right now, however, I am most perplexed by the fact that I can run a simulation and get one value of the payoff, and then immediately with everything the same to the best of my knowledge start an optimization and have it report a drastically (2 orders of magnitude greater) different starting value for the payoff. It goes back down fast but I still can't help but wonder: why?
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

A negative queue does not cause a floating point error. If you don't get a floating point error with the reported parameter values it may be that the conditions to get the error are very sensitive and the number of digits output in the error message is not enough to generate the problem.

In general floating point errors during optimization should be investigated. If the parameter values generating these are near to the optimal values then the model may not be robust. If they are far from the optimal values the search ranges can probably be changed.

As far as finding a different payoff on optimization - one thing to check for is the optimization control file which does allow specification of initial values for variables. If you really want to chase it down set the optimizer to OFF and then running the optimizer should just five you the initial simulation it makes and you can do a runs compare.
LAUJJL
Senior Member
Posts: 1477
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

floating point errors

Post by LAUJJL »

Hi Bob and Thavel

Thank's for the answer.
The parameters values generating the floating point errors where indeed far away from the optimum.
But I still tried to spot them, because it can hide some subtle
bugs. Indeed I found the errors. Some set of parameters where generating weird policies and I had to modify the model to make these policies impossible to happen.
Regards.
JJ
Post Reply