Page 1 of 1

Deterministic Curdia&Woodford

PostPosted: Sun Mar 02, 2014 5:30 pm
by lah89
Hey all,

I am new to Dynare and trying to replicate Curdia&Woodford "Credit Frictions and Optimal Monetary Policy".
The equations are taken from http://www.columbia.edu/~mw2230/credit_Appendix.pdf.
I am modelling it in a deterministic way to later-on deal with OBCs.

How can I get this running ? (at least up to a point where it ll tell me that steady; couldnt find a SS, I m currently reading on how to use fsolve in matlab meanwhile :-P )

Appreciate any comments on current structure etc. !

Re: Deterministic Curdia&Woodford

PostPosted: Mon Mar 17, 2014 12:40 pm
by lah89
I would really appreciate any help on this.
Right now it gives me:
line 50, col 64: syntax error, unexpected ';'

??? Error using ==> dynare at 156
DYNARE: preprocessing failed


althought I dont see any ";" missing, thus I guess it is a structural error !?

Re: Deterministic Curdia&Woodford

PostPosted: Mon Mar 17, 2014 1:10 pm
by jpfeifer
Check the brackets in those equations. You have opening brackets that do not close.

Re: Deterministic Curdia&Woodford

PostPosted: Mon Mar 17, 2014 1:36 pm
by lah89
jpfeifer wrote:Check the brackets in those equations. You have opening brackets that do not close.


thx for the reply! I m embarrassed ;)

Current error is

Code: Select all
line 64, col 1: syntax error, unexpected INT_NUMBER


updated file attached.

Re: Deterministic Curdia&Woodford

PostPosted: Mon Mar 17, 2014 1:58 pm
by jpfeifer
The steady_state_model-block must define the steady state explicitly, not implicitly. See the examples in "A Guide to Specifying Observation Equations for the Estimation of DSGE Models" at https://sites.google.com/site/pfeiferecon/Pfeifer_2013_Observation_Equations.pdf.

Re: Deterministic Curdia&Woodford

PostPosted: Mon Mar 17, 2014 3:01 pm
by lah89
jpfeifer wrote:The steady_state_model-block must define the steady state explicitly, not implicitly. See the examples in "A Guide to Specifying Observation Equations for the Estimation of DSGE Models" at https://sites.google.com/site/pfeiferecon/Pfeifer_2013_Observation_Equations.pdf.



Thats what I had guessed and why I opend the topic regarding the steady state model block, thanks a lot!

Re: Deterministic Curdia&Woodford

PostPosted: Mon Mar 17, 2014 4:41 pm
by lah89
Crossread your paper, thanks again!, find it really well-written by the way.

unfortunately right now no time to solve the system of SS equations by hand towards an explicit form thus I thought I would try running the .mod file without the steady-state-model block (at least up to a point where Dynare tells me that it can not find the SS since I m workin on non-linear level equations without any initvals) but I get this error:
Code: Select all
File: [b]needhelp3.m[/b] Line: 283 Column: 18
The expression to the left of the equals sign is not a valid target for an assignment.

Error in ==> dynare at 162
evalin('base',fname) ;
 


any idea what this might be? Is this already related with the SS computation ?
google said the result could be a mixup between '=' and '==' but I dont see where this applies here.
Also I am running the .mod file as usual, using "dynare needhelp3" and not running it as an .m file (at least not intentionally)

updated file attached.

Re: Deterministic Curdia&Woodford

PostPosted: Mon Mar 17, 2014 7:57 pm
by jpfeifer
Parameters also need to be specified explicitly. You cannot use code like
Code: Select all
(theta - 1)^(-1) = 0.15;

The error message refers to the m-file generated by Dynare. You can open it and see that Dynare translated the above line into:
Code: Select all
(theta - 1)^(-1) = 0.15;

which is not valid Matlab code.

Re: Deterministic Curdia&Woodford

PostPosted: Thu Apr 10, 2014 1:49 pm
by lah89
thanks for the hint on the parameters, changed it and also made some further progress (I thought).

Currently trying to fix:
Impossible to find the steady state. Either the model doesn't have a steady state, there
are an infinity of steady states, or the guess values are too far from the solution


--> This most probably comes from a misspecification of the model, right (since I am trying to replicate a paper with a unique SS) ?

Honestly I am not so sure whether I am caputuring http://www.columbia.edu/~mw2230/credit_0709.pdf with regard to the exogenous variables correctly.
Unclear to me are how to treat G,tau,mu_omega,Z, C_bar_i and the fiscal rule for b_G. (Probably this does not belong here, are there any ECON forums where people discuss papers?)


2 MOD-files attached, deterministic and stochastic version(in which I thought I d know how to deal with the exogenous variables)
I would be grateful if someone could have a look at it ! Appreciate any help !

Re: Deterministic Curdia&Woodford

PostPosted: Thu Apr 10, 2014 5:11 pm
by jpfeifer
It is not necessarily a misspecification issue. Nothing guarantees the steady state to be unique. The important thing is that finding steady states even for correct mod-files is hard and it is always recommended to provide as good starting values as possible. Having said that, it is strange that the steady state finding results in equations 3 and 5 containing NaN because z and mu_omega go to 0. I would focus on those equations.

Re: Deterministic Curdia&Woodford

PostPosted: Thu Apr 24, 2014 3:46 pm
by lah89
thanks again!

made some changes/progress again (decided to already include the extensions of the 2010 paper) and now all but 2 of the static equation residuals are zero when computing the steady state.
Already browsed the forums but still not 100% sure about how to approach this (what are the different options?) and whether there are any further measures for error-diagnostics?


Thanks again in advance !

-mod. FILE ATTACHED BELOW

Re: Deterministic Curdia&Woodford

PostPosted: Mon Apr 28, 2014 8:40 am
by lah89
I fixed it :)