# Regional disaggregation of a national input-output table

I am trying to disaggregate a "national" input-output table into three regions using Simple Location Quotients (SLQs) and RAS balancing. In particular, I'm trying to use the "Two region logic with more than two regions" technique (Miller & Blair, Section 8.6.3).

I am not able to get the target $\textbf{u}$ and $\textbf{v}$ margins to be consistent with each other, which is preventing me from applying RAS. I suspect that something rather obvious is eluding me, and I'd be grateful for advice.

To make this concrete, please see some dummy values below.

"National" IO table $A^n$:

         c1       c2
id
c1 0.161368 0.000001
c2 0.004815 0.047835


Total output by sector $x$:

id
c1    422428
c2    508800


Whence inter-industry flows $Z$:

         c1       c2
id
c1 68166.22     0.28
c2  2034.17 24338.67


Table of total outputs, by region {$r_1$, $r_2$, $r_3$}, by sector {$c_1$, $c_2$}:

          c1        c2
id
r1  30624.97  62497.83
r2 329614.70 415367.70
r3  62188.33  30934.47


As per the textbook, I'm looping through each region in turn, calculating the outputs:

          c1        c2
id
r1  30624.97  62497.83
R  391803.03 446302.17


and LQs for regions $r$ and $R$ (not $r$), and applying the LQs to $A^{n}$ to obtain $A^{rr}$ and $A^{RR}$:

       c1     c2
id
r1 0.7250 1.0000
R  1.0000 0.9746


This gives $A^{r_1r_1}$ and $A^{RR}$ respectively:

         c1       c2
id
c1 0.116988 0.000000
c2 0.004815 0.047835

c1       c2
id
c1 0.161368 0.000001
c2 0.004693 0.046622


I subtract $A^{r_1r_1}$ and $A^{RR}$ from $A^{n}$ to obtain $A^{Rr_1}$ and $A^{r_1R}$ respectively:

         c1       c2
id
c1 0.044380 0.000000
c2 0.000000 0.000000


and

         c1       c2
id
c1 0.000000 0.000000
c2 0.000122 0.001214


I convert these input coefficients to flows using the regional outputs, and use these as the first block of the marginal matrices. For this example, I obtain $\textbf{u}$ and $\textbf{v}$ as follows:

       c1     c2
0    0.00   0.00
1   47.87 541.64
2    0.00   0.00
3   36.58 365.76
4 3049.71   0.01
5    0.00   0.00

0    1       2    3      4      5
c1 1359.14 0.01 1310.71 0.01   0.00   0.00
c2    0.00 0.00    0.00 0.00 117.39 580.08


However, when I check for consistency, I obtain the following "collapsed" matrices:

        c1     c2
c1 3049.71   0.01
c2   84.44 907.40

c1     c2
c1 2669.85   0.01
c2  117.39 580.08


which are clearly different.