Page 1 of 1
synrax error ?
Posted:
Sat Jun 02, 2007 2:15 am
by jasierra
Hi,
I am trying to run (from Matlab) a code called "seppala.mod" in
dynare++-1.3.2, but I get the following error
Caught Dynare exception: Parse error at seppala.mod, line 122, column 1: syntax error, unexpected NAME, expecting $end
"line 122, column 1" has the following text:
stoch_simul(order=1,dr_algo=1,drop=100,periods=1000);
If anybody has an idea of what is my syntax error, I would greatly appreciate any help !!
I am attaching the code just in case some expert might find another related error in the syntax.
Thanks,
Jesus
Posted:
Tue Jun 19, 2007 7:36 am
by OndraKamenik
Jesus,
you see to be using a model file for Dynare Matlab with dynare++. See dynare++ tutorial on syntax of the model file.
Ondra K.
how to interpret dyn_g_2 and dyn_g_3 matrices
Posted:
Tue Jun 19, 2007 5:22 pm
by jasierra
Dear Ondra,
Thanks for the advice. I had figured that you need to remove the stoch_simul command if you want to run the code in dynare++, instead of the MATLAB version.
Also, I wanted to ask if you can explain how to interpret each element of the matrices "dyn_g_2" and "dyn_g_3" that are the output of running a code in dynare++, and if you know if they include the constants ( i.e. the 1/2 and 1/3. etc ) of the Taylor expansion or not.
Thanks a lot for your reply,
Jesus Sierra.
Posted:
Wed Jun 20, 2007 11:29 am
by OndraKamenik
Dear Jesus,
of course I know how to interpret the higher order derivatives. The rows are clear, right? The ordering of rows is given by dyn_vars vector.
Columns determine with what deviations the number in the column is to be multiplied. NOTE THAT the deviations are not from steady state, the deviations are from a fix-point, which is saved as dyn_ss. So this means that you cannot find dyn_g_0, since it is zero, since dyn_ss is chosen so that dyn_g_0 is zero (from the definition of the fix-point).
The matrices are already mulitplied with the multipliers 1/2, 1/6 etc.
The columns are ordered as folded indices of variables stored in the vector dyn_state. You can find more details first in kord.pdf and then in tl.pdf downloadable from the documentation page. Everything is described there.
However, I provide a small example. Let a model have the states [K,C,EPS]. If you assign indices to this variable in increasing order, say [K=0,C=1,EPS=2], then the folded indices will be all growing sequences consisting from 0,1,2 in alphabetical ordering.
This is, for the third order:
000
001
002
011
012
022
111
112
122
222
for the fourth order:
0000
0001
0002
0011
0012
0022
0111
0112
0122
0222
1111
1112
1122
1222
2222
Ondra K.
Sylvester error
Posted:
Wed Jul 25, 2007 4:48 pm
by jasierra
Dear Ondra:
Thanks a lot for explaining the elements of the "dyn_g_2" and "dyn_g_3" matrices.
Now, I have been trying to run a code in dynare++ 1.3.2., but dynare gives me the following error:
^^^Caught Sylv exception: At Vector.cpp:95:Attempt to assign vectors with different lengths
Do you know what this means? Is this a dynare error, or a model-specific error ?
Since it mentions "Sylvester" , I figured that if maybe I run a First Order Approximation, dynare would give me at least the first order matrices, and that would mean that there is a bug in dynare : however, it gets stuck: never ends. So it could be an error in the model, which would not surprise me at all.
I am attaching a copy of the .mod file, if you want to see what I wrote there.
Please let me know what you think might be wrong.
Thanks a lot,
Jesus
Posted:
Thu Jul 26, 2007 9:20 am
by OndraKamenik
Dear Jesus,
in the file, you have the following:
- Code: Select all
vcov = [ 0.08^2 0 0 ;
0 0.0035^2 0 ;
0 0 0.003^2 ];
vcov cannot contain expressions, just numbers, so Dynare++ ignores the expressions and the data do not make 3x3 matrix, so some vectors overlap. This does not have to do anything with sylvester, this is just in sylvester module handling (besides sylvester) all linear algebra.
A very funny thing is that, guessing it was in June, I was replying somebody else with the same problem and completely same file. So it seems that one syntactically wrong dynare++ file is flying around the globe and now ended up in the forum.
Note that version 1.3.5 has been just released. This version will refuse input whining that unrecognized characted was asserted. My error is that this requirement on vcov is not explicitly mentioned in the tutorial.
Ondra K.