error in compiling, user defined function

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

error in compiling, user defined function

Postby nckdams » Sat Oct 22, 2016 3:33 pm

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.
nckdams
 
Posts: 2
Joined: Sat Oct 22, 2016 4:00 am

Re: error in compiling, user defined function

Postby jpfeifer » Sat Oct 22, 2016 4:08 pm

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: error in compiling, user defined function

Postby nckdams » Fri Oct 28, 2016 3:22 am

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
Attachments
test_v4.mod
(17.38 KiB) Downloaded 83 times
test_v4_steadystate.m
(14.73 KiB) Downloaded 79 times
nckdams
 
Posts: 2
Joined: Sat Oct 22, 2016 4:00 am

Re: error in compiling, user defined function

Postby jpfeifer » Fri Oct 28, 2016 4:53 pm

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany


Return to Dynare help

Who is online

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