Dear users,

It would be greatly appreciated if you give me any tip or advice on this matter.

I am trying to run a model of small open economy with financial frictions. It is just like abstracting out labor market frictions in Christiano, Trabandt, and Walentin’s “Introducing Financial Frictions and Unemployment into a Small Open Economy Model” (summary version is here: faculty.wcas.northwestern.edu/~lchrist/course/openeconomy.pdf)

My code fails to work in two ways depending on initial values. For example,

(1) if the bankruptcy rate, F(omegabar), is set 0.03, I have the following error message (‘FSS = 0.03;’ line 121 in the attached mod file):

Starting Dynare (version 4.1.2).

Starting preprocessing of the model file …

Found 44 equation(s).

Evaluating expressions…done

Computing static model derivatives:

- order 1

Computing dynamic model derivatives: - order 1

Processing outputs …done

Preprocessing completed.

Starting MATLAB/Octave computing.

SOLVE: maxit has been reached

??? Error using ==> steady_ at 132

STEADY: convergence problems

Error in ==> steady at 52

steady_;

Error in ==> smallopen_financial1112 at 583

steady;

Error in ==> dynare at 132

evalin(‘base’,fname) ;

(2) if the bankruptcy rate is set to 0.2, then I get this:

Starting Dynare (version 4.1.2).

Starting preprocessing of the model file …

Found 44 equation(s).

Evaluating expressions…done

Computing static model derivatives:

- order 1

Computing dynamic model derivatives: - order 1

Processing outputs …done

Preprocessing completed.

Starting MATLAB/Octave computing.

??? Undefined function or method ‘erf’ for input arguments of type ‘double’ and attributes ‘full scalar complex’.

Error in ==> stdnormal_cdf at 39

cdf = (ones (sz) + erf (x / sqrt (2))) / 2;

Error in ==> normcdf at 54

cdf = stdnormal_cdf ((x - m) ./ s);

Error in ==> smallopen_financial1112_static at 100

rhs =normcdf(T300-y(36),0,1);

Error in ==> lnsrch1 at 77

fvec = feval(func,x,varargin{:}) ;

Error in ==> solve1 at 127

[x,f,fvec,check]=lnsrch1(xold,fold,g,p,stpmax,func,j1,j2,varargin{:});

Error in ==> dynare_solve at 112

[x,info]=solve1(func,x,j1(r(i):r(i+1)-1),j2(r(i):r(i+1)-1),jacobian_flag, bad_cond_flag, varargin{:});

Error in ==> steady_ at 124

[oo_.steady_state,check] = dynare_solve([M_.fname ‘_static’],…

Error in ==> steady at 52

steady_;

Error in ==> smallopen_financial1112 at 583

steady;

Error in ==> dynare at 132

evalin(‘base’,fname) ;

My first question is if both (1) and (2) suggest that I failed to provide correct initial values? I wrote up a separate m file to find more accurate omega and sigma values, but it did not work. I have kept having the error message of (1) or (2). Does the error message in (2) say that error function has an imaginary number in it?

A second question is if there is any other way for me to make this code work or any things to try? Any advice or suggestion would be greatly appreciated. Thank you so much!

smallopen_financial1112.mod (13 KB)