#!/usr/bin/env python # coding: utf-8 # # Calculations and Exercises for: Long-Run Growth Theory: Sources # In[1]: get_ipython().run_cell_magic('javascript', '', '\nIPython.OutputArea.prototype._should_scroll = function(lines) {\n return false;}\n') # In[2]: # keep output cells from shifting to autoscroll: little scrolling # subwindows within the notebook are an annoyance... # In[3]: # set up the environment by reading in every library we might need: # os... graphics... data manipulation... time... math... statistics... import sys import os from urllib.request import urlretrieve import matplotlib as mpl import matplotlib.pyplot as plt from IPython.display import Image import pandas as pd from pandas import DataFrame, Series from datetime import datetime import scipy as sp import numpy as np import math import random import seaborn as sns import statsmodels import statsmodels.api as sm import statsmodels.formula.api as smf # report library versions... # In[4]: get_ipython().run_line_magic('matplotlib', 'inline') # put graphs into the notebook itself... # In[5]: # graphics setup: seaborn-whitegrid and figure size... plt.style.use('seaborn-whitegrid') figure_size = plt.rcParams["figure.figsize"] figure_size[0] = 12 figure_size[1] = 10 plt.rcParams["figure.figsize"] = figure_size # In[6]: # Calculations for: Long-Run Measured Economic Growth: # Sweden and Argentina, 1890-2017 # data previously downloaded # time series for measured real national product per capita for # Sweden and Argentina since 1890, plus source notes, accessible # in the argentina_sweden_dict object for later use, if needed... sourceURL = "http://delong.typepad.com/2017-08-11-argentina-and-sweden-gdp-per-capita-1890-2015-from-gapminder.org.csv" argentina_sweden_df = pd.read_csv(sourceURL, index_col = 0) argentina_sweden_dict = {} argentina_sweden_dict["df"] = argentina_sweden_df argentina_sweden_dict["sourceURL"] = sourceURL argentina_sweden_dict["sourceDescription"] = "Hans Rosling's Gapminder: http://gapminder.org" argentina_sweden_dict["sourceNotes"] = "From Gapminder World data page: http://www.gapminder.org/data/" argentina_sweden_dict["df"].plot() plt.ylim(0, ) plt.xlabel("Year", size = 15) plt.ylabel("Real GDP per Capita", size = 15) plt.title("Swedish and Argentinian Economic Growth since 1890", size = 30) ## Calculate the difference in growth multiples between Sweden and ## Argentina since 1890 # Sweden's measured growth multiple over 1890-2015: Sweden_multiple18902015 = argentina_sweden_df.Sweden[2015]/argentina_sweden_df.Sweden[1890] # Argentina's measured growth multiple over 1890-2015: Argentina_multiple18902015 = argentina_sweden_df.Argentina[2015]/argentina_sweden_df.Argentina[1890] print("Sweden's growth multiple over 1890-2015:", Sweden_multiple18902015) print("Argentinas growth multiple over 1890-2015:", Argentina_multiple18902015) # ---- # #   # #### Box 4.1.2: Gapminder: An Information Source: # # On the World Wide Web at: is _Gapminder_. It is, its mission statement says: # # >an independent Swedish foundation... a fact tank, not a think tank.... fight[ing] devastating misconceptions about global development. Gapminder produces free teaching resources making the world understandable based on reliable statistics. Gapminder promotes a fact-based worldview everyone can understand... # # and Gapminder exists because: # # >We humans are born with a craving for... drama. We pay attention to dramatic stories and we get bored if nothing happens. Journalists and lobbyists tell dramatic stories... about extraordinary events and unusual people. The piles of dramatic stories pile up in people’s minds into an overdramatic worldview and strong negative stress feelings: “The world is getting worse!”, “It’s we vs. them!” , “Other people are strange!”, “The population just keeps growing!” and “Nobody cares!” For the first time in human history reliable statistics exist. There’s data for almost every aspect of global development. The data shows a very different picture: a world where most things improve.... [where] decisions [are] based on universal human needs... easy to understand.... # # >Fast population growth will soon be over. The total number of children in the world has stopped growing.... We live in a globalized world, not only in terms of trade and migration. More people than ever care about global development! The world has never been less bad. Which doesn’t mean it’s perfect. The world is far from perfect. # # >The dramatic worldview has to be dismantled, because it is stressful... wrong.... leads to bad focus and bad decisions. We know this because we have measured the global ignorance... [of] top decision makers... journalists, activists, teachers and the general public. This has nothing to do with intelligence. It’s a problem of factual knowledge. Facts don’t come naturally. Drama and opinions do. Factual knowledge has to be learned. We need to teach global facts in schools and in corporate training. This is an exciting problem to work on and we invite all our users to join the Gapminder movement for global factfulness. The problem can be solved, because the data exists... # # Do not be globally ignorant! Explore—and use—Gapminder! And watch Ola and Hans Rosling's "How Not to Be Ignorant about the World" talk at: # # ---- # #   # ## 4.1.6 EXERCISES: Sources of Long-Run Growth # # **Task 1: Using information sources**: # # 1. Websurf your way over to https://gapminder.org/tools # 2. Choose a non-U.S. country of interest to you. Select it and the U.S. by clicking on the checkboxes in the country list that should be visible. # 3. Pull the slider to the right of the "play" button all the way back to the left. # 4. Press the "play" button and watch the two countries—the one you selected, and the U.S.—make tracks over the past. # 5. Take a screenshot of the resulting figure when the animation has finished. # 6. Upload that screenshot to a URL somewhere on the net. # 7. Display that screenshot in the markdown cell below using an <img src="" /> tag # 8. Write a paragraph: What do you learn about economic growth roughly since the Industrial Revolution from the figure you have screenshotted? # # ---- # #   # PASTE IMG TAG HERE: ___ # # WHAT DID YOU LEARN? ANSWER: ___ # # ---- # #   # **Task 2: Reversals of Fortune**: # # This problem requires you to edit the second Python code cell below. The first cell downloads data and plots Argentinean and Swedish levels of GDP per capita since 1890. Run this first cell. There is no need to change it. Then... # In[ ]: # time series for measured real national product per capita for # Sweden and Argentina since 1890, plus source notes, accessible # in the argentina_sweden_dict object for later use, if needed... import matplotlib as mpl import matplotlib.pyplot as plt from IPython.display import Image import pandas as pd sourceURL = "http://delong.typepad.com/2017-08-11-argentina-and-sweden-gdp-per-capita-1890-2015-from-gapminder.org.csv" argentina_sweden_df = pd.read_csv(sourceURL, index_col = 0) argentina_sweden_dict = {} argentina_sweden_dict["df"] = argentina_sweden_df argentina_sweden_dict["sourceURL"] = sourceURL argentina_sweden_dict["sourceDescription"] = "Hans Rosling's Gapminder: http://gapminder.org" argentina_sweden_dict["sourceNotes"] = "From Gapminder World data page: http://www.gapminder.org/data/" argentina_sweden_dict["df"].plot() plt.ylim(0, ) plt.xlabel("Year", size = 15) plt.ylabel("Real GDP per Capita", size = 15) plt.title("Swedish and Argentinian Economic Growth since 1890", size = 30) # Then... # 2.1: Calculate the year that Sweden surpasses Argentina in GDP per capita. Write code to set the variable Sweden_surpasses equal to that year in the code cell below: # In[ ]: Sweden_surpasses = 1931 # 2.2: Calculate the growth rates of Swedish and Argentinean GDP per capita, and their difference, over the periods 1890-1914, 1914-1946, 1946-1980, and 1980-2002. Write code to set the appropriate variables equal to the values in the code cell below: # In[ ]: Swedish_Growth18901914 = ___ Swedish_Growth19141946 = ___ Swedish_Growth19461980 = ___ Swedish_Growth19802002 = ___ Argentinean_Growth18901914 = ___ Argentinean_Growth19141946 = ___ Argentinean_Growth19461980 = ___ Argentinean_Growth19802002 = ___ Difference_Growth18901914 = ___ Difference_Growth19141946 = ___ Difference_Growth19461980 = ___ Difference_Growth19802002 = ___ # 2.3: Calculate the multiple that Swedish GDP per capita in 2015 is of its level in 1890, the multiple that Argentinean GDP per capita in 2015 is of its level in 1890, and the multiple that the quotient is. Write code to set the appropriate variables equal to the values in the code cell below: # In[ ]: Sweden_multiple18902015 = ___ Argentina_multiple18902015 = ___ Quotient_multiple18902015 = ___ # ## Catch Our Breath # # # # * Ask me two questions… # * Make two comments… # * Further reading… # #
# # ---- # # Calculations and Exercises for: Long-Run Economic Groswth Theory—Sources: # Lecture Support: <> # #   # # ---- # # 4.1 Sources of Long-Run Economic Growth # # ### Solow Growth Model: Preliminaries # # * The Eagle's Eye View # * Divergences # * Differences in the efficiency of labor # * Differences in capital intensity # * Aim to understand why some countries… # * …are growing rapidly and others are not # * …are rich and others are not # * …under conditions of industrial civilization # #   # # ### Some Facts: Looking Across Countries # # Gapminder U S Mexican Nigerian and Afghan GDP per Capita and Life Expectancy since 1870 # # * U.S. today: # * 3x richer than Mexico # * 9x richer than Nigeria # * 20x richer than Afghanistan # * PPP or RER? # * Afghans back at where U.S. was 200 years ago # * Differences between Afghanistan and U.S. then much smaller than now # * In spite of improved communications, transport, etc… # #   # # ### Some Facts: Looking Over Time # # 4 2 Gapminder U S GDP per Capita and Life Expectancy since 1870 https tinyurl com dl20180122a # # * 15x in productivity since 1870 # * And this might be an underestimate # * Doubling of life expectancy since 1870 # * Where do you think the 1919 “Spanish Influenza” epidemic is? # * Divide $4000 by 13 and you are at a dollar a day # * Anything less, and you are starving to death # #   # # ### What Is the Pace of Growth? # # 4 2 Gapminder U S GDP per Capita and Life Expectancy since 1870 https tinyurl com dl20180122a # # * 60000 today # * 4000 150 years ago # * What’s the growth rate? # # 1. 2.8%/year # 2. 1.8%/year # 3. 0.8%/year # 4. 5.6%/year # 5. None of the above # #   # # ### Reversals of Fortune # # 2017 08 11 DeLong and Olney Macroeconomics 3rd Edition # # * Sweden was about like Norway back in 1870 # * A “s—-hole country” # * Swedes (and Norwegians) left in droves for the New World # * By contrast, Argentina back in 1870 looked like it had it made # * Reversals of fortune # #   # # ### The Structure of an Economic Model # # * **Variables**: economic quantities of interest that we can calculate and measure. # * **Behavioral relationships**: relationships that (1) describe how humans, making economic decisions given their opportunities and opportunity costs, decide what to do, and (2) that thus determine the values of the economic variables. # * **Equilibrium conditions**: conditions that tell us when the economy is in a position of balance, when some subset of the variables are "stable"—that is, are either constant are changing in simple and predictable ways. # #   # # ### The Structure of the Solow Growth Model # # * Production function: # * A 1% increase in the efficiency of labor E increases production Y by 1-α% # * A 1% increase in the capital-labor ratio K/L increases production per worker Y/L by α% # * Why these rules of thumb? # * They force us to: $ \frac{Y}{L} = \left(\frac{K}{L}\right)^α(E)^{(1-α)} $ # * Capital accumulation equation: dK/dt = sY - δK # * Labor force growth: dL/dt = nL # * Efficiency of labor (technology and organization) growth: dE/dt = gE # #   # ### Production Function II # # Alternative functional forms: # # > $ \frac{Y}{L} = \left(\frac{K}{L}\right)^α(E)^{(1-α)} $ # # > $ \ln\left(\frac{Y}{L}\right) = α\ln\left(\frac{K}{L}\right) + (1-α)\ln(E) $ # # > $ \frac{Y}{L} = \left(\frac{K}{Y}\right)^\left(\frac{α}{1-α}\right)(E) $ # # > $ \ln\left(\frac{Y}{L}\right) = \left(\frac{α}{1-α}\right)\ln\left(\frac{K}{L}\right) + \ln(E) $ # # > $ \frac{d\left(\ln\left(\frac{Y}{L}\right)\right)}{dt} = α \frac{d\left(\ln\left(\frac{K}{L}\right)\right)}{dt} + (1-α)\frac{d\left(\ln\left(E\right)\right)}{dt} $ # # > $ \frac{d\left(\ln\left(\frac{Y}{L}\right)\right)}{dt} = α \frac{d\left(\ln\left(K\right)\right)}{dt} - α \frac{d\left(\ln\left(L\right)\right)}{dt} + (1-α)\frac{d\left(\ln\left(E\right)\right)}{dt} $ # # > $ \frac{d\left(\ln\left(\frac{Y}{L}\right)\right)}{dt} = \left(\frac{α}{1-α}\right) \frac{d\left(\ln\left(\frac{K}{Y}\right)\right)}{dt} + \frac{d\left(\ln\left(E\right)\right)}{dt} $ # # We will use whatever is most convenient for the task at hand at the moment... # #   # # ### Simplest Possible Accumulation Equations # # > $ \frac{dK}{dt} = sY - {\delta}K $ :: capital accumulation # # > $ \frac{dL}{dt} = nL $ :: labor force growth # # > $ \frac{dE}{dt} = gE $ :: efficiency-of-labor growth # #   # # > $ \frac{d}{dt}{\ln}(K) = s\left(\frac{Y}{K}\right) - {\delta} $ :: capital accumulation # # > $ \frac{d}{dt}{\ln}(L) = n $ :: labor force growth # # > $ \frac{d}{dt}{\ln}(E) = g $ :: efficiency-of-labor growth # #   # # ### How Does a System Like This Behave Over Time? # # * Let’s start it up and see… # * # ## Catch Our Breath # # # # * Ask me two questions… # * Make two comments… # * Further reading… # #
# # ---- # # Sources of Long-Term Growth: # Lecture Support: # #   # # ---- # ---- # #