IndEcol / pymrio

Multi-Regional Input-Output Analysis in Python.
http://pymrio.readthedocs.io/en/latest/
Other
155 stars 71 forks source link

Unequal sum of stressors and footprints #71

Closed jbnsn closed 3 years ago

jbnsn commented 3 years ago

Hello and sorry ... one more question.

I followed the example on: https://pymrio.readthedocs.io/en/latest/notebooks/buildflowmatrix.html

Shouldn't the sum of the aggregated source footprint (production-based inventory?) for a region equal the sum of the total footprint (consumption-based inventory?) of a region?

E.g. following the example by Kitzes 2013 the sum of the total intensity matrix axis=1 and axis=0 would be the same (2.8):

+----------+----------+----------+-----+
|          | Sector 1 | Sector 2 | Σ   |
+----------+----------+----------+-----+
| Sector 1 | 1.33     | 0.67     | 2   |
+----------+----------+----------+-----+
| Sector 2 | 0.27     | 0.53     | 0.8 |
+----------+----------+----------+-----+
| Σ        | 1.6      | 1.2      |     |
+----------+----------+----------+-----+

However, if I run the following code, the sums are not the same (see picture below; I am using Exiobase 3.8.1).

import pymrio

exio3_path = '/IOT_2021_pxp'

exio3 = pymrio.parse_exiobase3(path=exio3_path)

et1_diag = exio3.satellite.diag_stressor(
    ('Water Consumption Green - Agriculture - wheat'),
    name = 'Water Consumption Green - Agriculture - wheat'
    )
exio3.et1_diag = et1_diag

exio3.calc_all()

exio3.et1_diag.D_cba.sum(axis=0)['DE']
exio3.et1_diag.D_cba.sum(axis=1)['DE']

print(exio3.et1_diag.D_cba.sum(axis=0)['DE'].sum())
print(exio3.et1_diag.D_cba.sum(axis=1)['DE'].sum())

image

Am I doing something wrong or did I misunderstand the terminology?

konstantinstadler commented 3 years ago

You only compare that for DE, on the global level it should hold.

jbnsn commented 3 years ago

Thank you for your comment and your continuous support! Is there a way to show the production- and consumption-based inventory of a region in pyMRIO? E.g. if the table I posted is multiplied with a vector of final demand of a region and I sum the table along both axes, this should give me the production- and consumption-based inventories of which the sums are exactly the same, or not?

konstantinstadler commented 3 years ago

D_cba_reg and D_pba_reg are just available after calc_all if you do not need the diagonalization E.g. exio.satellite.D_pba_reg

konstantinstadler commented 3 years ago

is this solved? if not, feel free to reopen 😉