@optiter - illegal name or reserved name

For notifying us of what you believe are bugs or errors in EViews.
Please ensure your copy of EViews is up-to-date before posting.

Moderators: EViews Gareth, EViews Moderator

MarF
Posts: 18
Joined: Mon Aug 10, 2009 1:36 am

@optiter - illegal name or reserved name

Postby MarF » Tue Nov 10, 2020 4:49 am

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

EViews Matt
EViews Developer
Posts: 560
Joined: Thu Apr 25, 2013 7:48 pm

Re: @optiter - illegal name or reserved name

Postby EViews Matt » Wed Nov 11, 2020 11:49 am

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"

MarF
Posts: 18
Joined: Mon Aug 10, 2009 1:36 am

Re: @optiter - illegal name or reserved name

Postby MarF » Thu Nov 12, 2020 3:36 am

Thank you. That clarifies things.


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 16 guests