Dynare++ v. 1.3.1

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.

Dynare++ v. 1.3.1

Postby jseppala » Thu Jun 29, 2006 7:43 am

I am testing Dynare++ v. 1.3.1. There is clearly something I don't understand about the new user interface (I have used version 1.1 in the past). What I did was the following.

1. In the command prompt

Code: Select all
dynare++ --sim 1 --per 20000 --no-irfs juha50.mod


2. In Matlab

Code: Select all
shocks=randn(3,20000);
r = dynare_simul('juha50.mat',shocks);


The result was

Code: Select all
??? ystart has wrong number of rows.


The contents of ystart are

Code: Select all
Empty state-space model.


What am I doing wrong?

Thank you very much,

Juha
jseppala
 
Posts: 4
Joined: Thu Jun 29, 2006 7:34 am
Location: Champaign, IL

Postby OndraKamenik » Thu Jun 29, 2006 8:08 am

Dear Juha,

it works for me. The most likely reason why it doesn't work for you is that your namespace in Matlab contains a symbol ystart declared as global and it collides with a local symbol ystart in dynare_simul.m. The solution is to clear your namespace and do not declare any symbols as global any more. Or, ystart might be an M_file? I don't know. Check your Matlab environment with commands 'who' and with 'which ystart'.

Let me know if it still doesn't work.

One additional comment: The commands

Code: Select all
shocks=randn(3,20000);
r = dynare_simul('juha50.mat',shocks);


will result in exploding r, since randn generates shocks with stderr=1. Your shocks in the model are much smaller. If you want to use the same distribution (if you do not want to fool agents), then you should run:

Code: Select all
load('juha50.mat');
shocks=chol(dyn_vcov_exo)*randn(3,20000);
r = dynare_simul('juha50.mat',shocks);


regards,

Ondra K.
OndraKamenik
 
Posts: 73
Joined: Mon Dec 20, 2004 8:32 am

Postby jseppala » Thu Jun 29, 2006 8:19 am

Dear Ondra,

Thanks for the reply. However, I don't have a global variable called ystart:

Code: Select all
>> who

Your variables are:

dyn_g_1            dyn_i_e2           dyn_i_pnum         dyn_nforw          dyn_vars           
dyn_g_2            dyn_i_e3           dyn_i_r            dyn_npred          dyn_vcov           
dyn_g_3            dyn_i_f            dyn_i_rn           dyn_nstat          dyn_vcov_exo       
dyn_i_Pi           dyn_i_m            dyn_i_w            dyn_shocks         shocks             
dyn_i_a            dyn_i_muc          dyn_i_y            dyn_ss             
dyn_i_d            dyn_i_n            dyn_mean           dyn_state_vars     
dyn_i_e1           dyn_i_pdenom       dyn_nboth          dyn_steady_states 

>> which ystart
'ystart' not found.


ystart has value only inside the dynare_simul.m. And that value is really strange, "Empty state-space model." Do you use that string anywhere in Dynare++ code?

Here's my Matlab information:

MATLAB Version 7.2.0.232 (R2006a)
MATLAB License Number: 257586
Operating System: Microsoft Windows XP Version 5.1 (Build 2600: Service Pack 1)
Java VM Version: Java 1.5.0 with Sun Microsystems Inc. Java HotSpot(TM) Client VM mixed mode
-------------------------------------------------------------------------------------
MATLAB Version 7.2 (R2006a)
Control System Toolbox Version 7.0 (R2006a)
Optimization Toolbox Version 3.0.4 (R2006a)
Statistics Toolbox Version 5.2 (R2006a)
Symbolic Math Toolbox Version 3.1.4 (R2006a)

Thanks,

Juha
jseppala
 
Posts: 4
Joined: Thu Jun 29, 2006 7:34 am
Location: Champaign, IL

Postby OndraKamenik » Thu Jun 29, 2006 10:38 am

Juha,

I tried two versions of Matlab:
7.1.0.246 (R14) SP3 on Windows
7.0.4.352 (R14) SP2 on Linux
Everything works for me.

I know where might be the problem. The Control System Toolbox defines a method ss, which creates empty state space if no parameters are provided. This is what probably happens at line 127 of dynare_simul.m. However, at the line 115, ss variable is set to the decision rule's fix point. For some reason, in your case, the line 115 fails to create the vector ss and override the definition of ss from the toolbox. It works for me even when ss is defined.

So, first try to replace line 115 with
Code: Select all
ss=eval([prefix '_ss;']);

For me, the both versions work even if ss is defined as M_file.

Second, unlink the toolbox.

Let me know if it helps.

regards,

Ondra K.
OndraKamenik
 
Posts: 73
Joined: Mon Dec 20, 2004 8:32 am

Postby jseppala » Thu Jun 29, 2006 11:08 am

Hi Ondra,

Thank you! After changing the line 115, it works!

Best,

Juha
jseppala
 
Posts: 4
Joined: Thu Jun 29, 2006 7:34 am
Location: Champaign, IL

Postby OndraKamenik » Thu Jun 29, 2006 11:47 am

Juha,

this is both good news and bad news. Good news is that we know how to fix it. Bad news is that the behaviour of eval in Matlab is strange and apparently its semantics changed from version 7.1 to 7.2.

Nevertheless, I will rewrite all eval commands and commit the new version. Until 1.3.2 is released, the new dynare_simul.m can be downloaded from svn snapshots.

regards,

Ondra K.
OndraKamenik
 
Posts: 73
Joined: Mon Dec 20, 2004 8:32 am


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 5 guests