Page 1 of 1

Problem: In an assignment A(I) = B.........

PostPosted: Fri Nov 17, 2006 10:37 am
by homer05
Hi,


When I run my model on dynare I keep getting the following message:

In an assignment A(I) = B, the number of elements in B and
I must be the same.

Does this mean that I have lagged one of the variables incorrectly (the usual use stock at the end of the period and not beginning of the period), or could there be another explanation?

If it is a timing of lags issue, I suspect it's probably something to do with me including a lagrangian multipler in the model.

My dynare model includes a lagrangian multiplier on an employment evolution equation a la mortensen pissarides:

n(+1) = (1-p)n + q*v

I realize that n here should be modelled as one would model capital (i.e. stock at the end of the period and hence n above should be n(-1) etc), but what about the lagrangian multiplier on this equation? How would one write the timing for this lagrangian multiplier? Should it also be treated in a similar manner? Unfortunately I can't get rid of this lagrangean multiplier so I have to include it in the model. Any help on this matter would be greatly appreicated.

PostPosted: Fri Nov 17, 2006 10:29 pm
by psummers
homer05,

the error you're getting is from matlab, not dynare. you're trying to assign an array of one dimension to be equal to an array of a different dimension (eg, trying to set a scalar equal to a matrix).

without more details of your model it's hard to say more than this, but I hope it helps.

PS

PostPosted: Sat Nov 18, 2006 10:33 am
by MichelJuillard
Most often, it happens when one has forgotten to give a value to a parameter

To debug this kind of problem, you can use Matlab debugger with
dbstop if error

it will stop at the line of the *.m file with the error, you can then examine all the variables involved on that line

To get out of debug mode, type

dbquit

to cancel the debug trap:

dbclear all

Kind regards

Michel

PostPosted: Sun Nov 19, 2006 12:53 pm
by homer05
Thanks a lot guys. The debug mode worked magic. I should check more closely for small problems in the model before starting hypothesizing about grandiose ones!


Thanks once again.


Sincerely,

Omar