Dear Dynare users,

It seems that Dynare V4 cannot read array element by element array operators like .* or ./ in the model equation block of the .mod file. Dynare V3 had no problem with it.

Has anyone encountered the same problem and knows a fix ? or patch that can be used ?

Thank you for any kind of help,

All the best

Hi galileo,

I was not aware that this was possible with dynare version 3. You cannot use matlab arrays in the model block. I think that the trick is to do this kind of things in the steady state file. What are you trying to do exacly ?

Best, Stéphane.

Dear Stephane,

Thank you for your quick reply.

I am trying to run a code of a NK model with financial frictions. The code has the following instructions

a) in the steady state

hos = (exp(-nloms.*nloms/2)./(so*sqrt(2*pi)))/(1-normcdf(nloms,0,1));

b) and in the core model equations part

ho = (exp(-(omstar-mo).*(omstar-mo)/(2*so*so))./(so*sqrt(2*pi)))/(1-normcdf((omstar-mo)/so,0,1));

I could run it with dynare v3, and dynare v4 can read the steady-state part, but not the dynamic one. Would there be a way to trick it and compute the problematic part of the equation outside the core model ? By computing -(omstar-mo).*(omstar-mo)/(2*so*so))./(so*sqrt(2*pi)) somewhere else ?

Again thank you in advance for your help,

Hi,

Is

`-(omstar-mo).*(omstar-mo)/(2*so*so))./(so*sqrt(2*pi)) `

a scalar ?

Stéphane.

Dear Stephane,

Thank you for your prompt reply.

Unfortunately

-((omstar-mo).*(omstar-mo)/(2*so*so))./(so*sqrt(2*pi))

is not a scalar; omstar and mo are two variables of the model and so is a parameter.

Is there hope?

All the best and thank you for your help.

jm

Hi galileo, I don’t understand… If omstar and mo are *two declared endogenous variables of the model* and if so is a parameter, this expression must be a scalar and you don’t need .* or ./.

I cannot say more if you don’t post your codes on this thread…

Stéphane.

Dear Stephane,

I am really sorry about the confusion.

Actually, this is also what I thougt in the first place. But when I tried it with Dynare V4, it gave me the following answer

“Inner matrix dimension must agree”

So I infered that Dynare variables were treated as vectors (of stochastic simulated points) and that ./ was necessary.

But the problem was actually coming from the instruction steady that does not seem to be able to deal with my model in the version 4, but was no problem in V3. I just disactivated it (I feed the model with the steady state in initval anyway) and it seems to work perfectly now.

Thank you very much for your help,

All the best with Dynare (it is an amazing tool)