Users Guide to Economics 101 Diagram Generator. Introduction. How to Use the Program

Size: px
Start display at page:

Download "Users Guide to Economics 101 Diagram Generator. Introduction. How to Use the Program"

Transcription

1 Users Guide to Economics 101 Diagram Generator Hang Qian Iowa State University August 8, 2011 Introduction When I teach introductory and intermediate economics courses, I feel a need to generate fresh-made diagrams for lecture notes since the in-class examples I explain to students are not necessarily those shown in the textbook. Also, when I design the homework and exams, I hope that a computer can automatically generate solutions, since hand-solved problems might be error-ridden in computation. That motives me to write some software to perform these tasks, hence the Econ 101 Diagram Generator. I would like to shall this software to every instructor and student. How to Use the Program Econ 101 Diagram Generator is written in MATLAB codes. However, users are not assumed to have MATLAB knowledge to use the software, since an intuitive graphic interface is provided to run the program. First of all, make sure you have MATLAB installed on your computer. For full functionality, the symbolic, statistics and optimization toolbox is needed. However, for most codes the basic version of MATLAB suffices. Second, download the Econ 101 Diagram Generator from my website and unzip it to some folder on your computer. Third, for recent versions of MATLAB, you may double click the setup.m file, and then press F5 to run the program. If for some reason it does not work, you can first launch MATLAB and change the current folder, and then you can type setup in the command window to run the program. 1

2 Fourth, in the graphic interface users can designate functional forms and adjust the parameters. Then the program will generate corresponding graphs and display relevant solutions information on screen. If you run the program for the first time, you may accept the default settings and watch the demo graphs. Fifth, when the graphs are generated, you can adjust the title, axis, legend etc., or delete some lines, or adjust the scales by clicking an icon on the MATLAB graph tool bar (See below). Once you finish editing, save your graphs in selected format. 2

3 Sixth, MATLAB Command window displays relevant information of the model. Usually they are the numerical solutions to, say, consumer s problem or producer s problem. List of Contents 01 Utility Function Specify the domain. Choose the number of indifference curves on the graph. Generate a 3-D plot of utility function of two goods. Generate a 2-D plot of the indifference curves. 3

4 02 Consumer Problem Specify the prices and income. Choose the method: utility maximization or expenditure minimization. Generate a graph of indifference curves, budget line and optimal bundle. This program also provides two MATLAB functions to solve consumer s problem analytically using method of substitution and Lagrangian. However, this relies on the MATLAB symbolic toolbox, and not all the problems have analytic solutions. 03 Demand Function Specify the prices and income. Choose the method: allow price to change or income to change. Generate a graph of demand decomposition into income effect and substitution effect. Generate a graph of demand function as price changes continuously. Generate a graph of Marshallian and Hicksian demand. Report on the screen the numerical income and substitution effects. Report on the screen the numerical compensating variation, equivalent variance, consumer surplus. 04 Consumer Welfare This program includes 5 sub-programs: i). consumer surplus Designate a demand function. Specify the current price. Enter the number of grids to bound the consumer s willingness to pay. Generate a graph of lower sum of willingness to pay. 4

5 Generate a graph of upper sum of willingness to pay. Report on the screen the lower and upper bound of consumer surplus. ii) Cost of Living Adjust Specify prices changes and income. Report on the screen the numerical Hicksian compensation and COLA compensation. iii) Food Stamp Designate a utility function with two goods Specify prices, income and amount of stamps (coupons) Report on the screen the numerical compensating variation, equivalent variation and cash-out value of the coupon. iv) Price Subsidy Specify prices, income and amount of subsidies. Report on the screen the numerical compensating variation, equivalent variation and amount of lump-sum transfer. v) Quotas Specify prices, income and quotas (quantity limits). Report on the screen the numerical compensating variation, equivalent variation. 5

6 05 Production Designate a production function using labor and capital. Specify inputs prices, short-run capital amount, targeted output level. Generate a graph of short-run total product, marginal product and average product. Generate a graph of short-run total cost, marginal cost, average cost. Generate a graph of isoquants and conditional optimal inputs demand. Generate a graph of envelope of short-run and long-run total cost. Generate a graph of envelope of short-run and long-run average cost. Report on the screen the numerical solutions to the producer s problem. Report on the screen the numerical inputs demand in the short and long run. 06 Cost and Profit Designate a cost function. Designate a demand function (faced by an individual firm). Generate a graph of price, marginal revenue, marginal cost, average cost, average variable cost, as well as optimal output level. Report on the screen the feasible output set: to produce or not to produce. Report on the screen the optimal output: what amount to produce. 07 Nash Equilibrium This program has a graphic interface of playing a 2-player-2-strategy game, 2-player-3-strategy game, 3-player-2-strategy game. Specify the payoff matrix. Set the number of grids and tolerance level for numerical search. Report on the screen the dominant strategy (if any). Report on the screen the pure strategy Nash equilibrium (if any). Report on the screen the mix strategy Nash equilibrium (if any). This program also includes several MATLAB functions to find out pure strategy Nash equilibrium of 2-player-many-strategy games, 3-player-many-strategy games, and 4-player-many-strategy games. In addition, the program has attached a dozen of classic examples of game theory: Prisoner s dilemma, 6

7 Battle of sexes, Hawk and dove, Matching pennies, Rock paper and scissors, Bertrand, Cournot, First-price auction, Second-price auction, etc. 11 Trade PPF Designate two countries and two goods. Specify resources of the two countries and production costs of each good in each country. Specify the amount currently produced in autarky. Generate graphs of PPF in the autarky. Generate a graph of PPF after labor specification and trade. Report on the screen the absolute or comparative advantage, opportunity cost and trade plan. 12 Trade Surplus Designate a small country s domestic supply and demand of a certain good Specify the world price of that good. Set tariff on imported good. Generate a graph of consumer surplus and producer surplus in the closed economy. Generate a graph of consumer surplus and producer surplus in the open economy. Generate a graph of consumer surplus and producer surplus in the open economy with tariff. Report on the screen the consumer surplus and producer surplus and welfare changes. 13 Price Ceiling Designate the supply and demand curve of a certain good. Specify the price ceiling or floor imposed by the government. Generate a graph of consumer surplus and producer surplus in the market economy. Generate a graph of consumer surplus and producer surplus in the controlled economy. Report on the screen the consumer surplus and producer surplus and welfare changes. 7

8 14 Real GDP Specify the price and production of three representatives goods in three years. Set a base year. Report on the screen the nominal and real GDP, as well as GDP deflator. Report on the screen the GDP growth rate and inflation rate. 15 CPI Inflation This program contains two versions: basic and deluxe. Basic version: Designate the commodity basket in computing CPI. Specify the price of these goods in three years. Set a base year. Report on the screen the cost of the basket, CPI and inflation rate Deluxe version: Designate the commodity basket in computing CPI. Specify the price and productions of these goods in three years. Set a base year. Report on the screen the nominal and real GDP, as well as GDP deflator. Report on the screen the GDP growth rate and inflation rate. Report on the screen the cost of the basket, CPI and inflation rate 16 Money Creation Specify the initial money injection, required reserves ratio, excess reserves ratio, cash drain ratio, and number of commercial banks. Choose a scenario: either the Fed buys bonds from you and you deposit, or the Fed makes a loan directly to a commercial bank. 8

9 Report on the screen the money creation process in each round. Report on the screen total deposits, cash, money supply, reserves, loans, and money multiplier. Contact information Written by Hang Qian, Iowa State University Contact me: More econometrics routines and pedagogical economics software are available at 9