Skip to content

Instantly share code, notes, and snippets.

@mbusigin
Last active December 28, 2015 14:59
Show Gist options
  • Save mbusigin/7518442 to your computer and use it in GitHub Desktop.
Save mbusigin/7518442 to your computer and use it in GitHub Desktop.
Backing the value of interest back into the purchasing power of the USD over time.
a = -Delt(CPIAUCNS, k=12)*100
a = na.omit( a[endpoints(a, on="years")] )
a = cumprod( (1+(a/100)) )
 
b = M2OWN - Delt(CPIAUCNS, k=12)*100
b = na.omit( b[endpoints(b, on="years")] )
b = cumprod( (1+(b/100)) )
 
b2 = TB3MS - Delt(CPIAUCNS, k=12)*100
b2 = na.omit( b2[endpoints(b2, on="years")] )
b2 = cumprod( (1+(b2/100)) )
  
d = na.omit(merge(a, b, b2))
names(d) = c("Purchasing Power of a $", "Purchasing Power of a $ w/ Interest", "Purchasing Power of a $ invested in 3mo T-bills")
par(mar=c(3, 2, 1, 0.5))
plotRelativeReturn(d, legend.cex=0.75)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment