Steady State Calculations for Large Scale Models

I have a question related to a number of previous posts, i.e. [Steady State File).

I just started a new job and inherited code from another colleague. I am responsible for adding and subtracting variables from the code. And, it seems that the code (“workhorsemodel”) fails to run due to workhorsemodel_steadystate.m. I have adapted the code to a neoclassical growth model (“ncgm1”) with fixed labor (as in Eric Sims’ notes), for which I get a string of errors when running, including:

[code]Error using print_info (line 72)
The steadystate file did not compute the steady state

Error in resid (line 112)
print_info(info,options_.noprint, options_)

Error in steady (line 90)
resid;

Error in ncgm1 (line 122)
steady;

Error in dynare (line 180)
evalin(‘base’,fname) ;

Error in run_ncgm1 (line 17)
dynare ncgm1 noclearall nolog[/code]

I think the problem may be found in these five lines, but I am not sure why:

for ii = 1:NumberOfEndogenousVariables varname = deblank(M_.endo_names(ii,:)); eval('ys(' int2str(ii) ') = ' varname ';']); end ysold = ys;

Please tell me if you have any suggestions for why this code is not running and what I can do to remedy this problem. Also, any suggestions on easily modify, altering, adding to or subtracting from inherited code would be much (much!) appreciated.

Cheers!
run_ncgm1.m (244 Bytes)
ncgm1_steadystate.m (1.46 KB)
ncgm1.mod (3.28 KB)

A clean steady state file would be

[code]function [ys,check] = ncgm1_steadystate(ys,exe);

global M_ options_ oo_

NumberOfParameters = M_.param_nbr;

for ii = 1:NumberOfParameters
paramname = deblank(M_.param_names(ii,:));
eval( paramname ’ = M_.params(’ int2str(ii) ‘);’]);
end

k = (alphaa/(1/betta - (1 - delta)))^(1/(1 - alphaa));
y = k^(alphaa);
Inv = delta*k;
c = y - Inv;
a = 1;
w = (1-alphaa)k^(alphaa);
R = alphaa
k^(alphaa-1);
r = (1/betta) - 1;

y=log(y);
Inv=log(Inv);
k=log(k);
a= log(a);
c= log©;
w= log(w);
R= log®;

check = 0;

%%-------------------------------------------------------------------------
%
NumberOfParameters = M_.param_nbr;
for ii = 1:NumberOfParameters
paramname = deblank(M_.param_names(ii,:));
eval(‘M_.params(’ int2str(ii) ‘)=’ paramname ‘;’]);
end
check = 0;

NumberOfEndogenousVariables = M_.endo_nbr;
ys = zeros(NumberOfEndogenousVariables,1);

for ii = 1:NumberOfEndogenousVariables
varname = deblank(M_.endo_names(ii,:));
eval(‘ys(’ int2str(ii) ') = ’ varname ‘;’]);
end
ysold = ys;
[/code]
Your problem is that you did an exp()-substitution, i.e. your variables are the log-levels, but your steady state file computed the levels. Therefore, you need to log them first.

Thank you very much!