Page 1 of 1

Error using log Too many input arguments

PostPosted: Tue Nov 11, 2014 10:09 pm
by missredridinghood
Can someone please provide me direction?

I am getting the following error message when I code an RBC model with labor and investment adjustment costs.

Error using log
Too many input arguments.
Error in Ch1Modelv7 (line 174)
M_.NNZDerivatives(1) = 72;
Error in dynare (line 185)
evalin('base',fname) ;

Re: Error using log Too many input arguments

PostPosted: Wed Nov 12, 2014 9:19 am
by jpfeifer
This is a very strange Matlab (not Dynare) bug. I will file a bug report with Matlab. The reason seems to be that in your initval-block you define
Code: Select all
n=log(0.7)

which is a negative number. Then in the next line you use
Code: Select all
  y = alpha*log(k)+(1-alpha)*log(n);

You take the log of n, which is negative and results in a complex number.

Re: Error using log Too many input arguments

PostPosted: Wed Nov 12, 2014 9:58 am
by missredridinghood
Thank you Johannes for the direction. It is very helpful.

Re: Error using log Too many input arguments

PostPosted: Wed Nov 12, 2014 10:08 am
by jpfeifer
I got feedback from Mathworks. The error message about a wrong line is a bug associated with the Matlab accelerator (and is still present in 2014b). Putting
Code: Select all
feature accel off

resolves the problem and will provide correct output, but it will come at a performance cost. Mathworks will fix this in a future version.