IndEcol / pymrio

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

Demand Shock with EXIOBASE3 #43

Closed nigolred closed 3 years ago

nigolred commented 4 years ago

Hi Konstantin, thank you for your valuable work in developing this library. I am trying to perform a shock analysis using pymrio and adopting EXIOBASE3 as database. I was surprised when I realized that increasing the demand considerably in a certain sector implied decrease in use of certain exogenous resources (e.g. water withdrawal). So, I tried to figure out why. I ended up comparing the baseline database with an identical version (same final demand), in order to check what was going on.

I import the same database in two different variables

baseline = pymrio.parse_exiobase3(path=exio3path)
shock = pymrio.parse_exiobase3(path=exio3path)

Then, I calculate all for both MRIO.

baseline.calc_all()
shock.calc_all()

But now, since I would like to make some changes in the shock version, I reset all to coefficients. shock.reset_all_to_coefficients() Of course, to run the model again, I need a final demand. So, in order to check for consistency, I assign the same final demand of the baseline. shock.Y = baseline.Y Now I calculate everything expecting to have the same system observable in the baseline. shock.calc_all() But when I look at the differences in use of factors, I observe relevant differences in some categories. DeltaPerF = (shock.satellite.F.sum(axis=1) - baseline.satellite.F.sum(axis=1))/(baseline.satellite.F.sum(axis=1))*100 I print out the most relevant percentual differences between shock and baseline by factors. This is the situation for the ixi database.

image

This the situation for the pxp database. image

It looks like the F imported from the original database is somehow different from the F that one gets by F = Sx. I checked and both S and x have no differences. Therefore, I would expect that there’s a problem in how F is recalculated after bringing everything to coefficients. Maybe I am doing something wrong, could you help me fix it? Thank you in advance,

Nicolò Golinucci

konstantinstadler commented 4 years ago

Hi, I am currently on paternity leave - not quite sure when I can look into that. Just a first guess: did you look into the absolute amounts as well - from the pxp example it looks like the problem is mainly in waste sectors; perhaps there is a problem with 0 output and some entries in F or vice versa. EXIOBASE 3 should be corrected for that, but it might be that there are some minor problems. Also, if the values are really low, there might be some rounding/floating point deviations.

nigolred commented 4 years ago

Hi Konstantin, thanks for answering. Actually I still have not completely resolved this issue, but I've found a work around for that.

I've just noticed a discrepancy between what one can get by summing all the value added rows of Exiobase 3 with pymrio GDP_world = mrio.satellite.F[0:9].sum().sum()=52303949 M€ and what is reported in the data visualization at https://environmentalfootprints.org/explorer (which is way more in line with World Bank values, i.e. 7.27 T€). I'm sure I'm missing something in how world GDP should be computed with pymrio. Could you help me?

image

Thank you in advance,

NG

konstantinstadler commented 3 years ago

This is a bug in the environmentalfootprints webpage. The data there is in USD not in Euro (while the USD value is missing). We fix that there. Your calculation is correct, and with the exchange rate of 1.39 for 2011 you derive the same value

konstantinstadler commented 3 years ago

@nigolred let me know if there are any open issues with the values of F in your calculation or let me know about your workaround. Feel free to reopen this issue for that