Using optimize with a model in the function

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

economist_david
Posts: 1
Joined: Wed Jan 07, 2015 6:49 pm

Using optimize with a model in the function

Postby economist_david » Wed Jan 07, 2015 7:19 pm

I am trying to use the new optimize function to solve for the optimal parameters in a monetary policy response function in the context of a small-scale macroeconomic model. I set up and solve the simple model using the Eviews model environment.

I am currently getting the following error:
"Optimization may be unreliable (first or second order conditions not met) ..."

My program (simplified) looks like this:

Code: Select all

scalar result = 0
scalar parameter = 0

optimize(min) my_model(result, parameter)

subroutine my_model

  parameter_0 = parameter

  my_macro_model.solve

  result = some_model_outcome_0

next


I would like the optimize function to search over 'parameter' by plugging in the new value of parameter, solving a new model scenario, computing a model outcome ('result'), and continuing to iterate until 'parameter' minimizes 'result'. Normally when I run a couple of model scenarios, I define each scenario and tell each how to name the endogenous variables, so one obvious thing I might be doing wrong is not correctly identifying the names of the endogenous variables created in the new scenarios as the optimize function iterates by solving the model anew with each new guess of 'parameter'.

Is what I am trying to do feasible in Eviews? Am I making an obvious mistake?

I apologize for being unable to share my actual code (strict firm rules).

Return to “Programming”

Who is online

Users browsing this forum: Google [Bot] and 44 guests