Dynare 4 cannot read .* or ./

As Dynare 4 is now the main version, this forum is now closed. Please, post
on the Dynare Help forum
Forum rules
As Dynare 4 is the current Dynare version, there forum is now close. Post new question in the Dynare Help Forum.

Dynare 4 cannot read .* or ./

Postby galileo » Tue Mar 17, 2009 10:43 pm

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

:?:
galileo
 
Posts: 4
Joined: Tue Mar 17, 2009 9:01 pm

Re: Dynare 4 cannot read .* or ./

Postby StephaneAdjemian » Tue Mar 17, 2009 10:55 pm

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.
Stéphane Adjemian
Université du Maine, GAINS and DynareTeam
https://stepan.adjemian.eu
StephaneAdjemian
 
Posts: 429
Joined: Wed Jan 05, 2005 4:24 pm
Location: Paris, France.

Re: Dynare 4 cannot read .* or ./

Postby galileo » Tue Mar 17, 2009 11:40 pm

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,
galileo
 
Posts: 4
Joined: Tue Mar 17, 2009 9:01 pm

Re: Dynare 4 cannot read .* or ./

Postby StephaneAdjemian » Wed Mar 18, 2009 9:00 am

Hi,

Is

Code: Select all
-(omstar-mo).*(omstar-mo)/(2*so*so))./(so*sqrt(2*pi))


a scalar ?

Stéphane.
Stéphane Adjemian
Université du Maine, GAINS and DynareTeam
https://stepan.adjemian.eu
StephaneAdjemian
 
Posts: 429
Joined: Wed Jan 05, 2005 4:24 pm
Location: Paris, France.

Re: Dynare 4 cannot read .* or ./

Postby galileo » Wed Mar 18, 2009 4:18 pm

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 :?
galileo
 
Posts: 4
Joined: Tue Mar 17, 2009 9:01 pm

Re: Dynare 4 cannot read .* or ./

Postby StephaneAdjemian » Wed Mar 18, 2009 4:51 pm

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.
Stéphane Adjemian
Université du Maine, GAINS and DynareTeam
https://stepan.adjemian.eu
StephaneAdjemian
 
Posts: 429
Joined: Wed Jan 05, 2005 4:24 pm
Location: Paris, France.

Re: Dynare 4 cannot read .* or ./

Postby galileo » Wed Mar 18, 2009 6:16 pm

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)
galileo
 
Posts: 4
Joined: Tue Mar 17, 2009 9:01 pm


Return to Dynare version 4

Who is online

Users browsing this forum: No registered users and 1 guest