Page 1 of 1

State variables indices gone missing

PostPosted: Wed May 03, 2017 9:21 pm
by aaronb2017
I switched from MATlab to Octave (using version 4.3.1) and am no longer able to find the structure M_.state_var. I need these indices. Does anyone know where to find them in Octave?

Re: State variables indices gone missing

PostPosted: Thu May 04, 2017 11:37 am
by jpfeifer
Could it be that you switched to a newer Dynare version where it's stored in
Code: Select all
oo_.dr.state_var
?

Re: State variables indices gone missing

PostPosted: Thu May 04, 2017 1:27 pm
by aaronb2017
That does not exist either.

octave:6> oo_.dr.state_var
error: structure has no member 'state_var'

Re: State variables indices gone missing

PostPosted: Thu May 04, 2017 2:09 pm
by jpfeifer
Is there a reason you are not using the most recent unstable version of Dynare with Octave 4.2.1?

Re: State variables indices gone missing

PostPosted: Fri May 05, 2017 1:37 pm
by aaronb2017
I'm using Dynare 4.3.1 and Octave 3.6.4 because I have legacy code from 2014 that parses out individual model variables and decision rules for a model with > 100 state variables. The code was previously working fine with Dynare 4.3.1 and MATlab 2015a (I lost my MATlab license). I installed Dynare 4.3.1 since I didn't want to go through the ordeal of finding and labeling all the variables again. I believe the indexing of state variables changed in subsequent versions of Dynare. Would switching to Octave 3.8.1 help?

Re: State variables indices gone missing

PostPosted: Fri May 05, 2017 4:50 pm
by jpfeifer
You must be confusing something. I looked into Dynare 4.3.1 and
Code: Select all
M_.state_var

seems to be only created with the
Code: Select all
block

option. Thus, Octave is not the problem.
In 4.3.1, the state ordering should be in
Code: Select all
oo_.dr.kstate

Re: State variables indices gone missing

PostPosted: Fri May 05, 2017 8:21 pm
by aaronb2017
I see. Thanks. My prior code was creating the transition matrix, hx, so that the state variables would be in declaration order.

hx=oo_.dr.ghx(oo_.dr.inv_order_var(M_.state_var),oo_.dr.inv_order_var(M_.state_var-20));

I've tried switching to:

hx=oo_.dr.ghx(oo_.dr.inv_order_var(oo_.dr.kstate),oo_.dr.inv_order_var(oo_.dr.kstate-20));

Basically, I'm trying to get the rows and columns of hx so that they are in declaration order. Would that already be the case with the new indexing?

Re: State variables indices gone missing

PostPosted: Sat May 06, 2017 8:31 am
by jpfeifer
I am not sure I understand what you mean with "new indexing". To me it seems you were using a newer version already. Please note that in newer versions the ordering should be documented in the manual. You may also be interested in the discussion at http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=19807