Output-Consumption Bridge#
input_output.py modules
ogphl.input_output#
- ogphl.input_output.get_alpha_c(sam= 2018 Social Accounting Matrix for Philippines amaiz ... row total Code ... amaiz Activities - Maize 0.0 ... 0.0 202 arice Activities - Rice 0.0 ... 0.0 694 aocer Activities - Other cereals 0.0 ... 0.0 1 aoils Activities - Oilseeds 0.0 ... 0.0 91 aroot Activities - Roots 0.0 ... 0.0 64 ... ... ... ... ... ... stax Taxes - Sales, excise and/or value-added (prod... 0.0 ... 0.0 534 s-i Savings-investment 0.0 ... 679.0 4954 dstk Change in stocks 0.0 ... 0.0 -24 row Rest of world 0.0 ... 0.0 8225 total Total 202.0 ... 8225.0 148804 [106 rows x 107 columns], cons_dict={'Durables': ['cmach', 'coman', 'ccons'], 'Energy and water': ['cmine', 'celec', 'cwatr'], 'Food': ['cmaiz', 'crice', 'cocer', 'coils', 'croot', 'cvege', 'csugr', 'ctoba', 'ccott', 'cfrui', 'ccoff', 'cocrp', 'ccatt', 'cpoul', 'coliv', 'cfore', 'cfish', 'cfood', 'cbeve'], 'Non-durables': ['ctext', 'cwood', 'cchem', 'cnmet', 'cmetl'], 'Services': ['ctrad', 'ctran', 'chotl', 'ccomm', 'cfsrv', 'creal', 'cbsrv', 'cpadm', 'ceduc', 'cheal', 'cosrv']})[source]#
Calibrate the alpha_c vector, showing the shares of household expenditures for each consumption category
- Parameters:
sam (pd.DataFrame) – SAM file
cons_dict (dict) – Dictionary of consumption categories
- Returns:
Dictionary of shares of household expenditures
- Return type:
alpha_c (dict)
- ogphl.input_output.get_io_matrix(sam= 2018 Social Accounting Matrix for Philippines amaiz ... row total Code ... amaiz Activities - Maize 0.0 ... 0.0 202 arice Activities - Rice 0.0 ... 0.0 694 aocer Activities - Other cereals 0.0 ... 0.0 1 aoils Activities - Oilseeds 0.0 ... 0.0 91 aroot Activities - Roots 0.0 ... 0.0 64 ... ... ... ... ... ... stax Taxes - Sales, excise and/or value-added (prod... 0.0 ... 0.0 534 s-i Savings-investment 0.0 ... 679.0 4954 dstk Change in stocks 0.0 ... 0.0 -24 row Rest of world 0.0 ... 0.0 8225 total Total 202.0 ... 8225.0 148804 [106 rows x 107 columns], cons_dict={'Durables': ['cmach', 'coman', 'ccons'], 'Energy and water': ['cmine', 'celec', 'cwatr'], 'Food': ['cmaiz', 'crice', 'cocer', 'coils', 'croot', 'cvege', 'csugr', 'ctoba', 'ccott', 'cfrui', 'ccoff', 'cocrp', 'ccatt', 'cpoul', 'coliv', 'cfore', 'cfish', 'cfood', 'cbeve'], 'Non-durables': ['ctext', 'cwood', 'cchem', 'cnmet', 'cmetl'], 'Services': ['ctrad', 'ctran', 'chotl', 'ccomm', 'cfsrv', 'creal', 'cbsrv', 'cpadm', 'ceduc', 'cheal', 'cosrv']}, prod_dict={'Agriculture and Fishing': ['amaiz', 'arice', 'aocer', 'aoils', 'aroot', 'avege', 'asugr', 'atoba', 'acoff', 'afrui', 'acoff', 'aocrp', 'acatt', 'apoul', 'aoliv', 'afore', 'afish'], 'Construction': ['acons'], 'Manufacturing': ['afood', 'abeve', 'atext', 'awood', 'achem', 'anmet', 'ametl', 'amach', 'aoman'], 'Mining': ['amine'], 'Services': ['ahotl', 'acomm', 'afsrv', 'areal', 'absrv', 'apadm', 'aeduc', 'aheal', 'aosrv'], 'Trade and Transport': ['atrad', 'atran'], 'Utilities': ['aelec', 'awatr']})[source]#
Calibrate the io_matrix array. This array relates the share of each production category in each consumption category
- Parameters:
sam (pd.DataFrame) – SAM file
cons_dict (dict) – Dictionary of consumption categories
prod_dict (dict) – Dictionary of production categories
- Returns:
Dataframe of io_matrix
- Return type:
io_df (pd.DataFrame)