Page 1 of 2

Error using max Matrix. dimensions must agree.

PostPosted: Mon Oct 10, 2011 2:34 pm
by mahone21
I am really confused.i have a model, I still can compute an initial steady state and a final steady state, and the rank condition is still verified, but the following instructions:

Error using max
Matrix dimensions must agree.

Error in hessian (line 40)
h1=max(abs(x),sqrt(gstep)*ones(n,1))*eps^(1/6);

Error in dynare_estimation_1 (line 406)
hh = reshape(hessian('DsgeLikelihood',xparam1, ...

Error in dynare_estimation (line 62)
dynare_estimation_1(var_list,varargin{:});

Error in mahone211 (line 383)
dynare_estimation(var_list_);

Error in dynare (line 120)
evalin('base',fname) ;

Re: Error using max Matrix. dimensions must agree.

PostPosted: Thu Oct 27, 2011 3:07 pm
by SébastienVillemot
This is obviously a bug in Dynare, I have added it to our bug tracker: https://www.dynare.org/trac/ticket/222

We will solve it as soon as possible.

Thanks for reporting this.

Re: Error using max Matrix. dimensions must agree.

PostPosted: Sat Oct 29, 2011 2:14 pm
by mahone21
Thanks!
I am looking forward u replying!

Re: Error using max Matrix. dimensions must agree.

PostPosted: Wed Nov 02, 2011 5:11 pm
by SébastienVillemot
Hi,

Actually you forgot to declare an "estimated_params" block! Dynare does not know which parameters to estimate, what are the priors...

Therefore it's not a bug in Dynare. But we will change the error message so that it becomes more explicit.

Best,

Re: Error using max Matrix. dimensions must agree.

PostPosted: Thu Nov 03, 2011 3:28 pm
by mahone21
thank u very much!

i can run it successfully now!

Re: Error using max Matrix. dimensions must agree.

PostPosted: Mon Nov 04, 2013 9:47 pm
by alex
I get the same error. I have not an estimated_params section, but I am using the "smoother" option, which does not require to define parameters to estimate.

Any thought about how to solve this?

Best,
Alex

Re: Error using max Matrix. dimensions must agree.

PostPosted: Tue Nov 05, 2013 9:51 am
by jpfeifer
Try the recent snapshot. If it does not work, post the file

Re: Error using max Matrix. dimensions must agree.

PostPosted: Tue Nov 05, 2013 2:49 pm
by alex
solved thank you!

Alex

Re: Error using max Matrix. dimensions must agree.

PostPosted: Mon Dec 07, 2015 11:15 am
by veronika
Hi,

I am estimating a non-linear model with second order approximation using "pruning", and I also use the smoother option. But I get the same error :

Error using max
Matrix dimensions must agree.

Error in hessian (line 42)
h1=max(abs(x),sqrt(gstep(1))*ones(n,1))*eps^(1/6)*gstep(2);

Error in dynare_estimation_1 (line 620)
hh = reshape(hessian(objective_function,xparam1, ...

Error in dynare_estimation (line 89)
dynare_estimation_1(var_list,dname);

Error in Flue (line 414)
dynare_estimation(var_list_);

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

what could be the problem and how I can solve it? I would appreciate your advice.

Re: Error using max Matrix. dimensions must agree.

PostPosted: Mon Dec 07, 2015 12:19 pm
by jpfeifer
Please use
Code: Select all
which hessian

to check whether the Dynare hessian.m is on top of your path. If not, eliminate the other hessian.m from your path.

Re: Error using max Matrix. dimensions must agree.

PostPosted: Mon Dec 07, 2015 12:31 pm
by veronika
I tried it and:

>> which hessian
C:\dynare\4.4.3\matlab\hessian.m

Re: Error using max Matrix. dimensions must agree.

PostPosted: Mon Dec 07, 2015 12:38 pm
by jpfeifer
The steady state file is missing.

Re: Error using max Matrix. dimensions must agree.

PostPosted: Mon Dec 07, 2015 12:44 pm
by veronika
Sorry! Here they are:

Re: Error using max Matrix. dimensions must agree.

PostPosted: Mon Dec 07, 2015 12:57 pm
by jpfeifer
And the data file.

Re: Error using max Matrix. dimensions must agree.

PostPosted: Mon Dec 07, 2015 2:06 pm
by veronika
This is the preliminary data file, we are not still finished with aggregating the data.