Page 1 of 1

error in compiling, user defined function

PostPosted: Sat Oct 22, 2016 3:33 pm
by nckdams
Hello,

I am trying to solve an open economy model for 2 countries.
I have the following mod, function and steady state file.

Dynare says that there is some issue- "Failure in initial user-supplied objective function evaluation. FSOLVE cannot continue." I have tried to see if I have written the function incorrectly, but that's not the case.

I am calling a function into the steady state file, and running the mod file. My files are attached.

Re: error in compiling, user defined function

PostPosted: Sat Oct 22, 2016 4:08 pm
by jpfeifer
I get the error message
Not enough input arguments.

Error in myfun (line 19)
F = [n - ( ((x - muc)^(-ec) * (1-alpha))/(mun) * mc * KN^(alpha)*(1-taunss) );


The reason is that myfun relies on a bunch of parameters that are not known to the function, because you did not pass them over.

Another thing: you cannot run stoch_simul with a zero lower bound on interest rates.

Re: error in compiling, user defined function

PostPosted: Fri Oct 28, 2016 3:22 am
by nckdams
Hello Dr. Pfeifer,

I have corrected the codes, as suggested. instead of a function file, I created an anonymous function as is usually there in these codes. the steady state file is complete. I still have the following issues in implementing this open economy model for large economies.

(a) The residuals indicate that I need to pick a value of consumption home and abroad which also implies that marginal utility of money across economies is identical because they are a part of eurozone.

(b) I solved them using 'levenbergMarquardt' and 'fsolve' both. Could it be a possibility that there are no roots possible? Or is it an issue with the way I am closing large open economies like the ones I am trying to model?

I have updated the files. And I thanks for the prompt reply.

ND

Re: error in compiling, user defined function

PostPosted: Fri Oct 28, 2016 4:53 pm
by jpfeifer
Your steady state file says that the system of equations was sucessfully solved. At the same time, Dynare complains that two equations have residuals. This usually means that the steady state file and the entered model do not match. There is either a problem with you steady state file, or the entered model equations are still wrong (or both). For the beginning, focus on the equations with residuals.