# function calculation fail error message from Constrained Optimization

0

Good morning, there.

I got this error message "function calculation fail" when using CO to solve optimization problem. But when I plug in the parameter value of that iteration, Gauss is able to give the function value. I don't understand why it says "function calculation fail". What might cause this problem?

Thanks.

Huihui

0

Apparently the failure occurs after the first iteration.  It would be unusual for it to fail after the first call because CO usually is able to recover when the function fails but sometimes it still can fail and that seems to be what is happening to you.   The function value may be computable with the parameter value at that iteration and still fail because during any iterations CO will try variations on those parameters, in particular for the line search.

What is probably happening is that a temporary value for a parameter is being tried which happens to be outside the computable parameter space.   Such an error suggests that additional constraints are need to keep the parameters inside the computable parameter space.  For example, if you are taking a log of a parameter, CO may be attempting a value of zero for that parameter for calculating the gradient or during a line search.

Put print statements in your objective function procedure printing out all the necessary quantities.  You should be able to see what is happening.  If you see a parameter exceeding computable parameter space, place a constraint on that parameter to keep it inside computable parameter space.

If the failure is the result of a complex calculations involving that parameter, use the procedure computing the objective function for the procedure placing the constraint on the parameter.

0

Apparently the failure occurs after the first iteration.  It would be unusual for it to fail after the first call because CO usually is able to recover when the function fails but sometimes it still can fail and that seems to be what is happening to you.   The function value may be computable with the parameter value at that iteration and still fail because during any iterations CO will try variations on those parameters, in particular for the line search.

What is probably happening is that a temporary value for a parameter is being tried which happens to be outside the computable parameter space.   Such an error suggests that additional constraints are need to keep the parameters inside the computable parameter space.  For example, if you are taking a log of a parameter, CO may be attempting a value of zero for that parameter for calculating the gradient or during a line search.

Put print statements in your objective function procedure printing out all the necessary quantities.  You should be able to see what is happening.  If you see a parameter exceeding computable parameter space, place a constraint on that parameter to keep it inside computable parameter space.

If the failure is the result of a complex calculations involving that parameter, use the procedure computing the objective function for the procedure placing the constraint on the parameter.

• ### Aptech Systems, Inc. Worldwide Headquarters

Aptech Systems, Inc.
2350 East Germann Road, Suite #21
Chandler, AZ 85286

Phone: 360.886.7100
FAX: 360.886.8922

• ### Training & Events

Want more guidance while learning about the full functionality of GAUSS and its capabilities? Get in touch for in-person training or browse additional references below.

• ### Tutorials

Step-by-step, informative lessons for those who want to dive into GAUSS and achieve their goals, fast.

• ### Want to find out more?

Get a real answer from a real person

• ### Have a Specific Question?

Get a real answer from a real person

• Need Support?
• ### Support Plans

Premier Support and Platinum Premier Support are annually renewable membership programs that provide you with important benefits including technical support, product maintenance, and substantial cost-saving features for your GAUSS System or the GAUSS Engine.

• ### User Forums

Join our community to see why our users are considered some of the most active and helpful in the industry!