README.md

output: pdf_document

Build Status

Commercial Paper History

This R package usfrbcp provides functions for processing the US Federal Reserve Bank's commercial paper history data. The main function posts a query to the US Federal Reserve Bank's web site. By default the download includes commercial paper rates, volumes, and outstanding issue counts, variously in daily, weekly, or monthly frequency. The download data from the service is in compressed XML format. The query function transforms that data into a list of products. Several supporting functions then convert these lists by data type into smaller lists of data frames for convenient usage. The data frames can be used as-is or converted easily to a time series format such as xts.

The main function retrieves the commercial paper data history archive from the web service and extracts it into a collection of lists:

require(usfrbcp)
cp <- getCommercialPaper()
summary(cp)

We then decompose this into the products of interest, such as

rates <- getCommercialPaperRates(cp,"text")
summary(rates)

volumes <- getCommercialPaperVolumes(cp,"text")
summary(volumes)

The data frame might be converted to xts and plotted for example with lattice:

require(xts)
require(lattice)

df <- mergeSeries(rates)
xt = xts(df,order.by=as.Date(rownames(df)))
xyplot.ts(xt,scales=list(y=list(relation="same")),ylab="Rate (%)")

ploti

xyplot.ts(xt,superpose=TRUE,auto.key=list(columns=4),ylab="Yield (%)")

plotg

One might also plot data from the volume series, which also contains dollar values:

volumes <- getCommercialPaperVolumes(cp,"text")
v = volumes[[35]]
xyplot.ts(na.omit(xts(v$df,order.by=as.Date(rownames(v$df)))),
          ylab=paste(v$unit,v$currency,v$unit_mult),
          panel=function(x,...){
            panel.xyplot(x,...)
            panel.grid(-1,0)
            panel.loess(x,col=2,...)},
          main=v$short_desc)

plotv

Using dplyr and tidyr we can easily create some ggplot2 graphics. Using the year-end series as an example:

require(ggplot2)
require(dplyr)
require(tidyr)
require(scales)

rv = getCommercialPaperYearend(cp,"text")
df <- mergeSeries(rv)
df <- df %>% 
      mutate(Date=as.Date(rownames(df))) %>% 
      gather(Product,Outstanding,starts_with("DT"))

# p <- ggplot(df,aes(x=Date,y=Outstanding,group=Product))
# p + geom_line(aes(colour=Product)) + scale_x_date()

p <- ggplot(df,aes(x=Date,y=Outstanding))
p + geom_line(aes(colour=Product)) +
    facet_wrap(~Product,ncol=2,scales="fixed") +
    scale_x_date(limits=c(as.Date("2010-1-1"),max(df$Date))) +
    theme(legend.position="none") +
    ggtitle("Commercial Paper Outstanding Year End")

plotv

Series Descriptions

RATES is data set with 24 Series:

  1. Overnight AA nonfinancial commercial paper rate
  2. 7-day AA nonfinancial commercial paper rate
  3. 15-day AA nonfinancial commercial paper rate
  4. 30-day AA nonfinancial commercial paper rate
  5. 60-day AA nonfinancial commercial paper rate
  6. 90-day AA nonfinancial commercial paper rate
  7. Overnight A2/P2 nonfinancial commercial paper rate
  8. 7-day A2/P2 nonfinancial commercial paper rate
  9. 15-day A2/P2 nonfinancial commercial paper rate
  10. 30-day A2/P2 nonfinancial commercial paper rate
  11. 60-day A2/P2 nonfinancial commercial paper rate
  12. 90-day A2/P2 nonfinancial rate
  13. Overnight AA financial commercial paper rate
  14. 7-day AA financial commercial paper rate
  15. 15-day AA financial commercial paper rate
  16. 30-day AA financial commercial paper rate
  17. 60-day AA financial commercial paper rate
  18. 90-day AA financial commercial paper rate
  19. Overnight AA asset-backed commercial paper rate
  20. 7-day AA asset-backed commercial paper rate
  21. 15-day AA asset-backed commercial paper rate
  22. 30-day AA asset-backed commercial paper rate
  23. 60-day AA asset-backed commercial paper rate
  24. 90-day AA asset-backed commercial paper rate

VOL is data set with 60 Series

  1. Amount of AA nonfinancial commercial paper maturing in 1-4 days
  2. Amount of A2/P2 nonfinancial commercial paper maturing in 1-4 days
  3. Amount of AA financial commercial paper maturing in 1-4 days
  4. Amount of AA asset-backed commercial paper maturing in 1-4 days
  5. Amount of commercial paper maturing in 1-4 days
  6. Number of issues of AA nonfinancial commercial paper maturing in 1-4 days
  7. Number of issues of A2/P2 nonfinancial commercial paper maturing in 1-4 days
  8. Number of issues of AA financial commercial paper maturing in 1-4 days
  9. Number of issues of AA asset-backed commercial paper maturing in 1-4 days
  10. Number of issues of commercial paper maturing in 1-4 days
  11. Amount of AA nonfinancial commercial paper maturing in 5-9 days
  12. Amount of A2/P2 nonfinancial commercial paper maturing in 5-9 days
  13. Amount of AA financial commercial paper maturing in 5-9 days
  14. Amount of AA asset-backed commercial paper maturing in 5-9 days
  15. Amount of commercial paper maturing in 5-9 days
  16. Number of issues of AA nonfinancial commercial paper maturing in 5-9 days
  17. Number of issues of A2/P2 nonfinancial commercial paper maturing in 5-9 days
  18. Number of issues of AA financial commercial paper maturing in 5-9 days
  19. Number of issues of AA asset-backed commercial paper maturing in 5-9 days
  20. Number of issues of commercial paper maturing in 5-9 days
  21. Amount of AA nonfinancial commercial paper maturing in 10-20 days
  22. Amount of A2/P2 nonfinancial commercial paper maturing in 10-20 days
  23. Amount of AA financial commercial paper maturing in 10-20 days
  24. Amount of AA asset-backed commercial paper maturing in 10-20 days
  25. Amount of commercial paper maturing in 10-20 days
  26. Number of issues of AA nonfinancial commercial paper maturing in 10-20 days
  27. Number of issues of A2/P2 nonfinancial commercial paper maturing in 10-20 days
  28. Number of issues of AA financial commercial paper maturing in 10-20 days
  29. Number of issues of AA asset-backed commercial paper maturing in 10-20 days
  30. Number of issues of commercial paper maturing in 10-20 days
  31. Amount of AA nonfinancial commercial paper maturing in 21-40 days
  32. Amount of A2/P2 nonfinancial commercial paper maturing in 21-40 days
  33. Amount of AA financial commercial paper maturing in 21-40 days
  34. Amount of AA asset-backed commercial paper maturing in 21-40 days
  35. Amount of commercial paper maturing in 21-40 days
  36. Number of issues of AA nonfinancial commercial paper maturing in 21-40 days
  37. Number of issues of A2/P2 nonfinancial commercial paper maturing in 21-40 days
  38. Number of issues of AA financial commercial paper maturing in 21-40 days
  39. Number of issues of AA asset-backed commercial paper maturing in 21-40 days
  40. Number of issues of commercial paper maturing in 21-40 days
  41. Amount of AA nonfinancial commercial paper maturing in 41-80 days
  42. Amount of A2/P2 nonfinancial commercial paper maturing in 41-80 days
  43. Amount of AA financial commercial paper maturing in 41-80 days
  44. Amount of AA asset-backed commercial paper maturing in 41-80 days
  45. Amount of commercial paper maturing in 41-80 days
  46. Number of issues of AA nonfinancial commercial paper maturing in 41-80 days
  47. Number of issues of A2/P2 nonfinancial commercial paper maturing in 41-80 days
  48. Number of issues of AA financial commercial paper maturing in 41-80 days
  49. Number of issues of AA asset-backed commercial paper maturing in 41-80 days
  50. Number of issues of commercial paper maturing in 41-80 days
  51. Amount of AA nonfinancial commercial paper maturing in greater than 80 days
  52. Amount of A2/P2 nonfinancial commercial paper maturing in greater than 80 days
  53. Amount of AA financial commercial paper maturing in greater than 80 days
  54. Amount of AA asset-backed commercial paper maturing in greater than 80 days
  55. Amount of commercial paper maturing in greater than 80 days
  56. Number of issues of AA nonfinancial commercial paper maturing in greater than 80 days
  57. Number of issues of A2/P2 nonfinancial commercial paper maturing in greater than 80 days
  58. Number of issues of AA financial commercial paper maturing in greater than 80 days
  59. Number of issues of AA asset-backed commercial paper maturing in greater than 80 days
  60. Number of issues of commercial paper maturing in greater than 80 days

OUTST is data set with 77 Series

  1. Total commercial paper outstanding; seasonally adjusted
  2. Nonfinancial commercial paper outstanding; seasonally adjusted
  3. Nonfinancial domestic commercial paper outstanding; seasonally adjusted
  4. Nonfinancial foreign commercial paper outstanding; seasonally adjusted
  5. Nonfinancial other commercial paper outstanding; seasonally adjusted
  6. Financial commercial paper outstanding; seasonally adjusted
  7. Financial domestic commercial paper outstanding; seasonally adjusted
  8. Financial foreign commercial paper outstanding; seasonally adjusted
  9. Financial other commercial paper outstanding; seasonally adjusted
  10. Asset-backed commercial paper outstanding; seasonally adjusted
  11. Other commercial paper outstanding; seasonally adjusted
  12. Total commercial paper outstanding
  13. Nonfinancial commercial paper outstanding
  14. Nonfinancial domestic commercial paper outstanding
  15. Nonfinancial foreign commercial paper outstanding
  16. Nonfinancial other commercial paper outstanding
  17. Financial commercial paper outstanding
  18. Financial domestic commercial paper outstanding
  19. Financial domestic commercial paper outstanding, U.S. owned
  20. Financial domestic commercial paper outstanding, foreign bank parent
  21. Financial domestic commercial paper outstanding, foreign nonbank parent
  22. Financial domestic commercial paper outstanding, other
  23. Financial foreign commercial paper outstanding
  24. Financial foreign commercial paper outstanding, bank or bank holding company
  25. Financial foreign commercial paper outstanding, other
  26. Financial other commercial paper outstanding
  27. Asset-backed commercial paper outstanding
  28. Other commercial paper outstanding
  29. SEC rule 2a-7 tier-1 commercial paper outstanding
  30. SEC rule 2a-7 tier-2 commercial paper outstanding
  31. Dealer placed nonfinancial commercial paper outstanding
  32. Dealer placed financial commercial paper outstanding
  33. Dealer placed asset-backed commercial paper outstanding
  34. Dealer placed other commercial paper outstanding
  35. Directly placed nonfinancial commercial paper outstanding
  36. Directly placed financial commercial paper outstanding
  37. Directly placed asset-backed commercial paper outstanding
  38. Directly placed other commercial paper outstanding
  39. Total commercial paper outstanding; seasonally adjusted
  40. Nonfinancial commercial paper outstanding; seasonally adjusted
  41. Nonfinancial domestic commercial paper outstanding; seasonally adjusted
  42. Nonfinancial foreign commercial paper outstanding; seasonally adjusted
  43. Nonfinancial other commercial paper outstanding; seasonally adjusted
  44. Financial commercial paper outstanding; seasonally adjusted
  45. Financial domestic commercial paper outstanding; seasonally adjusted
  46. Financial foreign commercial paper outstanding; seasonally adjusted
  47. Financial other commercial paper outstanding; seasonally adjusted
  48. Asset-backed commercial paper outstanding; seasonally adjusted
  49. Other commercial paper outstanding; seasonally adjusted
  50. Total commercial paper outstanding
  51. Nonfinancial commercial paper outstanding
  52. Nonfinancial domestic commercial paper outstanding
  53. Nonfinancial foreign commercial paper outstanding
  54. Nonfinancial other commercial paper outstanding
  55. Financial commercial paper outstanding
  56. Financial domestic commercial paper outstanding
  57. Financial domestic commercial paper outstanding, U.S. owned
  58. Financial domestic commercial paper outstanding, foreign bank parent
  59. Financial domestic commercial paper outstanding, foreign nonbank parent
  60. Financial domestic commercial paper outstanding, other
  61. Financial foreign commercial paper outstanding
  62. Financial foreign commercial paper outstanding, bank or bank holding company
  63. Financial foreign commercial paper outstanding, other
  64. Financial other commercial paper outstanding
  65. Asset-backed commercial paper outstanding
  66. Other commercial paper outstanding
  67. L.O.C. (letter of credit)-backed commercial paper outstanding
  68. SEC rule 2a-7 tier-1 commercial paper outstanding
  69. SEC rule 2a-7 tier-2 commercial paper outstanding
  70. Dealer placed nonfinancial commercial paper outstanding
  71. Dealer placed financial commercial paper outstanding
  72. Dealer placed asset-backed commercial paper outstanding
  73. Dealer placed other commercial paper outstanding
  74. Directly placed nonfinancial commercial paper outstanding
  75. Directly placed financial commercial paper outstanding
  76. Directly placed asset-backed commercial paper outstanding
  77. Directly placed other commercial paper outstanding

OUTST_YREND is data set with 4 Series

  1. Total commercial paper outstanding, maturing after December 31
  2. SEC rule 2a-7 tier-1 commercial paper outstanding, maturing after December 31
  3. SEC rule 2a-7 tier-2 commercial paper outstanding, maturing after December 31
  4. Asset-backed commercial paper outstanding, maturing after December 31

OUTST_OLD is data set with 25 Series

  1. Total commercial paper outstanding; seasonally adjusted
  2. Nonfinancial commercial paper outstanding; seasonally adjusted
  3. Nonfinancial domestic commercial paper outstanding; seasonally adjusted
  4. Nonfinancial foreign commercial paper outstanding; seasonally adjusted
  5. Financial (including asset-backed) commercial paper outstanding; seasonally adjusted
  6. Financial (including asset-backed) domestic commercial paper outstanding; seasonally adjusted
  7. Financial (including asset-backed) foreign commercial paper outstanding; seasonally adjusted
  8. Total commercial paper outstanding
  9. Nonfinancial commercial paper outstanding
  10. Nonfinancial domestic commercial paper outstanding
  11. Nonfinancial foreign commercial paper outstanding
  12. Financial (including asset-backed) commercial paper outstanding
  13. Financial (including asset-backed) domestic commercial paper outstanding
  14. Financial (including asset-backed) domestic commercial paper outstanding, U.S. owned
  15. Financial (including asset-backed) domestic commercial paper outstanding, foreign bank parent
  16. Financial (including asset-backed) domestic commercial paper outstanding, foreign nonbank parent
  17. Financial (including asset-backed) foreign commercial paper outstanding
  18. Financial (including asset-backed) foreign commercial paper outstanding, bank or bank holding company
  19. Financial (including asset-backed) foreign commercial paper outstanding, other
  20. Asset-backed commercial paper outstanding
  21. L.O.C. (letter of credit)-backed commercial paper outstanding
  22. SEC rule 2a-7 tier-1 commercial paper outstanding
  23. SEC rule 2a-7 tier-2 commercial paper outstanding
  24. Directly placed nonfinancial commercial paper outstanding
  25. Directly placed financial commercial paper outstanding

RATES_OLD is data set with 12 Series

  1. Overnight directly placed financial commercial paper rate
  2. 7-day directly placed financial commercial paper rate
  3. 3 15-day directly placed financial commercial paper rate
  4. 4 30-day directly placed financial commercial paper rate
  5. 5 60-day directly placed financial commercial paper rate
  6. 6 90-day directly placed financial commercial paper rate
  7. 7 Overnight dealer placed AA commercial paper rate
  8. 7-day dealer placed AA commercial paper rate
  9. 15-day dealer placed AA commercial paper rate
  10. 30-day dealer placed AA commercial paper rate
  11. 60-day dealer placed AA commercial paper rate
  12. 90-day dealer placed AA commercial paper rate

References



mrbcuda/usfrbcp documentation built on May 23, 2019, 7:14 a.m.