Easy way to get yield curve : what you need is only "FRBData" package !
[This article was first published on My Life as a Mock Quant in English, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
I made FRBData package and registerd it on CRAN.Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
This package allow you to download financial data from FRB’s website.
This website provide many economical data such as consumer credit, money stock.
This article show you how to use this package.
(But, it has only a function about interest rate now. I will create other functions to download other macro-economical data in next version.)
(you may need to install the R which has version more than 2.12.)
Load library.
As an example, we download treasury and swap curve from 2005 to 2011.
these data are an xts object.
plot "10Y swap spread"
plot time-varying treasury term structure
If you would like to get other interest rate data, please check Reference manual.
I think that this package will provide you good chance of analyzing yield curve such as yield curve e arbitrage.
Enjoy !
(...and tell me interesting quant job in secret 🙂 )
To leave a comment for the author, please follow the link and comment on their blog: My Life as a Mock Quant in English.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.