Greenspan in 2014 pointed out that there was never a recovery from recession without improvements in housing construction. Here we examine some relevant data, including the Case-Shiller series, and derive an insightful measure of the housing economy which takes affordibility into account.
Dependencies:
- Linux, bash [not crucial, cross-platform prefered]
- Python: matplotlib, pandas [recommend Anaconda distribution]
- Modules: yi_1tools, yi_plot, yi_timeseries, yi_fred
CHANGE LOG
2015-02-10 Code review and revision.
2014-09-11 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: Wed Feb 11 16:44:59 PST 2015 :: IPython version: 2.3.0 :: pandas version: 0.15.0 :: Working directory (set as $workd): /home/yaya/Dropbox/ipy/fecon235/nb
from yi_1tools import *
from yi_fred import *
from yi_plot import *
from yi_timeseries import *
# in thousands of units
hs = getfred( m4housing )
plotfred(hs)
# population in thousands
pop = getfred( m4pop )
# Factor 100.00 converts operation to float and percentage terms
hspop = todf((hs * 100.00) / pop)
plotfred(hspop)
So at the peaks, about 1% of the US population got allocated new housing monthly. The lowest point shown is after the Great Recession at 0.2%.
Clearly there's a downward historical trend, so to discern short-term housing cycles, we detrend and normalize hspop.
plotfred( detrendnorm( hspop ) )
:: regresstime slope = -0.000740096689954
Surprisingly, housing starts per capita during the Great Recession did not exceed two standard deviations on the downside.
2015-02-10: It appears that housing starts has recovered relatively and is back to fairly average historical levels.
In the concluding section, we shall derive another measure of housing activity which takes affordibility into account.
The correlation between Case-Shiller, 20-city vs 10-city, is practically 1. Thus a mash-up is warranted to get data extended back to 1987. Case-Shiller is not dollar denominated (but rather a chain of changes) so we use the median sales prices from 2000 to mid-2014 released by the National Association of Realtors to estimate home price, see function gethomepx for explicit details.
homepx = getfred(m4homepx)
:: Case-Shiller prepend successfully goes back to 1987.
# Case-Shiller is seasonally adjusted
plotfred(homepx)
# Geometric rate of return:
georet(homepx, 12)
[3.62, 3.65, 2.55, 12]
defl = getfred(m4defl)
# Real here means in current dollars:
homepxr = todf( homepx * defl )
plotfred(homepxr)
# Real geometric return:
georet(homepxr, 12)
[1.21, 1.24, 2.57, 12]
Note that the above does not account for annual property taxes which does eat up a large portion of real price appreciation.
Perhaps home prices are only increasing because new stock of housing has been declining over the long-term.
The years 1997-2006 is considered a housing bubble due to the widespread availability of subprime mortgages (cf. NINJA, No Income No Job Applicant, was often not rejected.) Median home prices doubled in real terms: from $140,000 to $280,000.
Great Recession took down home prices (180-280)/280 = -36% in real terms.
2015-02-10: we are roughly at 200/280 = 71% of peak home price in real terms.
For a sketch, we assume a fixed premium for 30-y mortgages over 10-y Treasuries. We then compute the number of hours needed to pay only the interest on the full home price (i.e. no down payment assumed).
The sketch does not strive for exact precision, but serves as an indicator to model the housing economy.
mortpremium = 1.50
mortgage = todf( getfred(m4bond10) + mortpremium )
# Yearly interest to be paid off:
interest = todf( homepx * (mortgage / 100.00) )
# Wage is in dollars per hour
wage = getfred(m4wage)
# Working hours to pay off just the interest:
interesthours = todf( interest / wage )
# Mortgage interest to be paid as portion of annual income:
payhome = todf( interesthours / 2000.00 )
# We ignore tiny portion of mortgage payment made towards reducing principal.
plotfred( payhome )
If we assume 2000 hours worked per year (40 hours for 50 weeks), we can see that interest payment can potentially take up to 50% of total annual pre-tax income.
2015-02-10: Currently that figure is about 20% so housing should be affordable, but the population is uncertain about the risk on taking on debt. (What if I become unemployed?)
Prospects of deflation adds to the fear of such risk. Debt is best taken on in inflationary environments.
# Forecast payhome for the next 12 months:
holtfred( payhome, 12 )
Forecast 0 0.190100 1 0.194167 2 0.191988 3 0.189809 4 0.187630 5 0.185451 6 0.183272 7 0.181093 8 0.178914 9 0.176735 10 0.174556 11 0.172376 12 0.170197
2015-02-10: Homes should be slightly more affordable: 17% of annual income -- perhaps due to further declining interest rates, or even some increase in wages for the typical American worker.
Caution: although the numbers may indicate increased affordability, it has become far more difficult to obtain mortgage financing due to strict credit requirements. The pendulum of scrutiny from the NINJA days of the subprime era has swung to the opposite extreme. Subprime mortgages were the root cause of the Great Recession.
The basic idea is that housing starts should be more abundant when homes are more affordable. Recall that the proxy for afforability is our variable payhome which was constructed as a function of home price, interest rate, and wage income.
# hspop can be interpreted as the percentage of the population allocated new housing.
# Let's weight hspop by payhome to score housing starts:
hscore = todf( hspop * payhome )
plotfred( hscore )
The mean of hscore is approximately 0.17, and we observe a stable band between 0.15 and 0.20 from 1991 to 2004. That band can be interpreted as an equilibrium region for the housing economy (before the Housing Bubble and Great Recession). It's also worth noting that long-term interest rates during that epoch was determined by the market -- yet untouched by the massive quantitative easing programs initiated by the Federal Reserve.
# Let's normalize to dimensionless unit:
hscoren = normalize( hscore )
plotfred( hscoren )
During the Housing Bubble our hscore reaches $ +2.0 \sigma $.
Great Recession: There is evidence recently that families shifted to home rentals, avoiding home ownership which would entail taking on mortgage debt. Some home owners experienced negative equity. And when the debt could not be paid due to wage loss, it seemed reasonable to walk away from their homes, even if that meant damage to their credit worthiness. Housing construction had to compete with a large supply of foreclosed homes on the market.
2015-02-11: hscore is currently $ -1.29 \sigma $ which suggests that housing starts weighted by affordability has still not truly recovered from the Great Recession.
# Forecast for hscoren, 12-months ahead:
holtfred( hscoren, 12 )
Forecast 0 -1.287390 1 -1.261343 2 -1.262910 3 -1.264478 4 -1.266046 5 -1.267613 6 -1.269181 7 -1.270749 8 -1.272316 9 -1.273884 10 -1.275451 11 -1.277019 12 -1.278587