Hello,
At the highest level, that error indicates that EViews is unsure whether the results of the optimization really represent a minimum (or maximum) of your function. EViews tests the final parameter values using two classic criteria, 1) is the gradient of your function at that point zero, and 2) is the Hessian of your function at that point positive (or negative) definite? Those are the first and second order conditions mentioned in the error message, respectively. There are many reasons one or both of those conditions might be false at the final parameter values:
- The optimization terminated before it could find a minimum (or maximum). Increasing the iteration limit and/or decreasing the convergence threshold may address this.
- There are regions of the parameter space which if used as initial values don't lead to a minimum (or maximum). Restarting with different initial values may address this.
- There are structures in the "landscape" of values produced by your function that the optimization algorithm simply has trouble handling, e.g., saddle points or minima (or maxima) that are neither globally nor locally identified. Such structures could be natural phenomenon in your function or the result of some type of misspecification. For example, constrained systems with insufficient constraints frequently fail in this way.
It can be challenging to determine why an optimization is failing. One quick thing you might compare are the results in the successful versus unsuccessful optimization runs. Do the successful runs produce the same result? Do the unsuccessful runs produce the same result?