Hi

I am trying to estimate a model with deterministic growth, coming from technology (Y=K^alp*(A*H)^(1-alp), with A being the technlogical component.

I am basing my programming on the fs2000ns file and its documentation in the dynare user guide.

I stationnarized my model exactly as recommended, by dividing everything that grows by A and relegating the non-stationarity to the observable variables. In this sense, everything works fine.

My problem is this:

In the fs2000ns program, the steady-state for the stationary part was found analytically and coded in the fs2000ns_steadystate.mod file. The steady-state of the non-stationary variables is specified as =1, which according to the documentation is a programming convention.

In my case, with the model being significantly bigger, the analytical steady-state is not really possible to derive. Also, we plan to make the model grow pretty soon so having to derive the steady-state by hand every time is not really an option.

I made an experiment where I ask Dynare, in a simulation environment, to find numericaly the steady-state of the stationnary part of the model, and Dynare was succesful without any problem.

So, my question is:

Is there any way to code the steady-state of my model using, in part, numerical methods for the stationary part while at the same time specifying that the observable variables are non-stationary?

This would really be helpful to us.

I know that my question is pretty long, so if you need me to be more precise, don’t hesitate to ask.

Sébastien Mc Mahon

Hi again

since posting my last message, I have made a lot of progress.

I have programmed the steadystate file so that one part of the steady-state is solved numerically and the other part numerically with fsolve.

I have 2 problems arising:

1. I have to initialize fsolve with a vector (x0). Is there any way to initialize it with the last estimate of the steady state, so that fsolve does not have to restart from the same point all over again?

2. When Dynare is looking for the mode, the function behaves somewhat strangely, going up and down with each iteration:

lambda = 1.8817e-006; f = 309.7943037
lambda = 6.2723e-007; f = 327.2029490
lambda = 2.0908e-007; f = 345.8403498
lambda = 6.9692e-008; f = 317.3420390
lambda = 2.3231e-008; f = 295.6965177
lambda = 7.7435e-009; f = 316.1568256
lambda = 2.5812e-009; f = 294.7983583
lambda =
-6.2723e-007
lambda = -6.2723e-007; f = 369.5767954
lambda = -2.0908e-007; f = 308.7824965
lambda = -6.9692e-008; f = 330.2048123
lambda = -2.3231e-008; f = 333.0379354
lambda = -7.7435e-009; f = 332.2646883
lambda = -2.5812e-009; f = 308.6112831
Norm of dx 9774.3

The graphs from mode_check show that it surely didn’t converge to the mode.

I include my files if anybody could help me out.

Thanks!

Sébastien
Estimation_ns_EtatStationnaire.m (1.25 KB)
Estimation_ns.mod (4.22 KB)

Hi again

This is turning out to be more a diary of my work than anything else but I solved my problems, so here is how I did it:

I set up a if-else-end loop to verify if the vector “ys” has been initialiazed, thus if it contains the steady state values. If not, I initialize my variables by the value 1. I then call fsolve to solve the problem numerically.

% Valeurs d’etat stationnaire

if numel(ys) == 0

``````y     = 1     ;
w     = 1     ;
H     = 1     ;
k     = 1     ;
kp    = 1    ;
c     = 1     ;
ip    = 1    ;
kg    = 1   ;
ig    = 1    ;
pi    = 1    ;
dette = 1 ;
gbs   = 1;
``````

else

``````y        = ys(1);
w        = ys(2);
dA       = ys(3);
H        = ys(4);
CC       = ys(5);
k        = ys(6);
kp       = ys(7);
c        = ys(8);
ip       = ys(9);
kg       = ys(10);
ig       = ys(11);
omega_t  = ys(12);
omega_t1 = ys(13);
R        = ys(14);
tax      = ys(15);
pi       = ys(16);
dette    = ys(17);
gbs      = ys(18);
c_shk    = ys(19);
h_shk    = ys(20);
i_shk    = ys(21);
a_shk    = ys(22);
Y_obs    = ys(23);
C_obs    = ys(24);
W_obs    = ys(25);
IP_obs   = ys(26);
``````

end

%% Calcul de l’etat stationnaire numerique

x0 = y ;
w ;
H ;
k ;
kp ;
c ;
ip ;
kg ;
ig ;
pi ;
dette ; ];

``````options.MaxFunEvals=100000;
options.MaxIter    =100000;
options.Display    = 'off';

[ss, fval] = fsolve('Estimation_ns_EtatStationnaire',x0,options,tk,tw,tc,tpi,nivby,mu_A,A0,alpha,b,delta_g,delta_p,phi,rho_h,rho_c,rho_a,rho_g,mu,mu_ikg,rho_ikg,nu,beta,r,theta,zeta,GBS_Y_SS);
``````

The second problem, concerning the weird behavior of the mode optimization, was just a programming error.

I hope this can be of help to someone.

Sébastien