fineprint-global / fabio

Food and Agriculture Biomass Input-Output Tables
Other
16 stars 13 forks source link

Check building BTD and CBS again #62

Closed nk027 closed 4 years ago

nk027 commented 4 years ago

As far as I can tell not all BTD steps are currently implemented.

nk027 commented 4 years ago

In build_cbs we fill missing imports/exports with BTD data. Maybe this should be done later on.

nk027 commented 4 years ago

So in 1e_Start_values_BTD.R we create BTD_start, which contains the full structure and 0 for values. BTD_original is then created from this, with values filled from BTD. The following line attempts to identify filled values, but fails due to the 0s: BTD_original$Original[!is.na(BTD_original$Value)] <- 1 - See here.

nk027 commented 4 years ago

Looks like there is a package for iterative proportional fitting (i.e. RAS) - https://cran.r-project.org/web/packages/mipfp/index.html