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

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

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

Postby homer05 » Fri Nov 17, 2006 10:37 am

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.
homer05
 
Posts: 7
Joined: Mon Mar 21, 2005 10:10 am

Postby psummers » Fri Nov 17, 2006 10:29 pm

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
psummers
 
Posts: 15
Joined: Mon Sep 05, 2005 8:59 am
Location: Texas Tech University

Postby MichelJuillard » Sat Nov 18, 2006 10:33 am

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
Last edited by MichelJuillard on Sun Nov 19, 2006 2:27 pm, edited 2 times in total.
MichelJuillard
 
Posts: 680
Joined: Thu Nov 18, 2004 10:51 am

Postby homer05 » Sun Nov 19, 2006 12:53 pm

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
homer05
 
Posts: 7
Joined: Mon Mar 21, 2005 10:10 am


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 10 guests