This project is read-only.

Blazer

Topics: Models
Jun 10, 2014 at 1:51 AM
Edited Jun 10, 2014 at 4:13 AM
I think steady state block-recursions in blazer need improvement.

Here is a simple test.model:
!transition_variables
k,y,c,g
!transition_equations
k=3*y;
y=sqrt(k);
c=y-g;
g=c/2;
If we run this using:
m=model('test.model');
sstatefile(m,'testss.model')
m.k=9;
m=sstate(m,'growth=',false,'blocks=',true);
then we can see that steady state file consists of one block, while Blazer should have separated the model in two blocks
k=3*y;
y=sqrt(k);
and
c=y-g;
g=c/2;
However if we change the order of equations in the model file like this:
!transition_variables
g,c,y,k
!transition_equations
g=c/2;
c=y-g;
y=sqrt(k);
k=3*y;
then the blazer works fine:
!equations
   y=sqrt(k);
   k=3*y;
   !solvefor
   y, k, 

!equations
   g=c/2;
   c=y-g;
   !solvefor
   c, g, 
In the first example, occurrence matrix is
1100
1100
0111
0011
The presence of 1 at position (3,2) does not allow Blazer to separate two blocks since it is looking for one at the lower rectangle to the left of each diagonal cell.

In the second example, occurrence matrix is
1100
1110
0011
0011
Now two blocks can be separated.
Jun 10, 2014 at 12:50 PM
Will look into it.
Jun 10, 2014 at 1:44 PM
Btw -- have you already removed the dynamic links from your model file?
Jun 10, 2014 at 2:17 PM
Edited Jun 10, 2014 at 8:54 PM
yes, I removed dynamic links to speed up the solver.

I think the problem is with reordering variables and equations in occurrence matrix since it uses score-algorithm. IRIS needs a better non-symmetric permutation algorithm to reduce the occurrence matrix to block-triangular form. There is dmperm function in MATLAB.

For my example above, we can get permutations of rows (equations) and columns (variables) as follows:
A=[1 1 0 0; 1 1 0 0; 0 1 1 1; 0 0 1 1]
     1     1     0     0
     1     1     0     0
     0     1     1     1
     0     0     1     1
[p,q] = dmperm(A);
A(p,q)
     1     1     0     1
     1     1     0     0
     0     0     1     1
     0     0     1     1
So the function myblazer.m should be fixed in line 34:
instead of calling
[nameOrd,eqtnOrd] = xxReorder(otherOccur);
it should do this:
[eqtnOrd,nameOrd] = dmperm(otherOccur);
Marked as answer by ikarib on 6/11/2014 at 8:06 AM
Jun 10, 2014 at 9:35 PM
I'm not actually aware of unsymmetric Trajan (but that's likely my own ignorance). Anyway, I've now experimented with Dulmage-Mendelsohn with prior AMD preordering of columns and rows, and it looks promising. I also want to look into Duff Reid, when I have some more spare time.
Marked as answer by jaromirbenes on 6/10/2014 at 1:35 PM
Jun 11, 2014 at 4:02 PM
what AMD does that DM doesn't?