Steady_state-file must return a column vector

Dear all,

I have started working on a new model for which I have created a mod and steady state file. Inside that steady state file I call an external function (separate .m file) that helps me to solve a couple of nonlinear equations. So far so good. However, when I execute dynare, I receive the following error message:

Error using evaluate_steady_state (line 214)
STEADY: steady_state-file must return a column vector, not a row vector.

The steady state file starts and ends with for loops which fill in the parameters and output vector. Below you can see the usual ending of the file:

for iter = 1:length(M_.params) %update parameters set in the file
eval([ ‘M_.params(’ num2str(iter) ') = ’ M_.param_names(iter,: ) ‘;’ ])
end

NumberOfEndogenousVariables = M_.orig_endo_nbr; %auxiliary variables are set automatically
for ii = 1:NumberOfEndogenousVariables
varname = deblank(M_.endo_names(ii,:));
eval([‘ys(’ int2str(ii) ') = ’ varname ‘;’]);
end

I have to mention that when I follow the “old-school” way of entering the output vector (ys) and parameters manually everything works fine and I don’t receive an error message. It must be something very simple, but I can’t see it anymore since I have spent some time behind the monitor.

It would be great if someone would be able to help me with this.

All the best and thanks.

Rob

Which Dynare version are you using? Please provide me with the files.

Hi Johannes,

Thanks for your reply. I am using the dynare version 4.5.4. I have attached the zip file, which contains the model and steady state. Most probably I am doing something wrong and that’s why I’m getting this error message.

Many thanks for having a look!

model_files.zip (2.1 KB)

The order of inputs in your function header is wrong. It should be

function [ys,check]=robots_steadystate(ys,junk)

instead of

function [ys,check]=robots_steadystate(junk,ys)

Hi Johannes,

Many thanks for pointing out this obvious mistake. Without your help it would have taken me days to find it.

Best,

Rob