build_rates
in creditr
package to
calculate the CDS pricing. It covers three currencies: USD, EUR, and JPY. The
interest rates date from 2004-01-01 to 2014-08-23. Rates on holidays and
weekends are available as well as business days.
USD
EUR
JPY
1M
2M
3M
6M
9M
1Y
2Y
3Y
4Y
5Y
6Y
7Y
8Y
9Y
10Y
12Y
15Y
20Y
30Y
rates.RData
is from
https://www.markit.com/ and
http://research.stlouisfed.org/fred2/. When a user is calculating CDS
using the CDS
package, the package calls get_rates
to get the
needed interest rates; get_rates
then calls the rates.RData
for these interest rates. If a date is unavailable in rates.RData
,
then the package calls other functions to get the needed interest rates
from the internet. The rates.RData
is created and stored in the
package for the users' convenience: getting interest rates from the
Internet may fail due to the internet connection problem and may be very
slow. Also, the user can build its own updated local rates.RData
by
using build_rates
. For more explanation on the usage of
build_rates
, please see See Also. Also, please notice that in the rates.RData
, the rate
is not
the interest rate on the date
listed in the same row as the
rate
. For example, in the first row, the rate
is 0.001550;
the date
in that row is 2014-08-21. But this does not mean that on
2014-08-21, the interest rate is 0.001550; instead, 0.001550 is the
interest rate on 2014-08-20. This regulation of using the interest rate on
the previous business day of CDS trading date is set by ISDA Standard
Model. The Model says that, if a trader buy a CDS on 2014-08-21, then when
calculating the pricing of the CDS, she should use the interest rate of
2014-08-20, which is 0.001550. This may be confusing for people who are yet
unfamiliar with CDS. We design rates.RData
in this way because it is
easier for other functions in the CDS
package to use this data frame
for calculation.
rates.RData
covers holidays, weekend and business days. As is set by
ISDA Standard Model and introduced above, we use the previous business
day's interest rate for CDS pricing on a certain trading date. Therefore,
if the user is buying a CDS on Saturday, she should use the interest rate
of last Friday; if she is buying a CDS on Sunday or Monday, she should
still use the interest rate of last Friday, because last Friday is the
previous business day of the CDS trading date. When it comes to holidays,
we still choose the previous business day for interest rate. For example,
if a trader is buying a CDS on 2014-07-05, then she should use the interest
rate of 2014-07-03, because 2014-07-04 is a national holiday and 2014-07-03
is the previous business day of trading date.
Also, please notice that in rates.RData
, a currency's type of
expiries generally stays the same along the time, but not always. For
example, we check the expiry type of USD in rates.RData
: for
2004-01-01, there are two types of expirty: 1M, 3Y; for 2006-01-01, there
are five types of expiry: 1M, 2M, 3M, 6M, 1Y; for 2007-01-01, there are 18
types of expiry; for 2014-01-01, there are 19 types of expiry. Therefore,
for a trader, she should always keep in mind to update her knowledge of the
expiry types of her trading currency. For different currencies, the types
of expiries are often different.
Finally, please notice that some of the data are missing for a certain
expiry of a currency in a short time. For example, some dates in
rates.RData
do not have a expiry
of 3Y for USD
. This
is not likely to be caused by data error, since all these data are got from
Markit and FRED. Users, however, should be aware of that some data seem
"missing".
download_FRED
download_markit
build_rates
data(rates)
## for JPY rates:
rates[rates$currency == "JPY",]
## for rates on a specific date, of a specific currency:
rates[rates$currency == "USD" & rates$date == "2005-10-01",]
Run the code above in your browser using DataLab