Page 1 of 1

@optiter - illegal name or reserved name

Posted: Tue Nov 10, 2020 4:49 am
by MarF
Dear EViews Team,

I have encountered the following problem with @optiter function. I am using EViews 11 with the latest updates.
EViews reports error when it is used within the optimize command:
@optiter is an illegal name or reserved name.

EViews manual provides the optimize command example where it is possible to retrive some information about optimization process.
Meaning, I added the @optiter function to the following example and this generates error (example below). Let me mention that it has no meaning whether @optiter is used within subroutine (which is optimized) or post-optimization.

@optmessage and @optstatus work just fine. I have one more question when it comes to @optstatus. As it is said within manual @optstatus - "provides a status code for the optimizer, both during and post-optimization." Could you give the list of possible status codes?

Code: Select all

wfcreate u 200 subroutine f(scalar !y, scalar !x) !y = 5*!x^2 - 3*!x - 2 'scalar iter2=@optiter endsub scalar in = 0 scalar out = 0 optimize(min, noerr) f(out, in) string os_mess=@optmessage scalar os_stat=@optstatus scalar iter=@optiter

Re: @optiter - illegal name or reserved name

Posted: Wed Nov 11, 2020 11:49 am
by EViews Matt
Hello,

It turns out the correct function name is @optiters, plural, rather than the @optiter. We'll need to update the documentation.

Regarding the status codes, here's a list of the code values, their meaning, and the associated message as returned by @optmessage:
  • 0 - The optimization terminated successfully.
    • "Convergence achieved"
  • 100 - The user manually aborted the optimization (e.g. pressed F1).
    • "Aborted by user"
  • 101 - The optimization terminated early because the iteration limit was reached.
    • "Convergence not achieved"
  • 102 - The optimization terminated early because the objective function value is improving too slowly or stalled.
    • "Failure to improve ??? (function non-zero)"
  • 103 - The optimization terminated, but the gradient is non-zero.
    • "Failure to improve ??? (non-zero gradients)"
  • 104 - The optimization terminated, but the Hessian is not positive definite.
    • "Failure to improve ??? (singular hessian)"
  • 1000 - The optimization could not begin because the initial coefficients or variables contain infinities or NAs.
    • "Optimization failed: optimization starting values contain missing values"
  • 1001 - The optimization could not begin because the objective function could not be evaluated at the initial values.
    • "Optimization failed: unable to evaluate objective at optimization starting values"
  • 1002 - The optimization could not begin because the objective function Jacobian could not be evaluated at the initial values.
    • "Optimization failed: unable to evaluate gradients at optimization starting values"
  • 1003 - The optimization could not begin because the object function Jacobian is zero at the initial values.
    • "Optimization failed: gradients are singular/zero at optimization starting values"
  • 1004 - The optimization could not begin because the object function Jacobian is singular at the initial values.
    • "Optimization failed: gradients are singular/zero at optimization starting values"

Re: @optiter - illegal name or reserved name

Posted: Thu Nov 12, 2020 3:36 am
by MarF
Thank you. That clarifies things.