Lecture 10 - Hands on with CGE (Computable General Equilibrium)

PRE-CLASS SOFTWARE SETUP: Please install RunGTAP on your computer before class from here. Unfortunately, this is WINDOWS ONLY, so if you are mac, you can either install a virtual machine or (probably easier) identify a person in class ahead of time that you would like to work with during class who has a windows machine.

Reading: Corong et al. 2017

Slides as Powerpoint: Download here

Video link: On Youtube

Content

Introduction to Hands-On CGE Modeling

This lecture builds on the previous introduction to computable general equilibrium (CGE) modeling, which was primarily conceptual with a few key equations. Since the focus of this applied earth economy modeling course is on practical applications rather than pure theory, today’s session emphasizes hands-on work with actual CGE tools and software. The primary objectives are to take stock of the course progress as we near the end of the half-semester, walk through a numerical example from the seminal 1997 book by Hurdle and colleagues, and dive into practical work with RunGTAP, the application software used for CGE analysis. Given the limited number of computers available that can run the software, the class will work as a group, and this will be structured as a group assignment.

Course Progress and Administrative Updates

The course is nearing the end of a fast-paced half-semester format. Looking at the course page, the format has been successful, filling out with links to resources rather than just text, and the actual progression has stayed remarkably close to the original plan. This lecture represents the tenth session in the sequence.

Assignment and Project Deadlines

Assignment 5, titled “Computable CGE in General Equilibrium,” has been posted and is due on the 14th. Additionally, there are several intermediate deliverables for the final project that students need to be aware of. On the 6th, which will be the next class session, students are expected to submit one to two sentences describing their idea for the final project. Feedback on these brief proposals will be provided before the following class. The outline of what students think they might find or accomplish is due on the 8th, and then each student will send that outline to a peer reviewer in the class. Each person will be responsible for peer reviewing one other proposal. The final project itself is due on the 16th, which is the last day of class.

Final Project Options and Structure

The final project details are now available in the Assignments tab. In addition to the four small milestones described above, the project description outlines what students can do for their projects. The basic idea is to replicate one of problem sets 3, 4, or 5, but not 1 or 2, with a significant tweak that involves doing something different from the original assignment. Whether a particular tweak is sufficient for the final project is something that will be worked out collaboratively through the one to two sentence description, the outline, and the peer review process.

Students could also use exercises from Burrfisher and colleagues, which is an updated book on teaching CGEs that provides additional problem sets and examples. Another option is to analyze one of the climate integrated assessment models (IAMs) that were discussed earlier in the course, such as the DICE 2016 model or others in the MINIE framework. Students could replicate a paper from the literature or define their own policy option, such as analyzing the effects of changing the carbon tax rate to a different level.

Another possibility is conducting an Invest analysis, but for a different country or ecosystem service than what was covered in class. This would involve identifying or creating alternate land use and land cover maps for a new region. So far in the course, only the base data included with Invest, specifically the Willamette Basin dataset, has been used. However, students could use their own region of interest. The process of creating new land use and land cover maps will be discussed in a later hands-on session.

Whatever option students choose, they will write up their results in a short report of 2 to 5 pages and create a slide deck to present on the last day of class. Each intermediate step will count for a smaller percentage of the grade, but most of the grade weight will be on the final deliverable. Students will not be graded on how polished their paper is in terms of writing quality. The focus is more on the research ideas and the quality of the analysis. The goal is for this project to be something students could potentially use as a paper in another project, as a second-year paper, or even as a dissertation chapter.

If students have another idea that is related to linking earth and economic models, that is also acceptable. The only thing the instructor might hesitate on is a standard statistical regression by itself, since that is not the focus of this course. However, if the regression is coupled to DICE or another model to generate the social cost of carbon or some other integrated metric, that would be a good idea. The main point is to emphasize the linkage between earth system models and economic models, not just regression analysis in isolation.

The final project timeline is intended to be flexible. It is there to keep students moving forward and making progress, but there is room for discussion and adjustment as the project develops.

Introduction to RunGTAP Software

Before diving into the substantive content, there is a practical matter to address regarding the RunGTAP software. Students were expected to have attempted to install RunGTAP prior to this class. The class is a little short on PCs this year, and unfortunately the software only works on Windows PCs, not on Mac computers. This constraint means that students will need to share the available computers and work collaboratively.

The Hurdle et al. Simple CGE Model

The class now turns to a simple but seminal model of the global economy. For complete details, students should refer to Hurdle and colleagues 1997, which is the foundational GTAP book, and specifically Chapter 2 of that volume. The figure presented in the book should look familiar from previous discussions of economic models. It shows the private household, the regional household, government, and savings, with linkages to producers throughout the system. The production process depends not just on endowments from households, such as labor and capital, but also on intermediate production from other parts of the economy, meaning that producers use outputs from other producers as inputs.

Structure of the One-Region Model

Chapter 2 describes the structure of the simplest possible model, which is a one-region model with no trade linkage. In the fuller, more complex model that will be built up to, there would be links to other markets via import and export flows. However, in this simplified version, there is no trade, no taxes, and no depreciation on capital. The model assumes that expenditures by the household at the aggregate level are chosen first, and then allocated across private household consumption, savings, and government expenditure.

The Regional Household Construct

The benefit of having a regional household as a separate entity in the model is significant. Without this construct, it would be impossible to track utility properly if, for example, private expenditure goes down but government expenditure goes up by a corresponding amount. This abstraction allows modelers to track what happens when some parts of expenditure go up and others go down, maintaining a coherent measure of overall welfare. In reality, this modeling choice mostly matters for country-by-country calibration of the model to real-world data.

This represents the simplest circular flow diagram: a one-region, closed economy without government intervention. When each element is defined mathematically, the model can include multiple producers, and eventually the framework will be built up to a three-producer by three-country setup that is more realistic.

Without separating out the regional household from the private household, it would not be possible to track changes in utility accurately. For example, private consumption might go down because government consumption goes up, such as during a war when governments commandeer resources for military purposes. Government expenditures eventually get consumed by people in some form, but not through private decision-making processes in markets.

This simplified structure is a huge simplification implemented for learning purposes. The choice of government expenditure is not really endogenous in this basic model. Instead, it is calibrated by looking at what countries in the GTAP database have for different tax rates and spending patterns. It is a construct to set government behavior exogenously, but in principle one could endogenize it, which would be an interesting research question for an advanced project.

Adding Complexity to the Model

Building on the simple one-region model, additional features can be added. The class is working toward understanding a 3x3 economy with three countries or regions. Adding something to a model like this means solving for prices with more equations and more constraints. When solving even the simplest one-good, capital-labor model, the modeler defines first-order conditions and optimizes utility subject to production constraints. The fundamental task is figuring out the prices that make markets clear, meaning the prices at which supply equals demand. Adding a new market to the model means introducing a new set of prices that must be solved for simultaneously with all the other prices.

Variable Naming Conventions

The diagram in the GTAP book labels variables with specific codes like VIFA, which stands for the value of producer’s intermediate goods going to foreign countries at agent prices. The model will define a system of equations, and all these variable names help manage the complexity of the system. For example, VOA is the value paid to agents for the endowment they use. Firms buy endowments of capital and labor as inputs to production, and they pay households for these factors. VOA is a vector of prices, and when multiplied by the allocation of goods, it gives the total value flowing from producers to individuals for their provision of labor and capital services.

Other variables have clear real-world interpretations. For example, VIFA represents the value of intermediate goods exported from one region to another. If metal is mined in Chile and exported to the United States for processing, this would be measured by the VIFA from Chile to the US for aluminum or copper.

Incorporating Government and Trade

At this stage, trade has been added to the model, but governments also exist and must be accounted for. Governments are a significant part of most economies, representing 20% or more of total economic activity in many countries. Ignoring government activity entirely does not work when trying to connect the model to actual data. In CGE modeling, modelers must account for government spending explicitly, and the GTAP database collects extensive data on government expenditure patterns across countries.

General Equilibrium Treatment of Government

If the government spends resources, this must be explained in general equilibrium terms. In general equilibrium modeling, nothing can be left undescribed or unexplained. If government spending represents 35% of the value in the economy, it must raise money through some mechanism, typically taxes. Otherwise, the government would be spending unmodeled money that appears from nowhere, which violates the fundamental principles of general equilibrium.

In general equilibrium, nothing is free. Government expenditure must have a revenue source, typically taxes. This can be modeled by modifying the supply and demand structure to include a tax wedge between the price received by producers and the price paid by consumers. This changes the equilibrium price and quantity, and these changes are tracked by the CGE model. The model keeps track of the price paid by the consumer and the price received by the supplier, with the difference between these two prices representing the tax revenue collected by the government.

The tax is specified as a percentage of the existing amount, and this specification adds a new equation to the optimization problem that must be solved. The tau parameter, representing the tax rate, is specific to each commodity and each region, allowing for differentiated tax policies across goods and countries.

Applied Analysis Using RunGTAP

Moving from theory to application, the class will now work with RunGTAP software. In the GTAP book, the 3x3 aggregation example includes the United States, the European Union, and the rest of the world. Aggregating the economy to a smaller number of regions is a critical step in the GTAP modeling process. Most analyses do not run on the full database of 160 countries and 65 sectors because this would be computationally intensive and often unnecessary for the research question at hand. Instead, analysts aggregate to something smaller, like a 3x3 structure, for computational feasibility and clarity. As computational power has increased over time, more analyses are able to keep more of the specificity of the full database.

The 3x3 Example Structure

For the sector aggregation in this example, the economy will be aggregated to three broad sectors: food and agricultural products, manufacturing and mining, and services. The question that will be answered using RunGTAP is: What if there was a 10% cut in the ad valorem equivalent tariff on US food exports to the EU? What would be the value of that trade liberalization policy? This is a real policy question that trade economists and policymakers care about.

The relevant reference is the GTAP book, specifically page 65. The point of running a model like this is to apply a change, which is called a “shock” in CGE terminology, such as a 10% reduction in the tariff rate. The model is solved once for the baseline economy without the shock, and then again for the shocked economy with the policy change. The difference between these two equilibria is what analysts care about and what represents the impact of the policy.

Example Results from Trade Liberalization

For example, in the case analyzed in the GTAP book, a reduction in EU import tariffs on US food led to the market price of food in the United States increasing by 14%. The economic logic is that lower tariffs increase EU demand for US food exports, which makes food scarcer in the US domestic market and raises prices there. This type of model is used extensively to analyze the effects of tariff changes and trade agreements on economies. The results from GTAP-style models matched observed data reasonably well in many cases, making this approach highly influential in trade policy analysis.

Working with RunGTAP Software

Now the class will actually work with the RunGTAP software. In RunGTAP, the first step is to load the version of the database called “A Coors 3x3.” The regions in this aggregation should be USA, EU, and rest of world. Under the versions menu, users can select the modules they want to run. The main model is the GTAP model itself, but there are other modules available as well that extend the basic framework. Users can choose which parts of the code to run, but for this introductory exercise, the defaults will be kept.

Loading and Running an Experiment

Next, users should go to the Solve tab and click on Load Experiment. Experiment 1A is the 10% cut in the tariff on US foods exported to the EU that was discussed earlier. Double-clicking that experiment will load it into the software. The solution method is called Johansen One Step, which is a fast linearization method that works well for this type of analysis and provides accurate results for small to moderate shocks.

Exploring the Database

Before running the model, it is valuable to explore the data that underlies the analysis. RunGTAP includes the data directly in the application, making it accessible for inspection. Under View > Base Data, users can load the core data files. The interface shows all the HAR files, which stands for Header Array Files. This is an old but highly optimized data storage type that was developed for economic modeling. The first page that appears lists all the variables and their headers in the database.

For example, VIFA appears in the listing, and this comes directly from the circular flow diagram discussed earlier. Clicking on a variable shows its dimensions and structure. Some variables are one-dimensional, like the savings rate which is just a single number for each of the three countries. Other variables are two-dimensional, like government domestic purchases of tradable commodities by region, which varies across both commodities and regions. Some variables are three-dimensional or even higher-dimensional.

Using GTAP Data for Other Research

The GTAP database is useful even outside of CGE modeling contexts. For example, researchers can look up the value of US food exports to the EU directly in the database. This data can be used for other types of research, such as estimating the contribution of natural capital or ecosystem services to agricultural production, or for gravity models of trade.

Understanding Notation: Agent versus Market Prices

Other notational elements are important to understand. The distinction between agent prices and market prices is fundamental. VDFA is the value of domestic firm purchases at agent prices, while VDFM is the value at market prices. The difference between these two is the tax amount charged on top of the market price. The market price is what would prevail in the absence of taxes, but agents actually pay both the market price and the tax. This tax revenue accrues to the government and is used for government purchases.

The letters F, G, and P in variable names denote firms, government, and private households, respectively. For example, VDGA is the value of domestic government purchases at agent prices. Other variables in the database include VKB, which is the value of capital stock or bilateral exports at market prices, and EVOA, which is the endowment value used in output at agent prices.

Parameters and Elasticities

Parameters, such as elasticities of substitution, are also available in RunGTAP under View > Parameters. For example, ESBM is the elasticity of substitution for imports in Armington’s structure. Armington assumptions are a standard way of allowing for consumer preferences for goods from different countries of origin, even when the goods are nominally the same. This allows the model to match observed trade patterns where countries both import and export similar goods.

Understanding Model Output

Most of the time spent working with big data contexts like this is devoted to understanding the output, not to generating it. The actual model solution is relatively quick once everything is set up properly. In GTAP, users can view output in various ways. For example, GDP_EXP shows GDP broken down into its constituent expenditure components: consumption plus investment plus government spending plus exports minus imports. This decomposition is shown for each country or region in the model.

Policy Data in GTAP

The GTAP database also collects data on policies, such as tax rates and import bans, which are regularized and included consistently in the database structure. This allows for policy experiments to be conducted on a consistent basis across countries.

The Mathematical Structure of the Model

The model uses a cost function framework, where producers minimize total cost subject to output constraints. The total cost is the sum of price times quantity for all inputs. The functional form used is CES, which stands for constant elasticity of substitution. This functional form is iterated over sectors and regions to build up the complete production structure. The CES functions can become very long and complex when there are many possible substitution opportunities among inputs.

Viewing the Code

The equations that define the model are contained in .tab files, which can be viewed in TabMate, an integrated development environment (IDE) for the Tableau language that GTAP uses. The code defines sets of elements like regions and commodities, coefficients that parameterize the model, and modules that group related equations together. The formulas for variables like VDMIR, which is the value of domestic imports, are specified explicitly in the code. The domain over which each equation operates is specified, such as all traded commodities and all regions.

Model Closure

The closure of the model is a critical concept. The closure defines which variables are exogenous, meaning they are set by the modeler and held fixed, and which are endogenous, meaning they are solved for by the model. The closure must be set up so that the number of equations matches the number of unknowns, ensuring that the system can be solved. For example, total factor productivity (TFP) is exogenous in this model, meaning it is held fixed. However, a modeler could swap the treatment of TFP and GDP, making GDP exogenous and solving for the TFP that would be required to achieve that GDP level.

Running the Model and Interpreting Results

With all the setup complete, users can click the Solve button to run the model. The model will run and write output files for all the solution variables. Most of the work in CGE analysis comes in unpacking and interpreting the results. The macros file reports both pre-shock and post-shock values for various variables, as well as the percentage changes from the baseline to the shocked scenario.

Price Changes and Equilibrium

For example, PG is the government consumption price for a commodity in a region. The equilibrium is expressed in terms of equilibrium prices, with changes shown as percentage increases or decreases from the base price level. This allows analysts to see not just what the new equilibrium looks like, but how much it differs from the original baseline.

This computational approach allows economists to solve large-scale equilibrium problems that would be completely infeasible to solve by hand. Modern computers make it possible to solve fully disaggregated models with many countries and many sectors simultaneously, something that would have been impossible just a few decades ago.

Next Steps and Assignment

The class will pick up where it left off in the next session and do more with RunGTAP and CGE analysis. However, students should have enough information and experience now to get started on the problem set. The first question on the problem set is arithmetic in nature, working through calculations by hand to understand the structure. The second question involves RunGTAP analysis of a particular paper, requiring students to replicate or extend results from the literature.

Transcript

Alright, let’s get started. Welcome to Lecture 10: Hands-On with CGEs and GTAP.

Today, we’ll build on last lecture’s introduction to computable general equilibrium (CGE) modeling, which was mostly conceptual with a few equations. Since this is applied earth economy modeling, we want to focus on applications. The objectives for today are to take stock of where we are in the course, walk through a numerical example from Hurdle et al. 1997 (a seminal book in CGE modeling), and dive into RunGTAP, the application. We’ll work as a group, since we have a limited number of Macs, but that should be fine. This will be a group assignment.

First, let’s take stock of where we are. We’re nearing the end of this fast-paced, half-semester course. I’ll check in on that, then we’ll walk through a numerical example we’ll use throughout today, from Hurdle et al. 1997.

We’ll then move quickly into RunGTAP. We’ll work as a group, since we have a limited number of PCs, but that should be fine. This will be a group assignment.

Looking at our course page, I like this format—it’s filling out with links instead of just text, and we’ve stayed close to the original plan. I’m proud of that. Today is Lecture 10. There are a few updates: Assignment 5, “Computable CGE in General Equilibrium,” is posted and due on the 14th. There are also a series of intermediate deliverables for the final project. On the 6th (next class), I want you to write one to two sentences about your idea for the final project. I’ll give you feedback for the next class. The outline of what you think you might find will be due on the 8th, and then you’ll send that to a peer reviewer in the class. Each person will peer review one other proposal. The final project is due on the 16th, our last day of class.

The final project is now up in the Assignments tab. In addition to the four small milestones, it tells you what you can do for the project. The basic idea is to replicate one of problem sets 3, 4, or 5 (not 1 or 2), but with a tweak—doing something different. Whether that tweak is sufficient for the final project is something we’ll work on together through the one to two sentence description, the outline, and peer review. You could also use exercises from Burrfisher et al., an updated book on teaching CGEs, or analyze one of the climate IAMs we discussed, like the DICE 2016 model or others in the MINIE framework. You could replicate a paper or define your own policy option, such as changing the carbon tax rate.

Another option is an Invest analysis, but for a different country or ecosystem service. That would involve identifying or creating alternate land use/land cover maps. We’ve only used the base data included with Invest (the Willamette Basin), but you could use your own region. We’ll discuss how to create new land use/land cover maps in a later hands-on session.

Whatever you choose, you’ll write up your results in a short report (2–5 pages) and a slide deck to present on the last day of class. Each intermediate step will count for a smaller percentage of the grade, but most of it will be on the final. You won’t be graded on how polished your paper is—I’m more interested in your research ideas. The goal is for this to be something you could use as a paper in another project, a second-year paper, or even a dissertation chapter.

If you have another idea, as long as it’s related to linking earth and economic models, that’s fine. The only thing I might hesitate on is a standard statistical regression, since that’s not the focus of this course. But if you couple it to DICE or another model to generate the social cost of carbon, that’s a good idea. The main point is to emphasize linkage, not just regression.

The final project timeline is flexible—it’s there to keep you moving, but we can discuss as we go.

Any questions?

Now, let’s move on to RunGTAP. Did you get RunGTAP installed? We’re a little short on PCs this year, and the software only works on PCs.

Any last questions about the end of the semester or the plan going forward? I’ll have a grade update soon, but everyone is doing well. This is a hands-on class, and most people do well.

Let’s start with a simple but seminal model of the global economy. For details, see Hurdle et al. 1997, the GTAP book, specifically Chapter 2. The figure should look familiar: private household, regional household, government, and savings, with linkages to producers. The production process depends not just on endowments from households but also on intermediate production from other parts of the economy.

Chapter 2 describes the structure of the simplest model—a one-region model with no trade linkage. In the fuller model, there would be links to other markets via import and export. Here, there is no trade, no taxes, and no depreciation on capital. Expenditures by the household at the aggregate level are chosen first, then allocated to private household, savings, and government expenditure.

The benefit of having a regional household is that, without it, it would be impossible to track utility if, for example, private expenditure goes down but government expenditure goes up. This abstraction allows us to track what happens when some parts go up and others go down. In reality, this mostly matters for country-by-country calibration.

This is the simplest circular flow: a one-region, closed economy without government intervention. When we define each element, we can have multiple producers, and we’ll eventually build up to a three-producer by three-country setup.

Without separating the regional household, you couldn’t track changes in utility. For example, private consumption might go down because government consumption goes up, such as during a war. Government expenditures eventually get consumed, but not through private decision-making.

This is a huge simplification for learning purposes. The choice of government expenditure is not really endogenous—it’s calibrated by looking at what countries in the GTAP database have for different tax rates. It’s a construct to set that exogenously, but you could endogenize it, which would be an interesting research question.

Now, let’s add something to the model. We’re working toward a 3x3 economy with three countries. Adding something to a model like this means solving for prices with more equations and constraints. When you solve even the simplest one-good, capital-labor model, you define first-order conditions and optimize utility subject to production. You’re figuring out the prices that make markets clear. Adding a new market means a new set of prices.

The diagram labels variables like VIFA (value of producer’s intermediate goods going to foreign countries at asset prices). We’ll define a system of equations, and all these variable names help manage this. For example, VOA is the value paid to agents for the endowment they use—firms buy endowments of capital and labor as inputs to production. VOA is a vector of prices, and when multiplied by the allocation of goods, gives total values flowing from producers to individuals for labor and capital.

Other variables have real-world interpretations, like VIFA (value of intermediate goods exported). For example, metal mined in Chile and exported to the US would be measured by the VIFA of Chile to the US for aluminum.

Now we’ve added trade, but governments also exist. Governments are a significant part of the economy—20% or more in many countries. Ignoring government doesn’t work when connecting to actual data. In CGE modeling, we must account for government spending, and the GTAP database collects data on this.

If the government spends, we need to explain it in general equilibrium terms. In general equilibrium, nothing can be undescribed. If government spends 35% of the value in the economy, it must raise money through taxes. Otherwise, the government would be spending unmodeled money, which isn’t general equilibrium.

So, in general equilibrium, nothing is free. Government expenditure must have a tax source. We can model this by modifying the supply and demand structure to include a tax wedge. This changes the equilibrium price and quantity, tracked by the CGE. We’ll keep track of the price paid by the consumer and the supplier, with the difference being the tax.

We specify the tax as a percentage of the existing amount, and this adds a new equation to the optimization. The tau parameter is specific to each commodity and region.

Now, let’s apply this at the applied level using RunGTAP. In the GTAP book, the 3x3 aggregation includes the US, EU, and rest of world. Aggregating the economy to a smaller number of regions is a critical step in the GTAP process. Most analyses don’t run on the full database of 160 countries and 65 sectors, but aggregate to something smaller, like 3x3, for computational feasibility. As computational power increases, more analyses keep all the specificity.

For our sectors, we’ll aggregate to food and agricultural products, manufacturing and mining, and services. The question we’ll use RunGTAP to answer is: What if there was a 10% cut in the ad valorem equivalent tariff on US food exports to the EU? What would be the value of that trade liberalization? This is a real policy question.

We’ll refer to the GTAP book, page 65. The point of running a model like this is to apply a change—a “shock”—such as a 10% reduction in the tariff, and compare the baseline economy to the shocked economy. The difference is what we care about. For example, a reduction in EU import tariffs led to the market price of food in the US increasing by 14%. Lower tariffs increase EU demand, making food scarcer in the US and raising prices.

This type of model is used to analyze the effects of tariff changes on the economy. The results matched observed data well, making the approach influential in trade analysis.

Now, let’s jump into RunGTAP. In RunGTAP, load the version called “A Coors 3x3.” The regions should be USA, EU, and rest of world. Under the versions menu, select the modules you want to run. The main model is the GTAP model, but there are other modules as well. You can choose which parts of the code to run, but we’ll keep the defaults.

Next, go to the Solve tab and click on Load Experiment. Experiment 1A is a 10% cut in the tariff on US foods exported to the EU. Double-click that to load it. The solution method is Johansen One Step, which is fast and works well.

Before running the model, let’s explore the data. RunGTAP includes the data in the application. Under View > Base Data, load the core data. The interface shows all the HAR files (Header Array Files), an old but optimized data storage type. The first page lists all the variables and headers. For example, VIFA comes from the circular flow diagram.

Clicking on a variable shows its dimensions. Some variables are one-dimensional (like the savings rate for three countries), others are two-dimensional (like government domestic purchases of tradable commodities by region), and some are three-dimensional or higher. For three-dimensional data, you can only view two dimensions at a time, either by summing over one dimension or selecting a specific value.

ViewHAR is useful for navigating n-dimensional data, which is challenging to work with otherwise. In econometrics, many subscripts on variables are the equivalent of these multiple dimensions.

The GTAP database is useful even outside CGEs. For example, you can find the export of US food to the EU. This data can be used for other research, such as estimating the contribution of nature to agricultural production.

Other notational elements: agent versus market prices. VDFA is value of domestic firm purchases at agent prices; VDFM is at market prices. The difference is the tax amount charged on top of the market price. The market price is what you’d get without the tax, but agents pay both the market price and the tax. This generates government revenue, which is used for purchases.

F, G, and P denote firms, government, and private households, respectively. For example, VDGA is value of domestic government purchases at agent prices. Other variables include VKB (value of capital stock, bilateral exports at market prices) and EVOA (endowment value used in output at agent prices).

Parameters, such as elasticities, are also available in RunGTAP under View > Parameters. For example, ESBM is the elasticity of substitution for imports in Armington’s structure. Armington assumptions allow for preferences for goods from different countries.

Most of your time in big data contexts is spent understanding the output, not generating it. In GTAP, you can view output in various ways. For example, GDP_EXP shows GDP broken down into its constituent expenditure parts (C + I + G + X - M) for each country.

The GTAP database also collects data on policies, such as tax rates and import bans, which are regularized and included in the database.

The model uses a cost function, where producers minimize total cost (sum of P times X, where X are inputs) subject to output constraints. The functional form is CES (constant elasticity of substitution), iterated over sectors and regions. The CES functions can get very long with many substitution opportunities.

The equations are defined in the .tab files, which you can view in TabMate (an IDE for the Tableau language). The code defines sets, coefficients, and modules, with formulas for variables like VDMIR (value of domestic imports). The domain over which each equation operates is specified, such as all traded commodities and regions.

The closure is important—it defines which variables are exogenous and which are endogenous, ensuring the number of equations matches the number of unknowns. For example, total factor productivity (TFP) is exogenous here, but you could swap it with GDP if desired.

With all that set up, click Solve. The model will run, writing files for all the solution variables. Most of the work comes in unpacking the results. The macros file reports pre- and post-shock values and percentage changes for various variables. For example, PG is the government consumption price for a commodity in a region. The equilibrium is expressed in terms of equilibrium prices, with changes shown as percentage increases or decreases from the base price.

This approach allows us to solve large-scale equilibrium problems that would be infeasible by hand. Modern computers make it possible to solve fully disaggregated models with many countries and sectors.

We’ll pick up where we left off next time and do more with this, but you should have enough to get started on the problem set. The first question is arithmetic, and the second involves RunGTAP analysis of a particular paper.

See you next time.