A GEM for Streamlined Dynamic CGE Analysis : Structure , Interface , Data , and Macro Application

This paper provides an overview, macro application, and detailed documentation of GEM-Core, a dynamic computable general equilibrium (CGE) model designed for medium- and long-run policy analysis. GEM stands for General Equilibrium Model. GEM-Core can address the issues that typically are relevant for CGE analysis for developing countries, including fiscal space (with its spending, tax, and foreign aid aspects), public investment, social safety nets, trade, jobs, demography, poverty, and inequality. The model is a template model in the sense that, given an appropriately formatted database, applications for different countries can quickly be developed. The data needed for macro applications are very limited, making it possible to apply the model on short notice to virtually any country, including fragile and low-income countries. GEM-Core comes with a user-friendly Excel-based interface through which the analyst may choose between alternative country databases and, for the selected database, do the analysis (define and analyze simulations, including adjustment of selected data and assumptions). The interface lowers entry barriers to CGE modeling and provides a platform around which training may be organized, making it possible to focus courses on economics instead of computer programming.


Introduction
The purpose of this paper is to introduce GEM-Core, a dynamic computable general equilibrium (CGE) model designed for medium-and long-run policy analysis. GEM stands for General Equilibrium Model. GEM-Core is a core model in the sense that it can address the issues that typically are relevant for CGE analysis for developing countries, including fiscal space (with its spending, tax, and foreign aid aspects), public investment, social safety nets, trade, jobs, demography, poverty, and inequality. The model may be applied to databases with different disaggregations, ranging from highly aggregated to highly disaggregated. It may be extended when this is needed for special topics. GEM-Core comes with a userfriendly Excel-based interface, ISIM (which stands for "I simulate"). 1 It permits the analyst to choose between alternative country databases and, for the selected database, develop an application, something that involves choosing from a menu of pre-programmed assumptions, adjusting selected data, and defining and analyzing simulations. The interface lowers entry barriers to CGE modeling and provides a platform around which training may be organized, making it possible to focus courses on economics instead of computer programming.
The fact that the model may be applied to relatively aggregate databases means that it can be applied on short notice to virtually any country, including fragile and low-income countries. In a companion paper, Cicowiez and Lofgren (2017a) show how the core component of such a database, a macro SAM, may be constructed at low cost from crosscountry data; that paper is accompanied by empirical macro SAMs for 133 countries.
In outline, this paper first provides a non-technical overview of GEM-Core and a macro database for an archetype developing country using a SAM from the companion paper (Section 2). After this, it presents and analyzes a set of simulations that demonstrate the use of the model with this macro database (Section 3), winding up with some concluding 1 The interface is linked to the model program, written in GAMS (the General Algebraic Modeling System; see www.gams.com). Both are available on request from the authors. GEM-Core draws heavily on MAMS (Maquette for Millennium Development Goal Simulations; Lofgren et al. 2013) for which the IFPRI Standard Model provided the starting point (Lofgren et al. (2002). Other country CGE models in GAMS include Décaluwé et al. (2013) and McDonald (2015). The interface developed for MAMS has been adapted to work with GEM-Core. An extension of GEM-Core, named GEM-Trade, has been developed for analysis of preferential trade agreements (Cicowiez and Lofgren 2016).
-3-remarks (Section 4). Appendix A has a full mathematical statement while Appendix B introduces the interface and Appendix C presents additional simulation results in tabular form.

Non-technical overview of model structure and database
GEM-Core is a single-country recursive-dynamic general equilibrium model designed for medium-and long-run policy analysis. It is a multi-purpose model in the sense that it can analyze policies in a wide range of areas including growth, fiscal space, and external shocks.
It can also be applied to databases with different disaggregations. A typical simulation period is 5-20 years. However, the period is highly flexible, ranging from comparative statics to very long periods, and should be determined by the purpose of the analysis.
This section provides a non-technical overview of GEM-Core and presents its macro database, structured to meet the needs of the model. 2 (A detailed mathematical statement of GEM-Core is found in Appendix A.) This presentation assumes that the model is applied to a database based on the macro SAM in Table 2.1. For illustration, we use data for a representative (or archetype) low-income country for 2015. 3 [Cicowiez and Lofgren (2017a), provide details regarding the building and interpretation of the SAM in Table 2.1.] The disaggregation of the accounts of the SAM defines the disaggregation of the database and the model application, i.e., it is here disaggregated into two activities and commodities (private and government), two factors of production (labor and private capital), and three institutions (household, government, and rest of world). As indicated by the SAM, each institution has not only current but also capital accounts, something that makes it possible for the model to cover issues related to the financing of current activities and investment. The SAM also depicts the structure of taxation via a set of disaggregated tax accounts. act-prv act-gov com-prv com-gov f-lab f-cap hhd gov row tax-act tax-com tax-imp tax-exp tax-dir cssoc cap-hhd cap-gov cap-row invng invg dstk total act-prv 153.

1b. Accounts in Macro SAM for archetype low-income country in 2015
Source: Cicowiez and Lofgren (2017a).

Model structure
In any single year, GEM-Core has the structure summarized in Figure 2.1. As indicated by the figure, which serves as the reference point for this model overview, the major building blocks of the model are activities (the entities that carry out production), commodities (activity outputs and/or imports; linked to markets), factors (also linked to markets), and institutions (households, enterprises, the government, and the rest of the world). Given the relatively detailed treatment of the financing of private investment (compared to most other CGE models), the private (non-government) capital account also has its own box. In the following model presentation, we assume that the different blocks have the disaggregation presented in the above SAM (Table 2.1).

Account Explanation
act-prv activity -private production act-gov activity -government production com-prv commodity -private production com-gov commodity -government production f-lab factor -labor f-cap factor -private capital hhd household gov government row rest of world tax-act taxes -activities tax-com taxes -commodities tax-imp taxes -tariffs on imports tax-exp taxes -exports tax-dir taxes -income cssoc social security contributions cap-hhd capital account -household cap-gov capital account -government cap-row capital account -rest of world inv-prv investment -private capital inv-gov investment -government capital dstk stock change
As indicated by Figure 2.1, activities produce and sell their output. According to the SAM, all government output is sold at home while private output is both sold at home and exported.
The activities use their revenues to cover costs of intermediate inputs and factors as well as, for the private activity, tax payments. The only factor used by the government is labor while the private activity uses both labor and private capital. For the government, the output level is in effect determined by government demand, a policy tool, which in its turn determines labor hiring and intermediate input demand. For the private sector, profit maximization drives decisions regarding factor employment, which determine the output level and intermediate demands. 4 The split of private output between exports and domestic sales depends on relative sales prices in these two destinations. 4 In terms of production technology, for both sectors, at the top level of the production nest, intermediate input demand and aggregate factor demand are fixed coefficients per unit of output. At the lower level, the substitutability between labor and capital for the private sector is determined by a CES (Constant Elasticity of The government gets its receipts from taxes, transfers from abroad, and net financing from households and the rest of the world. It uses these receipts for transfers to households, consumption, and investment (to provide the capital stocks required for government services). To remain within its budget constraint, it either adjusts some part(s) of its spending on the basis of available receipts or mobilizes additional receipts of one or more types to finance its spending plans.
In Figure 2.1, imports and exports (payment to/from the rest of the world for commodities) only apply to the private commodity. Foreign wages and rents is the only non-trade payment to the rest of the world. The non-trade payments received from the rest of the world are net transfers and financing to government and the private sector; the latter also includes foreign investment other than FDI. All non-trade payments are typically exogenous projections.
For the government commodity, the price paid for the demand-driven supply quantity depends on the unit supply cost (for labor and intermediate inputs). In the market for the private commodity, a flexible price ensures balance between demands for domestic output from domestic demanders and supplies to the domestic market from domestic suppliers.
Part of domestic demands for the private commodity are for imports; the ratio between demands for imports and domestic output depends on the ratio between the demander prices for commodities from these two sources (i.e., the prices demanders pay including relevant taxes and trade and transport margins) -an increase in the import/domestic price ratio lowers the ratio between the demands for imports and domestic output (and vice versa). Similarly, domestic suppliers (the activities) also consider relative prices when deciding on the allocation of their output between the domestic market and exports. For Substitution) function. The lower level is not relevant to the government; since it only uses one factor, labor, its coefficient is in effect also fixed. See Appendix A for more detail on functional forms.
-8-both exports and imports, the standard assumption is that international prices are exogenous (the small country assumption). 5 These import and export responses to relative price changes underpin the standard clearing mechanism for the balance of payments: changes in the real exchange rate (the ratio between international and domestic price levels, which may change due to changes in the nominal exchange rate) influence export and import quantities and values. For example, other things being equal, an exchange rate depreciation may eliminate a balance of payments deficit by raising the export quantity and reducing the import quantity (and vice versa for an appreciation).
For both labor and capital, the demand curves are downward-sloping, reflecting the production activity responses to changes in wages and rents. For private capital, which within any period has a fixed supply, a flexible rent clears the market. In the labor market, it is typically assumed that unemployment is endogenous with a wage curve that establishes a negative relation between the real wage and the unemployment rate (see Figure 2.2).
The above discussion refers to the functioning of the model economy in a single year. In GEM-Core, growth over time is endogenous. The economy grows due to employment growth for private capital and labor as well as growth in total factor productivity (TFP). For capital (only used by the private activity), employment growth coincides with stock growth, which depends on investment and depreciation; for labor, employment growth depends on growth in the stock (which in its turn may be seen as a function of population growth and changes in the labor force participation rates of different age and gender groups) and changes in the unemployment rate. Apart from an exogenous component, the TFP of both the private and the government activity may depend on growth in the public capital stock.
In addition, as noted above, the model covers a set of net financing flows: to the government from domestic non-government institutions (households and enterprises) and the rest of the world; and to domestic non-government institutions from the rest of the world. On the basis of the results for any simulation, assumptions about real interest rates, and initial debt stocks, post-calculations extract the implications for the evolution of wage employment labor supply unemployment labor demand -10-domestic and foreign debt stocks. The same applies to the evolution of the stock of foreign reserves, which is computed on the basis of the initial stock and annual changes.
A model like GEM-Core can help analysts better understand the effects of a wide range of policies and exogenous shocks also when it is applied to a two-sector macro database (the current case). To exemplify, in the fiscal area, it may address the space for government consumption and investment spending under alternative scenarios for TFP growth, foreign aid, and taxation, considering budgetary and sustainability constraints. Alternatively, it may consider the need and consequences of financing a planned spending program from different sources (foreign and domestic). Beyond the fiscal area, it may be used to assess the consequences of shocks affecting world (export and/or import) prices, migration flows, and worker remittances (current private transfers). It is straightforward to address demographic issues, including the impact on growth and living standards of changes in population size and age structure (endogenous or migration driven) and/or changes in ageand gender-specific labor force participation rates. On the other hand, in a macro application, there is little scope for addressing issues related to income distribution and structural change in sectoral production structure. Poverty analysis would have to be done in the context of an unchanged (or exogenously changed) aggregate income distribution. In some cases, it may be helpful to explore the broader macro consequences of scenarios defined by parallel micro analysis that, for example, proposes policy packages with components related to spending, income distribution, and/or factor productivity.

Poverty Module
To compute the poverty and distributional effects of each scenario, GEM-Core implements a poverty module based on MAMS (Lofgren et al., 2013). The module offers a choice between the following approaches: (i) constant elasticity of poverty with respect to per-capita welfare for each model household; (ii) log-normal distribution of per-capita welfare within each model household; and (iii) distribution of per-capita welfare within each model household follows a real-world household survey. In this macro application of GEM-Core, we use approach (ii). The module is linked to base-year poverty and distributional data for each of the representative households (RHs; one or more) in the database. It uses either household income or consumption as its welfare measure. The ability of the module to account for distributional change and its impact on poverty depends on the degree of -11-disaggregation of the RHs. In applications with a single RH (like the current one), it projects poverty outcomes on the assumption that distribution does not change. 6

Data
The database for GEM-Core consists of a SAM complemented by data related to factor employment, factor and population stocks, elasticities, and a GDP projection. For this macro application, we used the SAM of The disaggregation of the rest of the database coincides with that of the SAM; i.e., its size is very modest when GEM-Core is applied to a two-sector SAM. The non-SAM database consists of (a) base-year government and private employment; (b) base-year unemployment rate; (c) base-year private and government capital stocks and depreciation rates; (d) three elasticity values (for transformation of output between exports and domestic sales; and for substitution between labor and capital in private production and between imports and domestic output in domestic demand); and (e) projections for the simulation period for population, labor force participation, and GDP growth. This information is readily accessible from standard sources. Table 2.2 shows a-d for our application to an archetype low-income country; Table 2.3 shows e. For instance, we see that the rate of population growth is projected to decline gradually over time, from 2.7 percent in 2016 to 2.4 percent in 2030.
In the base simulation, labor productivity is a free variable, making sure that the projected path of GDP growth is replicated; for the non-base simulations, GDP growth is endogenous.
As discussed below in Section 3, for each simulation, it is also necessary to define (a) equilibrating mechanisms for the government budget, the balance of payments, and the -12-savings-investment balance; and (b) rules for (non-equilibrating) payments in the government budget and the balance of payments. Sources: (a) Elasticities: Authors' assessment based on literature; for a survey, see for example Annabi et al. (2006, esp. pp. 23-29 and 30-31), finding values in the range 0.3-0.9 for factor substitution and 0.5-2.0 for the two trade-related elasticities; elasticity of TFP with respect to trade openness: Dessus et al. (1999, pp. 27-29

Simulations
The simulations are designed to demonstrate the types of issues that can be analyzed in a GEM-Core application to a macro database. The first section discusses the base scenario, the second section the non-base scenarios.

Base scenario
The base scenario represents a business-as-usual projection without policy changes.
Drawing on projections from IMF's World Economic Outlook (IMF 2017), we impose an average growth rate of 4.9 percent for the period 2016-2030 -this figure corresponds to the projected average growth rate of low-income countries. In the base scenario, GDP growth is imposed by endogenously adjusting labor productivity. 7 We assume that government demand for government services, transfers from government to households, and domestic and foreign government net financing are all maintained at their base-year shares of GDP.
Taxes are fixed at their base-year rates, which means that they will grow roughly at the same pace as the overall economy.
At the macro level, GEM-Core -like any other CGE model -requires the specification of equilibrating mechanisms ("closures") for three macroeconomic balances: government, savings-investment, and the balance of payments. For the base scenario, the following closures are used: (a) government: its accounts are balanced via adjustments in the direct tax rate; (b) savings-investment: household savings adjust to generate exogenous GDP shares for domestic private investment while foreign (private) investment is financed via the balance of payments and government investment is covered within the government budget; and (c) balance of payments: the real exchange rate equilibrates this balance by influencing export and import quantities and values; the non-trade-related payments of the balance of payments (transfers and non-government net foreign financing) are non-clearing, kept fixed as shares of GDP.
For each simulation, base and non-base, GEM-Core provides the evolution over time for a wide range of indicators including: (a) macro outcomes: GDP at market prices (split into 7 In the non-base simulations, labor-specific productivity is invariably exogenous.
-15-private and government consumption and investment; exports; imports); the composition of the government budget, the balance of payments, and the savings-investment balance; total factor productivity; domestic and foreign debt stocks; (b) sectoral structure of production, value added, incomes, exports, and imports; and (c) the labor market: wages, unemployment, and employment by sector.  Table C.1). Domestic government debt increases from 18 to 26 percent of GDP whereas the foreign debt of the government stays roughly unchanged at around 30 percent of GDP (Table C.

Non-base scenarios
The non-base scenarios are defined in Table 3.1. They demonstrate some of the issues that can be addressed with GEM-Core when it is applied to a two-sector macro database. As shown in Table 3.1, the first three scenarios test the effects of an expansion in government investment, accompanied by an adjustment in one of three alternative financing sources (direct taxes, net domestic financing, or net foreign financing) that clears the government budget. The two remaining scenarios address the effects of external shocks: increases in remittances (transfers to households) from abroad and the world export price.

Name Description ginv-tdir
Government investment increase by 2 %-age points of base GDP in 2018-2030; budget cleared via direct tax adjustment ginv-dbor Same as ginv-tdir except for that budget is cleared via domestic borrowing adjustment ginv-fbor Same as ginv-tdir except for that is budget is cleared via foreign borrowing adjustment pwe 10.1% increase in the world price for exports during the period 2018-2030 remit Remittance increase by 2 %-age points of base GDP in 2018-2030 -19-*Note: Except for the changes indicated in the description, the scenarios are identical to the base scenario.
To facilitate comparisons across the different scenarios, all shocks are imposed during the same period (2018)(2019)(2020)(2021)(2022)(2023)(2024)(2025)(2026)(2027)(2028)(2029)(2030) and are of the same size (in each year, 2 percent of base scenario GDP for the same year). For the scenario pwe, the size of the export price shock (10.1 percent) was defined so that, in the absence of changes in export quantities, GDP or the exchange rate, in each year it would be exactly 2% of base GDP. However, for this and all other scenarios, GDP will change and, given this, the shocks (for example the increase in government investment) will not be exactly equal to 2 percent of the GDP of the new scenario.
Apart from the shocks that are imposed (described in Table 3.1), some assumptions are different for the non-base scenarios. For the savings-investment balance, instead of imposing a fixed GDP share for private investment, investment spending (including its GDP share) is endogenous, adjusting to make use of available financing in the context of exogenous household savings rates. For the government balance, the treatment is the same as for the base (with a flexible direct tax rate) except when the clearing variable is changed as part of the simulation design -this will be discussed further below. However, the treatment of the balance of payments is the same as for the base -the real exchange rate clears. Beyond the macro balances, the non-base scenarios also differ from the base in that the following payments are fixed at the levels generated by the base scenario (instead of being fixed as shares of GDP): domestic government financing (fixed in domestic currency, implicitly indexed to the CPI, the model numéraire, as explained in Appendix A); private and government transfers and financing from the rest of the world (fixed in foreign currency). 9 -20-It is important to note that the above-mentioned changes in assumptions for the non-base simulations have been introduced following an approach that assures that, if there were no other shocks (like those defined in Table 3.1), the base results would be exactly replicated.
This is achieved via adjustments of parameters for the non-base scenarios (related to the institutional payments and the macro balances) on the basis of the base results. However, as intended, when other shocks are introduced, then these changes have an impact on the results; for example, the impact of higher remittances on GDP growth is different depending on whether the level of private investment is a fixed GDP share, or is determined by the amount of domestic private financing for investment. 10

Government Investment Scenarios
Firstly, we assess the impact of an increase in government investment, under alternative financing mechanisms. For the government investment scenarios --ginv-tdir, ginv-dbor, and ginv-fbor -the increase is 2 percent of base GDP in each year; this generates an increase in annual government investment growth for the period 2018-2030 from 5.0 to 7.9 percent (Table C.1). A likely motivation for higher government investment is that the government capital that is created raises factor productivity. In the model, changes in government capital stocks is one of the determinants of sectoral TFP (the value of the efficiency terms in sectoral value-added functions), thus providing a link between government investment and TFP. The strength of the link is determined by sector-specific elasticities of TFP with respect to the ratio between current and base-year government capital stocks. Drawing on data from the literature, the elasticity is set to generate a total marginal product (measured in real value added) of 0.125 for government capital, i.e., other things being equal, one additional dollar of government capital raises total value added by 0.125. In the absence of any information to the contrary, the elasticity is the same for the private and government sectors. Following the back-of-the-envelope procedure described in Lofgren and Cicowiez 10 More concretely, the base scenario generates a path for household savings rates that is consistent with the private investment GDP shares that are imposed. For all non-base scenarios, the path of household savings rates is defined using base results while the private investment GDP share now is endogenous. If this were the only change introduced in a non-base scenario, then the results would be the same as for the base. However, if shocks are introduced, then the response will be different when private investment is savings-driven as opposed to having an exogenous GDP share (the base assumption).
-21-(2014), we estimated the internal rate of return for government investment at 12.1 percent. 11 The main results for the government investment scenarios are presented in Figures 3.6-3.11; additional information is found in Tables C.1-C.5. The results show that the impact of increased government investment very much depends on the financing mechanism.
Compared to the base, GDP growth increases substantially when marginal financing comes from direct taxes (ginv-tdir) or foreign borrowing (ginv-fbor) but declines when it stems from domestic borrowing, as it reduces the resources available for domestic private investment (ginv-dbor; Figure 3.6). If the expansion is financed by additional borrowing, then the 2030 government debt stocks increase significantly, as shares of GDP by around 15 percent for ginv-fbor and by 22 percent for ginv-dbor; the larger increase for the latter scenario is primarily due to slower GDP growth (Table C. growth increase while they decrease for ginv-dbor and remain virtually unchanged for ginvtdir. As a share of GDP, the need for additional financing from these different sources is 11 In the literature, estimates of the internal rate of return for government investment vary widely; average values may be in the range of 10-20 percent. For example, the median for observations for low-income countries for different investment types reported in Foster and Briceño-Garmendia (2010, p. 71) is 14.3 percent; see also Dessus and Herrera (2000, p. 413). In general, these values would be expected to vary depending on (a) the types of investment; (b) the level of development (i.e., size of initial capital stock relative to economic needs, relatively low at low levels of GDP per capita) (Calderon and Serven, 2014); and (c) the quality of government institutions.
-22-smaller the greater the success of the scenario in raising growth; for example, in 2030, the addition to foreign borrowing is 1.6 percent of GDP for ginv-fbor while, for the scenario ginv-dbor, additional domestic borrowing amounts to 2.4 percent of GDP (Table C4). In percapita terms -population growth is exogenous --the annual growth deviations for private consumption range between gains and losses at close to 0.2 percentage points for the simulations ginv-fbor and ginv-dbor, respectively (Figure 3.8), which translate into changes in the 2030 poverty rate of around 1 percentage point (Figure 3.9). The GDP changes due to government investment are limited to the private sector since investment goods are produced by the private sector (or imported) while the demand for government services is policy-driven and unchanged (Figure 3.10).

External shocks
The second set of scenarios tests the implications of two external shocks: increases in world export prices and remittances. Figures 3.6-3.10 and 3.12 show results.
In the first scenario, labeled pwe, export prices (in foreign currency), are raised so that, other things being equal (including unchanged export quantity, GDP, and exchange rate), the gain in export income would have amounted to 2 percent of GDP in each year 2018--23-2030; given that exports are around 20 percent of GDP, this translates into a price increase of around 10 percent. As expected, higher export prices lead to an exchange rate appreciation (at an annual rate of 0.5 percent;  (Figure 3.12).
The relatively feeble gain in private investment growth is due to the fact that the exchange rate appreciation reduces the domestic value of foreign investment (which is exogenous in foreign currency, unchanged from the base scenario level) enough to counterbalance most of the increase in the part of private investment that is financed out of domestic savings.
This outcome is sensitive to the specifics of this application, including the share of foreign investment in total private investment (part of the base-year data set), how it evolves over time (including how it responds to changing conditions in the domestic economy), as well as the degree of flexibility in the response of the economy to the positive terms-of-trade shock.
In the second external shock scenario, remit, remittances from abroad to the household (which are exogenous in foreign currency) are increased by 2 percentage points of base scenario GDP. The resulting increase in household income gives rise to increased growth for absorption, private consumption, private savings, private investment, and GDP (Figures 3.6 and 3.7). In response to the initial surplus in the balance of payments, the real exchange rate appreciates, bringing about lower export growth, higher import growth, and a larger trade deficit. The appreciation is more moderate than for the scenario pwe since the improvement in export incentives is absent. The loss in export growth may be a concern, signaling a mild form of Dutch disease -by 2030, real exports are around 3 percent below the base 2030 level. From another angle, it is the increase in the trade deficit that makes it possible for absorption to grow more rapidly independently of any increase in GDP growth.
-24-Note also that the extent to which the model splits this increase in the trade deficit (due to the remittance shock) across adjustments in exports and imports depends on economic structure, including the relative responsiveness of exports and imports to exchange rate changes; in the model, the level and relative values of trade elasticities should reflect such structural features (cf. elasticity data in Table 2.2).

Conclusions
This paper presents GEM-Core, a model for country-level CGE analysis, covering its structure and data needs, and demonstrating its use in a macro application. The simulations in this paper are examples of the types of shocks that can be simulated with a two-sector database. Other examples include macro aspects of taxation, foreign aid, demography, labor force participation, savings, investment, and domestic and foreign debt sustainability. The Excel-based interface, which has been developed for the model (described in Appendix B), facilitates model applications; however, to make good use of the model, it is essential to understand its structure (presented in Appendix A) and learn from applying it.
A companion paper (Cicowiez and Lofgren, 2017a) provides macro SAMs for 133 countries; these provide the bulk of the data needed for macro applications. Given that these SAMs and the rest of the databases needed for country applications are very small, they can easily be adjusted and updated by the analyst.
However, while macro applications meet some analytical needs and may be preferable for training purposes, GEM-Core and its interface are equally applicable to databases that have finely disaggregated households, factors, and sectors; this is possible thanks to the use of set notation in the model (parameters, variables, and equations) and its database.

Appendix A: GEM-Core Mathematical Statement
This appendix presents a mathematical statement of GEM-Core, showing the relationships that, together with the database, determine the results of model simulations. A good understanding of the structure of the model and its database is needed to well understand the simulation results. The appendix is divided into two subsections, notation (A.1) and equations (A.2). Throughout, the presentation is organized around a set of tables. variables and the parameters that are most likely to change over time.

A.1. Notation
All model components are potentially active but whether they are used in any given application depends on the disaggregation of the database. In  ica ; q c  *The names of Latin letter variables and parameters that refer to prices, quantities, and factor wages (rents) start with P, Q, and WF, respectively. **The distinction between exogenous variables and parameters is that the latter always have exogenous values whereas the former under alternative assumptions may be endogenous.  , ,

A.2. Equations
The equations are split into four blocks: 1. Production and factors; 2.
Domestic and aggregate foreign trade; 3.
Current accounts of domestic institutions 4.
Each section of the presentation covers one block and has its equations stated in one table.
In model simulations, it is possible to choose among alternative assumptions for (i) payments linking the government, domestic non-government institutions, and the rest of the world; and (ii) the equilibrating mechanisms (the closures) for macro balances, factor markets, and markets for exports and imports. The assumptions used in this paper are presented in Section 3. 13 In this appendix, we apply the following set of relatively simple assumptions:  Government budget: The government balance is cleared by adjustments in government investment in the context of rule-based or exogenous levels for other government 13 The User Guide that accompanies ISIM-GEM-Core provides full details on these and other model features.
-37-payments (including exogenous values for tax rates, quantities of government consumption, and foreign and domestic financing).
 Savings-investment: The level of domestically financed private investment is determined by the level of financing from domestic non-government institutions, for which the marginal propensities to save are fixed. Government investment is financed as part of the government budget.
 Balance of payments: The balance is cleared by adjustments in the real exchange rate, which influence export and import quantities and values; other items in the balance of payments (including transfers, foreign investment, and net foreign financing) are exogenous or determined by other rules.

 Factor markets:
 Private capital is activity-specific (not mobile across activities), with an activityspecific market-clearing wage.
 Other factors (including labor) are mobile across activities; unemployment is endogenous for selected factors (typically labor).
 Foreign markets for exports and imports. Both world export and import prices are exogenous (i.e., the small country assumption).

A.2.1. Production and factors
The equations in this block are found in Table A.2.1. They cover the determination of production by sector, demands for factors and intermediates, TFP, factor wages (or rents), unemployment, and factor incomes.
The activity levels (QA), which drive the level of commodity production by each activity, is a CES function of factor employment, scaled to account for the contribution of intermediate  For non-labor factors, the unemployment (excess-capacity) rates are fixed (PRD8). For labor, wages are determined by a "wage curve", which is a function of the base-year wage and the ratios between current and base-year values for the CPI (the numéraire, which in practice does not change) and the unemployment rate, UERAT, which is endogenous and raised to a negative elasticity (PRD9). For all factors, the activity-specific wage term (WFDIST) is fixed (PRD10) and, irrespective of whether unemployment is endogenous or not, the factor market equilibrium conditions state that total employment equals total supplies adjusted for unemployment (or excess capacity) (PRD11). Irrespective of the treatment of the markets, the total income for each factor (YF), also including private capital, is the product of the two wage terms and quantities employed, summed over all activities, plus net factor transfers (or income) from abroad, adjusted for the exchange rate (PRD12).    Equations TRD1-TRD3 are related to prices. In TRD1, the export price received by producers, PE, is defined as the world export price, transformed into domestic currency via the exchange rate and adjusted for export taxes and the transactions (trade and transport) cost per unit of exports; the unit transactions cost is defined as the product of an input coefficient (ice) and the input price, summed over all inputs. In analogous fashion, equation TRD2 defines the domestic currency import price for demanders, PM, on the basis of the world import price, the exchange rate, and import tariffs, in this case with the unit transactions cost added to the price. In both equations, it is assumed that the modeled economy is small; thus, world prices for exports and imports (pwe and pwm) are exogenous.
Equation TRD3 links the demander and supplier prices for domestic output sold domestically, PDD and PDS: the demander price is defined as the supplier price plus the transactions cost per unit of domestically sold output; as will be discussed below, either of these prices can be seen as the market-clearing price for this category of outputs (cf.

equation INV3).
The commodity demand, QQ, is a CES aggregation of imports and domestic purchases, named the Armington function after its originator (TRD4); QQ is referred to as a "composite" demand given that it is met from different sources. Equation TRD5 defines the  , 00 , 00 00 Factor income -41-composite demands for commodities that (as opposed to those covered by TRD4) do not have both imports and domestic purchases.
For commodities with both sources, domestic demanders are assumed to minimize the cost of any composite demand quantity subject to the Armington function and subject to the relative prices. The first-order conditions (FOCs) are made up of the Armington function itself (TRD4), and an equation that specifies the optimal demand ratio (QM/QD) as a function of the ratio between the prices of domestic output and imports (PDD/PM) (TRD6).
The composite price PQS is implicitly defined by TRD7 given that the other variables in this equation are determined by other relationships. At the composite commodity level, a distinction is made between PQS and PQD. As shown by TRD8, the distinction is that PQD      20 As an alternative to CPI, the domestic producer price index (DPI) may serve as numéraire. In addition, it is often used as the denominator in the definition of the price-level-deflated (PLD) real exchange rate (REXR).
Algebraically, with time subscripts omitted, c c c C -55-run using GAMS and Excel without the interface). Most users of ISIM are simply expected to do policy analysis using one or more applications, each of which is associated with an existing data set and includes a pre-programmed reference scenario. However, advanced users may also develop a database and a reference scenario working in GAMS-GEM and, after reading in the database as a new data set for ISIM (using its Expert Mode), shift to ISIM for policy analysis, perhaps collaborating with a broader group of analysts. The aim is that every user, irrespective of background, finds it more convenient to carry out the policy analysis step in ISIM rather than using the traditional GAMS-GEM alternative.
Assuming that GAMS and Excel 2007 or newer are already installed on the user's computer, the first step is to install ISIM, which comes in the form of an .exe file that, when executed, runs a standard installation routine. After installation, Excel has a new tab called ISIM that, when selected, opens an intuitive interface ribbon with user-friendly buttons. To run ISIM for an application (once defined), the user simply has to click on the Run button on the ISIM ribbon.
The ISIM interface is connected to a database that, for each data set, stores definitions of sets (including commodities, activities, factors, and institutions) and parameters (including default elasticities, closure and rules/policies) that are used to define scenarios. The rest of the relevant country data set (other than the application database) is stored in the ISIM installation folder, mostly in GDX and Excel files.
Assuming that the user is satisfied to work with one of the existing data sets, the next steps are to: (1) open Excel 2007 or newer; (2) select the ISIM tab (see Figure B.1); (3) create a new application and associate it with one of the available data sets; (4) run and optionally modify the pre-defined reference scenario; (5) define and run additional scenarios such as "base" (that may be identical to the reference scenario) and, most likely, other scenarios of interest; and (6) access the results inside the same Excel file, presented in tables and graphs. Throughout the process, parameters and other items are hyperlinked to relevant segments in the GEM-Core User Guide (Lofgren and Cicowiez, 2017b), which is included with ISIM. Each application resides in an Excel file (named by the user) that can be used by others who have ISIM installed. -56-

Selection of database and model version
This section shows how to create an ISIM application named "example" based on the "Armenia2013v2" data set and using the GEM-Core model (see Figure B.2). 24 ISIM will load into Excel the data needed to define scenarios for the selected application, including the elements in the sets that are used to define shocks (e.g., the elements in the set of exported commodities are loaded to define world export prices; or the elements in institution sets so as to define interinstitutional transfers).

Figure B.2. New Application dialog box
ISIM permits changes in and creation of application databases; the user can change selected elements of these data sets, like elasticities, closures and rules. To facilitate the navigation 24 As explained in Section 4, two versions of MAMS exist: Core (a standard, dynamic-recursive CGE model), and MDG (an extended dynamic-recursive CGE model designed for MDG and human development analysis).
-57-across the different sections of the Excel file, the user is provided with a button for the Navigation Tree, where the analyst can click on the element of interest (see Figure B.1).
In addition, (advanced) users can add new country data sets to ISIM and change other aspects of the GEM-Core program by editing relevant files in the ISIM\GEM-Core installation folder, using Excel and a text editor.

The reference scenario
The first step in performing counterfactual simulations with ISIM is the construction of a (dynamic) baseline scenario. To help the user carry out this task, ISIM includes, for each country data set, a pre-defined reference scenario. Key parameters of this scenario can be changed inside ISIM, including the GDP growth rate, all model elasticities (including those related to trade, household expenditure, the reservation wage, and the impact of share of trade in real GDP on total factor productivity), as well as closures and other rules, the latter covering the government budget, the balance of payments, the savings-investment balance, factor markets, and various payments, split into government and non-government depending on whether the government is involved or not. The rule chosen for any payment is overwritten if, according to the related closure setting, the payment in question is a free variable; for example, the specification that direct taxes are determined on the basis of exogenous tax rates is overwritten if, according to the government closure rules, changes in direct taxes clear the government budget. In addition, the user can configure the ISIM Poverty Module (see Lofgren and Cicowiez (2017b)). Specifically, the parameters of the Poverty Module allow the user to change: (1) the approach to compute poverty; (2) the welfare index (income/consumption); (3) the initial poverty rate; and (4) the growth elasticity of poverty.
To exemplify, Figures B.3a and B.3b demonstrate how the analyst can change the elasticities of substitution between primary factors of production; the default values can always be restored.
Once defined, the reference scenario can be run by clicking the Run Setup button; ISIM will automatically call GAMS in order to run GEM-Core. -58-

Defining and running scenarios for analysis
By default, ISIM generates a scenario called base. The user can define additional scenarios and introduce policy changes and exogenous shocks, including changes in world prices of exports and imports, foreign aid, taxation, public spending (and its allocation in other models in the GEM Suite). All the defined counterfactual scenarios are saved in the ISIM application-specific Excel file. The types of changes that can be introduced relative to the reference scenario reflect what seemed relevant to include in light of experience from a large number of CGE applications. The interface validates the input from the user in order to reduce the likelihood that simulations will fail to run without error.
To create a new simulation or delete an existing one, the user clicks on the Scenario Manager button, opening the window shown in Figure B.4. By clicking or unclicking the box -59-in front of each scenario, the user decides which simulations to run (there is no need to run all the defined scenarios). By right-clicking above any scenario, the user can edit the name and the explanatory text, delete, clone, and change the solution order of the simulation. In the example, the pwm-2 simulation will be run, while the pwe-2 will not. The elements under Shocks and Closure and Rules in the Navigation Tree show what can be changed in the definition of the non-reference scenarios. If no changes are made for a scenario, then it is identical to the reference scenario. In order for the base scenario to function as the benchmark to which other scenarios are compared, it may be preferable to leave it unchanged (i.e., identical to the reference scenario).

Figure B.4: The Scenario Manager
More specifically, the user can make changes in a set of items, grouped into the following categories:  external shocks: changes in (1) the world price of exports and imports; (2) foreign direct investment; and (3) foreign borrowing.
 total factor productivity shocks: changes in (1) total factor productivity, by activity and time period; and (2) real GDP at factor cost.
 demographic shocks: changes in (1) population size, by representative household or other population segment; and (2) changes in the growth rate of non-capital factors.
 transfers shocks: changes in (1) transfers to non-household institutions or factors; and (2) per-capita transfers to households.
-60- closures and rules: changes in closures and rules -similar to the setting of closures and rules for the pre-programmed reference scenario. Among other things, the rules section allows defining scenarios with changes in (1) government spending and receipts, and (2) transfers between institutions As an example, Figure B.5 shows how to define a 50 percent increase in the world price of agricultural exports during 2014-2030 using an application based on the "Armenia2013v2" data set; the other shocks can be similarly defined.

Review and further processing of simulation results
Once the selected scenarios have been run with success, results can be accessed via the ISIM interface by clicking on Reports via the Navigation Tree. In addition to providing simulated variable results as levels, growth rates, and GDP shares -all accessible through a pivot table inside Excel as well as GAMS GDX files -the interface generates pre-defined tables and figures (see Figure B.6 for an example of a pre-defined table). By clicking on the Configuration button, the user can select which pre-programmed tables are generated, start and end years for these tables, the order in which the result tables will appear, and whether or not to generate a pivot table and chart with raw model results. Irrespective of the settings under Configuration | Reports, the user can access all simulation results using the report GDX files through the View | Files menu option. -61-

Input validation and error messages
Before calling GAMS to run a selected simulation, ISIM validates the definition of shocks, elasticities, and/or closures and rules. In case errors are found, messages appear in pop-up windows and the user will have to check the red Excel cells, located in the sheets whose label also turned to red. Besides, an error summary sheet shows the list of generated validation errors. In case the solution of ISIM ends with an error, the user is offered the chance to inspect the ISIM log file or the GAMS listing file. The log and listing file viewer allows the user to navigate through the ISIM and/or GAMS errors. The log file is intended for users with no GAMS knowledge. On the other hand, the GAMS listing file provides the raw GAMS results and error messages. In case GEM-Core --or any other model within ISIM --is successfully solved, ISIM will add or update the report sheets (i.e., it will add extra worksheets in Excel). -62-

. Real sectoral value added for base and non-base simulations (% annual growth 2018-2030)
Note: The 2017 column shows levels as GDP shares (%), while the simulation columns show annual growth rates 2018-2030.
Source: Authors' calculations based on simulation results.