[R-SIG-Finance] where to obtain T-bill 3 month rate?

Gabor Grothendieck ggrothendieck at gmail.com
Wed Nov 15 13:30:22 CET 2006


You could also use read.zoo.   With the same url as in the function below:

   read.zoo(url, skip = 7, header = TRUE, sep = ",", format = "%m/%d/%Y")


On 11/15/06, Thomas Steiner <finbref.2006 at gmail.com> wrote:
> 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
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>



More information about the R-SIG-Finance mailing list