We examine government debt in real terms, and the current debt per capita.
Dependencies: - Linux, bash - Python: matplotlib, pandas - Modules: yi_1tools.py, yi_fred.py
CHANGE LOG
2015-01-16 Code review.
2014-08-16 First version.
# NOTEBOOK settings and system details: [00-tpl v14.09.28]
# Assume that the backend is LINUX (our particular distro is Ubuntu, running bash shell):
print '\n :: TIMESTAMP of last notebook execution:'
!date
print '\n :: IPython version:'
!ipython --version
# Automatically reload modified modules:
%load_ext autoreload
%autoreload 2
# 0 will disable autoreload.
# Generate plots inside notebook:
%matplotlib inline
# DISPLAY options
from IPython.display import Image
# e.g. Image(filename='holt-winters-equations.png', embed=True)
from IPython.display import YouTubeVideo
# e.g. YouTubeVideo('1j_HxD4iLn8')
from IPython.display import HTML # useful for snippets
# e.g. HTML('<iframe src=http://en.mobile.wikipedia.org/?useformat=mobile width=700 height=350></iframe>')
import pandas as pd
print '\n :: pandas version:'
print pd.__version__
# pandas DataFrames are represented as text by default; enable HTML representation:
# [Deprecated: pd.core.format.set_printoptions( notebook_repr_html=True ) ]
pd.set_option( 'display.notebook_repr_html', False )
# MATH display, use %%latex, rather than the following:
# from IPython.display import Math
# from IPython.display import Latex
print '\n :: Working directory (set as $workd):'
workd, = !pwd
print workd + '\n'
:: TIMESTAMP of last notebook execution: Sat Jan 17 12:42:01 PST 2015 :: IPython version: 2.3.0 The autoreload extension is already loaded. To reload it, use: %reload_ext autoreload :: pandas version: 0.15.0 :: Working directory (set as $workd): /home/yaya/Dropbox/ipy/fecon235/nb
# Some useful modules: [ ] - print out EOF for reference.
from yi_1tools import *
from yi_fred import *
from yi_plot import *
from yi_timeseries import *
# Federal debt monthly (resampled from original quarterly series):
debt = getfred( m4debt )
plotfred( debt )
# This series is denominated in millions of dollars,
# so we are looking at federal debt around
# 1.8 * 10^7 * 10^6 = $18 trillion circa 2014Q3.
# Deflator, which is monthly:
defl = getfred( m4defl )
# Real debt
rdebt = todf( defl * debt )
plotfred( rdebt )
# Population:
pop = getfred( m4pop )
# Real debt per capita
rdebtcap = todf( rdebt / pop )
plotfred( rdebtcap )
# shown in thousands of dollars
In current dollars, each American (including children and elders) incurred Federal debt of $10K before the 1980s. Then there is a steady climb to around $35K in 2008. Thereafter, it is seen rocketing (roughly doubling since 2002).
georet( rdebtcap[:'2002-01-01'], 12 )
[2.61, 2.63, 1.82, 12]
georet( rdebtcap['2002-01-01':], 12 )
[5.89, 5.91, 1.7, 12]
Through 2002, the geometric growth rate of real debt per capita was 2.6% Since 2002, that rate has increased to 5.9% per annum.
# This confirms the doubling over 12 years at the geometric rate of 5.9% per annum:
1.059 ** 12
1.98953471418589
# Most recent data:
tail( rdebtcap )
Y T 2014-01-01 56.043304 2014-02-01 55.993733 2014-03-01 55.901460 2014-04-01 55.778506 2014-05-01 55.805470 2014-06-01 55.867467 2014-07-01 55.980663
# Prorate to only workers:
56 / 0.62
90.3225806451613
Assuming 62% of the population are workers (see fred-gdp-wage.ipynb), i.e. source of tax revenue (excluding corporations), each worker carries approximately $90,000 of federal debt. That figure is roughly equivalent to two years of average wage income!