fineprint-global / fabio

Food and Agriculture Biomass Input-Output Tables
Other
18 stars 15 forks source link

Can't calculate supply shares #75

Open nk027 opened 4 years ago

nk027 commented 4 years ago

It's not always possible to calculate "the percentage of total supply of each commodity supplied by each country", since the aggregated totals are not really invertible. See also https://github.com/martinbruckner/fabio/blob/13108760d86926906e7956630cf38fa8c7147e36/R/fabio_2d_Trade_linking_USE.R#L64

Anecdotally the following commodities are problematic: "c079" "c014" "c109", as well as the following areas: 1 57 154 256 272 273 276 277.

nk027 commented 4 years ago

Same goes for the transformation matrices.

martinbruckner commented 4 years ago

Of course x / rowSums(x) will give NA where rowSums(x)==0. In my view, that's not a problem. We don't need supply shares if a good is not used in a country at all.