[R-SIG-Finance] where to obtain T-bill 3 month rate?
Thomas Steiner
finbref.2006 at gmail.com
Wed Nov 15 11:11:48 CET 2006
Michael,
> Is there a program in R that can automatically/streamingly pull stock and
> T-bill rate data from popular website?
I use the US-fed site to get US-data from there:
library(zoo)
usfedyields<-function(mat) {
##from: http://www.federalreserve.gov/releases/h15/data.htm
url<-paste("http://www.federalreserve.gov/releases/h15/data/Business_day/H15_TCMNOM_",mat,".txt",sep="")
raw<-read.csv(file=url,skip=7,colClasses=c("character","character"))
date<-as.Date(raw[,1],format="%m/%d/%Y")
yield<-as.numeric(raw[,2])
return(zoo(yield,date))
}
y3 <-usfedyields("M3")
A more theoretical question:
Do you use the 3-month rate as the short rate? I don't know what model
you use, but if you use vasicek, CIR, some parametric model (Svensson,
...) the 3 month rate will differ from the short rate by a well
defined quantity. How do you deal with this? What do others use as
short rate?
Just tell me more! I am curious on literature as well; I just now
http://ideas.repec.org/p/wpa/wuwpfi/9808004.html
Best,
Thomas
More information about the R-SIG-Finance
mailing list