We examine the value of USD against a basket of 26 foreign currencies using real trade numbers. Trade statistics are released annually, however, the Fed uses international inflation data to adjust the weights monthly.
Dependencies: - Linux, bash - Python: matplotlib, pandas - Modules: yi_1tools, yi_fred, yi_plot, yi_timeseries
CHANGE LOG
2015-01-20 Code review.
2014-08-24 First version.
Reference: Mico Loretan, Federal Reserve Bulletin, Winter 2005, "Indexes of the Foreign Exchange Value of the Dollar", http://www.federalreserve.gov/pubs/bulletin/2005/winter05_index.pdf
# 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: Fri Jan 23 22:29:33 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 *
# USD in RTB terms:
usdrtb = getfred( m4usdrtb )
plotfred( usdrtb, 'm4 USDRTB' )
:: Finished: plotdf-m4_USDRTB.png
stats( usdrtb )
Y count 503.000000 mean 95.749771 std 9.473351 min 80.536000 25% 88.508500 50% 94.007000 75% 100.410000 max 128.437000 :: Index on min: Y 2011-07-01 dtype: datetime64[ns] :: Index on max: Y 1985-03-01 dtype: datetime64[ns] :: Head: Y T 1973-01-01 107.616 1973-02-01 103.046 1973-03-01 100.000 1973-04-01 100.376 1973-05-01 99.263 1973-06-01 97.483 1973-07-01 94.995 :: Tail: Y T 2014-05-01 84.993 2014-06-01 85.118 2014-07-01 84.848 2014-08-01 85.362 2014-09-01 86.582 2014-10-01 87.561 2014-11-01 89.007 :: Correlation matrix: Y Y 1
# Gold in RTB terms:
xaurtb = getfred( m4xaurtb )
plotfred( xaurtb, 'm4 XAURTB' )
:: Finished: plotdf-m4_XAURTB.png
# SP500 -- US equities in international RTB terms:
spxrtb = getfred( m4spxrtb )
plotfred( spxrtb )
:: S&P 500 prepend successfully goes back to 1957.
American equities see record high even in international terms.
georet(usdrtb, 12)
[-0.45, -0.36, 4.4, 12]
georet(xaurtb, 12)
[6.4, 7.93, 17.51, 12]
georet(spxrtb, 12)
[6.38, 7.21, 12.95, 12]
Going back to 1973, we expect USD to decline around 50 bp each year against a basket of 26 currencies.
For non-Americans, gold appears to equal US equities returns despite much higher volatility.
[We do not forecast here, because of the lag in data release.]