aaDFCurve_Extend(df_crv,
min_years)
Takes an existing discount factor curve and extends it to
at least min_years
years. The extension is
calculated by assuming level par swap rates for all dates greater than the end
of the df_crv
out to min_years.
aaDFCurve_AddSpread(df_crv, min_years,
rate_basis_mgn, acc_mgn, sprd_type, sprd_yield)
Adds a spread to an existing discount factor curve. The spread is applied to the implied spot
rate for each point in the input discount factor curve. We note that the spread functions will also
extend the underlying curve if desired.
aaDFCurve_AddSpreads(df_crv,
min_years, rate_basis_mgn, acc_mgn, sprd_type, sprd_tbl)
Adds a term structure of spreads to an existing discount
factor curve. The relevant spread is applied
to the implied spot rate for each point in the discount factor curve. We note that the spread functions will also
extend the underlying curve if desired.
aaDFCurve_AddFwdSpreads_fs(df_crv,
intrp, acc, sprd_type, sprd_tbl, fwd_tbl, extend, table_type)
Adds a spread, or a term structure of spreads, to an
existing discount factor curve. The
relevant spread is applied to the forward rates from the input discount factor
curve for the user defined forward periods.
The forward periods are defined by the user in the input table of
forward periods.
aaDFCurve_AddFwdSpreads_dgen(df_crv,
intrp, acc, sprd_type, sprd_tbl, dates_tbl, freq, d_rule, holiday, extend,
table_type)
Adds a spread, or a term structure of spreads, to an
existing discount factor curve. The
relevant spread is applied to the forward rates from the input discount factor
curve for the user defined forward periods.
The forward periods are generated by the function based on user defined
dates, frequency, and business day convention.
aaDFCurve_AddXCBasisSpreads_fs(df_crv,
intrp, acc, sprd_tbl, fwd_tbl, boot_m, extend, table_typ)
Applies a spread, or a term structure of spreads, to an
existing discount factor curve. The
relevant spread is used to bootstrap the new curve for the user defined forward
periods. The forward periods are defined
by the user in the input table of forward periods. The resulting curve is intended for use in a
cross currency basis swap (exchange of two floating rate bonds), to be applied
as the discounting curve on the non-reference currency leg.
aaDFCurve_AddXCBasisSpreads_dgen(df_crv,
intrp, acc, sprd_tbl, dates_tbl, freq, d_rul, holiday, boot_m, extend, table_type)
Applies a spread, or a term structure of spreads, to an
existing discount factor curve. The
relevant spread is used to bootstrap the new curve for the user defined forward
periods. The forward periods are
generated by the function based on user defined dates, frequency, and business
day convention. The resulting curve is
intended for use in a cross currency basis swap (exchange of two floating rate
bonds), to be applied as the discounting curve on the non-reference currency
leg.
aaDFCurve_SmoothFwdRate(df_crv,
freq, d_e, d_t, meth_smooth)
Adds points to the discount factor curve in such a way as
to ensure smoother forward rates. The
frequency determines which points to add.
For example, if the frequency is quarterly, this function will ensure
that the returned discount factor curve has points with gaps no greater than
about 3 months. Note that the original
discount factor curve points are not changed.
aaDFCurve_SmoothFwdRate2(df_crv,
freq, d_e, d_t, meth_smooth, rate_basis, acc_rate, table_type)
Similar to aaDFCurve_SmoothFwdRate,
but returns a smoothed curve of discount factors and/or spot rates, depending
on table_type.
aaDFCurve_Extend
Input |
Description |
df_crv |
Discount factor curve |
min_years |
The minimum length (in years) of the output curve. The number of years is calculated from the first
date in the discount factor curve to the last. We note that the curve will not be exactly
this many number of years long, but it is guaranteed to be at least this many
years long. If this input is less than
the length of the original discount factor curve, a curve with the same
length as the original curve is returned. |
aaDFCurve_AddSpread and aaDFCurve_AddSpreads
Input |
Description |
df_crv |
Discount factor curve. |
min_years |
Minimum length (in years) of the output curve. The number of years is calculated from the
first date in the discount factor curve to the last. We note that the curve will not be exactly
this many number of years long, but it is guaranteed to be at least this many
years long. If this input is less than
the length of the original discount factor curve, a curve with the same
length as the original curve is returned. |
rate_basis_mgn |
Rate basis of the spot rates and of any spread that is to
be added (or subtracted). |
acc_mgn |
Accrual method of the spot rates and any spread that is to
be added (or subtracted). |
sprd_type |
Behavior of spread that is being used. Generally, spreads are add (sprd_type = 1),
meaning that a given rate r is adjusted to r + s. Leaving a rate unchanged would mean setting
s = 0. Spreads are sometimes quoted as
multiply (sprd_type = 2), for example in the tax-exempt markets. In this case a given rate is adjusted to r
* s. Leaving a rate unchanged would
mean setting s = 1. |
sprd_yield |
Spread to use. If
the spread behavior is add ( = 1), negative spreads are allowed. If the spread behavior is multiply ( = 2),
then the spread must be >=0 (note that if it is equal to 0 this will set
all rates = 0). |
sprd_tbl |
A two-column table with dates and spread. The restrictions on the spreads are as
described in sprd_yield. See example
below for a further discussion. |
aaDFCurve_AddFwdSpreads_fs
Input |
Description |
df_crv |
Discount factor curve |
intrp |
Interpolation method |
acc |
Day count convention for forward rates |
sprd_type |
Behavior of spread that is being used. Generally, spreads are add (sprd_type = 1),
meaning that a given rate r is adjusted to r + s. Leaving a rate unchanged would mean setting
s = 0. Spreads are sometimes quoted as
multiply (sprd_type = 2), for example in the tax-exempt markets. In this case a given rate is adjusted to r
* s. Leaving a rate unchanged would
mean setting s = 1. |
sprd_tbl |
Table of spreads (or scale factors). Can be a single cell, in which case it is a
constant spread to be added to all forward rates, or a 3 column table of time
varying spreads (start date, end date, spread). If it is a 3 column table, the spread for
each forward period will be determined by using the forward period
terminating date to lookup the spread from the row that contains the
terminating date, i.e. dstart<dterm<=dend. If no row of the table contains the forward
period terminating date, a spread of 0 is used. |
fwd_tbl |
Table of forward periods.
Periods must be contiguous, i.e. the effective date of a period is
equal to the terminating date of the previous period. |
extend |
Curve extension. A
switch that determines whether or not the curve will be extended if forward
periods extend past the end of the input discount factor curve. Options are to extend the output curve if
necessary, truncate the forward periods rather than extend the curve, or give
an error rather than extend the curve. |
table_type |
Output table type selection. 2 choices: ·
2 col: date, discount factor ·
7 col: effective date, terminating date,
original discount factor, original forward rate, forward rate + spread, spread
(or scale factor), output discount factor) |
aaDFCurve_AddFwdSpreads_dgen
Input |
Description |
df_crv |
Discount factor curve |
intrp |
Interpolation method |
acc |
Day count convention for forward rates |
sprd_type |
Behavior of spread that is being used. Generally, spreads are add (sprd_type = 1),
meaning that a given rate r is adjusted to r + s. Leaving a rate unchanged would mean setting
s = 0. Spreads are sometimes quoted as
multiply (sprd_type = 2), for example in the tax-exempt markets. In this case a given rate is adjusted to r
* s. Leaving a rate unchanged would
mean setting s = 1. |
sprd_tbl |
Table of spreads (or scale factors). Can be a single cell, in which case it is a
constant spread to be added to all forward rates, or a 3 column table of time
varying spreads (start date, end date, spread). If it is a 3 column table, the spread for
each forward period will be determined by using the forward period
terminating date to lookup the spread from the row that contains the
terminating date, i.e. dstart<dterm<=dend. If no row of the table contains the forward
period terminating date, a spread of 0 is used. |
dates_tbl |
Table of dates defining the generation of forward
periods. Can be from 1 to 7 columns
(terminating date, effective date, first date, next to last date, adjust
effective date, adjust terminating date, date generation method). If the terminating date is missing or 0, it
is assumed to be the date of the last discount factor from the input curve. If the effective date is missing or 0, it
is assumed to be the date of the first discount factor from the input
curve. The switches in columns 5, 6,
and 7 all default to 1 if not given. |
freq |
Frequency of forward periods |
d_rul |
Business day convention for forward periods |
hl |
|
extend |
Curve extension. A
switch that determines whether or not the curve will be extended if forward
periods extend past the end of the input discount factor curve. Options are to extend the output curve if
necessary, truncate the forward periods rather than extend the curve, or give
an error rather than extend the curve. |
table_type |
Output table type selection. 2 choices: ·
2 col: date, discount factor ·
7 col: effective date, terminating date,
original discount factor, original forward rate, forward rate + spread, spread
(or scale factor), output discount factor) |
aaDFCurve_AddXCBasisSpreads_fs
Input |
Description |
df_crv |
Discount factor curve |
intrp |
Interpolation method |
acc |
Day count convention for forward rates |
sprd_tbl |
Table of basis spreads.
Can be a single cell, in which case it is a constant basis spread to
be applied to all maturities, or a 2 column table of term-dependent basis spreads
(swap maturity date, basis spread). |
fwd_tbl |
Table of forward periods.
Periods must be contiguous, i.e. the effective date of a period is
equal to the terminating date of the previous period. |
boot_m |
Bootstrapping method.
Currently, the only available method is the linear basis spread
method. |
extend |
Curve extension. A
switch that determines whether or not the curve will be extended if forward
periods extend past the end of the input discount factor curve. Options are to extend the output curve if
necessary, truncate the forward periods rather than extend the curve, or give
an error rather than extend the curve. |
table_type |
Output table type selection. 2 choices: ·
2 col: date, discount factor ·
8 col: effective date, terminating date, basis
spread, original discount factor (interpolated), forward rate, forward rate +
spread, forward spread, output discount factor. |
aaDFCurve_AddXCBasisSpreads_dgen
Input |
Description |
df_crv |
Discount factor curve |
intrp |
Interpolation method |
acc |
Day count convention for forward rates |
sprd_tbl |
Table of basis spreads.
Can be a single cell, in which case it is a constant basis spread to
be applied to all maturities, or a 2 column table of term-dependent basis spreads
(swap maturity date, basis spread). |
dates_tbl |
Table of dates defining the generation of forward
periods. Can be from 1 to 7 columns
(terminating date, effective date, first date, next to last date, adjust
effective date, adjust terminating date, date generation method). If the terminating date is missing or 0, it
is assumed to be the last maturity date in the spread table. If the effective date is missing or 0, it
is assumed to be the date of the first discount factor from the input
curve. The switches in columns 5, 6,
and 7 all default to 1 if not given. |
freq |
Frequency of forward periods |
d_rul |
Business day convention for forward periods. |
hl |
|
boot_m |
Bootstrapping method.
Currently, the only available method is the linear basis spread
method. |
extend |
Curve extension. A
switch that determines whether or not the curve will be extended if forward
periods extend past the end of the input discount factor curve. Options are to extend the output curve if
necessary, truncate the forward periods rather than extend the curve, or give
an error rather than extend the curve. |
table_type |
Output table type selection. 2 choices: ·
2 col: date, discount factor ·
8 col: effective date, terminating date, basis
spread, original discount factor (interpolated), forward rate, forward rate +
spread, forward spread, output discount factor. |
aaDFCurve_SmoothFwdRate and aaDFCurve_SmoothFwdRate2
Input |
Description |
df_crv |
Discount factor curve |
freq |
The frequency of points to add to the input discount
factor curve. |
d_e |
The earliest date at which to add a point (a value of 0
means the start of the input discount factor curve). |
d_t |
The latest date at which to add a point (a value of 0 means
the end of the input discount factor curve). |
meth_smooth |
The curve smoothing method. |
rate_basis |
The rate quotation basis for output spot rates. |
acc_rate |
The accrual method for output spot rates. |
table_type |
The type of table to output. The output table consists of dates plus
discount factors and/or spot rates. |
In cases 1 through 5 below, we will consider the following
base curve:
Base Curve
date |
discount factor |
1-Jan-2000 |
1 |
1-Jul-2000 |
0.9759653 |
1-Jan-2001 |
0.952253655 |
1-Jul-2001 |
0.929490762 |
1-Jan-2002 |
0.906908242 |
1-Jul-2002 |
0.885229297 |
1-Jan-2003 |
0.863722136 |
We note that this curve is a flat 5% curve. It is easily shown that each spot rate,
annually compounded with act/365 accrual, is exactly 5% (to test, use aaConverDF_R()).
If we use the function aaDFCurve_extend(),
with the above base curve, and min_years = 6, we obtain the following results.
Results
date |
discount factor |
1-Jan-2000 |
1 |
1-Jul-2000 |
0.9759653 |
1-Jan-2001 |
0.952253655 |
1-Jul-2001 |
0.929490762 |
1-Jan-2002 |
0.906908242 |
1-Jul-2002 |
0.885229297 |
1-Jan-2003 |
0.863722136 |
1-Jan-2004 |
0.822592466 |
1-Jan-2005 |
0.78331664 |
1-Jan-2006 |
0.746015808 |
The first thing to note is that the original
points are returned unchanged.
This is always
the case. The next thing to note is that
the curve has been extended to 6 years, as desired. The extension has been done assuming that par
swap rates are level for the dates to be extended. In our particular example, if we calculated
the longest
possible annual par swap, accrual method act /
365 (all accruals = 1)
with no date adjustment (d_rul = 1) using the original curve and the
function aaParSwap(),
we see that this 3-year par swap rate is 5.000118035%. To extend the curve to 6 years, we assume
that the 6-year par swap rate is this same rate (we assume level
par swap rates). The final
curve is calculated using the standard curve bootstrapping methodology (see the
Interest Rate Curve Generation document).
Indeed if we now use the extended curve and calculate a 6-year par swap
rate, annual, act/365, we see that the result is exactly as expected (in fact,
it differs in the 11th decimal place due to any number of very small
numerical round-off errors).
Suppose we use the function aaDFCurve_AddSpread() to
add a 2% add spread (spread = 2%, sprd_type = 1) to the base
discount factor curve. We set the rate
basis to annually compounded (rate_basis_mgn = 1), the accrual to act/365 (acc_mgn
= 1) and further suppose we will extend the curve to 6 years (min_years
= 6).
If we run this function, we obtain (the first two columns,
the third column has been calculated separately):
Results
date |
discount factor |
spot rate |
1-Jan-2000 |
1 |
|
1-Jul-2000 |
0.966826093 |
7.00000% |
1-Jan-2001 |
0.934406216 |
7.00000% |
1-Jul-2001 |
0.903575788 |
7.00000% |
1-Jan-2002 |
0.873276837 |
7.00000% |
1-Jul-2002 |
0.844463353 |
7.00000% |
1-Jan-2003 |
0.816146577 |
7.00000% |
1-Jan-2004 |
0.762753701 |
7.00000% |
1-Jan-2005 |
0.712721697 |
7.00001% |
1-Jan-2006 |
0.666094949 |
7.00001% |
First, we note that for each date in the original
curve, there is a corresponding point in the new curve. This is always the case. We also see that each of the spot rates is
7%. What has happened is that each spot
rate, in the original curve, has been
calculated using the set basis and accrual and then been adjusted by 2%. This results in a new 3-year long discount
factor curve (with all spot rates equal to 7%).
This new 3-year discount factor curve is then extended to 6 years using
the aaDFCurve_extend()
methodology described above.
Caution: This example has been cooked-up and all of the
spot rates are exactly 7% like the original curve plus 2% even for dates past
the end of the original curve. This is
definitely NOT a general result.
Relative Spreads: If the relative spread had been set to 140% (=
7/5), because of the cooked-up nature of this example, we obtain exactly the
same curve because the 5% spot rates are adjusted to 5% * 1.4 = 7%.
Caution:
Inputs that may cause errors. Suppose
one is adding a negative spread. If adding
this spread to any of the spot rates results in
less than zero, this will cause an error.
Suppose we use the function aaDFCurve_AddSpreads()
to add the following spreads to the base curve, with all other settings being
the same:
date |
spread |
1-Jan-2000 |
2.00% |
1-Jan-2003 |
3.00% |
We obtain (only the first two columns, the third
column has been calculated separately):
date |
discount factor |
Spot rate |
1-Jan-2000 |
1 |
|
1-Jul-2000 |
0.966078786 |
7.16606% |
1-Jan-2001 |
0.931491102 |
7.33394% |
1-Jul-2001 |
0.897296251 |
7.49909% |
1-Jan-2002 |
0.862476189 |
7.66697% |
1-Jul-2002 |
0.828274963 |
7.83212% |
1-Jan-2003 |
0.793664877 |
8.00000% |
1-Jan-2004 |
0.735107955 |
7.99144% |
1-Jan-2005 |
0.68072843 |
7.98630% |
1-Jan-2006 |
0.630504005 |
7.98288% |
First, we note that for each date in the original
curve, there is a corresponding point in the new curve. This is always the
case. We also note that the curve has
been extended to 6 years. If we look at
the spot rates, we see that the 1-Jan-2003 spot rate is 8% = 5% + 3%, as one
would expect. For the dates prior to 1-Jan-2003,
the spread has been linearly interpolated from the table. For example, at 1-Jan-2002, we see that the
spread that has been added is 2.6697%.
This is exactly what one obtains by interpolating this date (use aainterp(),
interp=1) from the spread table.
For all dates after 1-Jan-2003, a spread of 3% has been added. In general:
Linear interpolation is used whenever possible. If a date is prior to the first date in the
spread table, the first spread is used.
If the date is after the last date in the spread table, the last spread
is used.
Question:
Why are the spot rates not equal to 8% for dates after 1-Jan-2003?
Answer:
This is not surprising.
What has happened is that the original 3-year curve has been adjusted
with variable spreads. This new curve no
longer has constant spot rates.
Extending this curve will not guarantee flat spot rates for dates after
the end of the original curve. However,
the one thing that is true, and this can be checked, is that if we calculate
the 3-year annual, act/365 par swap rate in the new curve, we obtain 7.966041%.
If we now calculate the 6-year rate, from this same curve, we obtain
exactly this same rate.
Suppose we want to add spreads to the forward rates on the
base curve for the forward periods given below.
effective date |
terminating date |
1-Jan-2000 |
1-Apr-2000 |
1-Apr-2000 |
1-Jul-2000 |
1-Jul-2000 |
1-Oct-2000 |
1-Oct-2000 |
1-Jan-2001 |
1-Jan-2001 |
1-Jul-2001 |
1-Jul-2001 |
1-Jan-2002 |
1-Jan-2002 |
1-Jul-2002 |
1-Jul-2002 |
1-Jan-2003 |
Suppose that for periods that terminate after
1-Jan-2000 and on or before 1-Jan-2001 the spread is 0.25%, for periods that
terminate after 1-Jan-2001 and on or before 1-Jan-2002 the spread is 0.5%, and
for periods that terminate after 1-Jan-2002 and on or before 1-Jan-2003 the
spread is 1%. This is shown in the
spread table below.
effective date |
terminating date |
spread |
1-Jan-2000 |
1-Jan-2001 |
0.25% |
1-Jan-2001 |
1-Jan-2002 |
0.50% |
1-Jan-2002 |
1-Jan-2003 |
1.00% |
We can now call aaDFCurve_AddFwdSpreads_fs with
the following inputs to add the desired spreads to the base discount factor
curve:
aaDFCurve_AddFwdSpreads_fs
Argument |
Description |
Example Data |
Switch |
df_crv |
discount factor curve |
base curve above |
|
intrp |
interpolation method |
1 |
linear |
acc |
accrual method |
1 |
actual/365 (fixed) |
sprd_type |
spread behavior |
1 |
add |
sprd_tbl |
spread table |
spread table above |
|
fwd_tbl |
forward table |
forward periods above |
|
extend |
curve extension |
3 |
give error rather than extend |
table_type |
Output table type |
2 |
7 col. (eff date, term date, input df, fwd rate, fwd rate
+ spread, spread, output df) |
Results
Effective Date |
Terminating Date |
Original DF (interpolated) |
Original forward rate |
Forward rate + spread |
Spread |
Output DF |
1-Jan-2000 |
1-Apr-2000 |
0.987983 |
4.8788% |
5.1288% |
0.25% |
0.987375 |
1-Apr-2000 |
1-Jul-2000 |
0.975965 |
4.9388% |
5.1888% |
0.25% |
0.974765 |
1-Jul-2000 |
1-Oct-2000 |
0.964109 |
4.8788% |
5.1288% |
0.25% |
0.962324 |
1-Oct-2000 |
1-Jan-2001 |
0.952254 |
4.9395% |
5.1895% |
0.25% |
0.949899 |
1-Jan-2001 |
1-Jul-2001 |
0.929491 |
4.9385% |
5.4385% |
0.50% |
0.924954 |
1-Jul-2001 |
1-Jan-2002 |
0.906908 |
4.9395% |
5.4395% |
0.50% |
0.900268 |
1-Jan-2002 |
1-Jul-2002 |
0.885229 |
4.9385% |
5.9385% |
1.00% |
0.874514 |
1-Jul-2002 |
1-Jan-2003 |
0.863722 |
4.9395% |
5.9395% |
1.00% |
0.849091 |
Suppose we want to add the same spreads as above
to the base curve, but now the forward periods are simply quarterly starting
1-Jan-2000 and ending 1-Jan-2003. In
this case, we can use the function aaDFCurve_AddFwdSpreads_dgen and
let the function generate the forward periods for us. The function requires a 1 to 7 column table
defining the dates for generating the forward periods. In this case, we just need the terminating
and effective dates, as shown in the below dates table:
terminating date |
effective date |
1-Jan-2003 |
1-Jan-2000 |
We can now call aaDFCurve_AddFwdSpreads_dgen
with the following inputs:
aaDFCurve_AddFwdSpreads_dgen
Argument |
Description |
Example Data |
Switch |
df_crv |
discount factor curve |
base curve above |
|
intrp |
interpolation method |
1 |
linear |
acc |
day count convention for forward rates |
1 |
actual/365 (fixed) |
sprd_type |
spread behavior |
1 |
add |
sprd_tbl |
spread table |
same as above example |
|
dates_tbl |
dates table |
dates table above |
|
freq |
frequency of forward periods |
3 |
quarterly |
d_rul |
business day convention for forward periods |
1 |
no adjustment |
hl |
holiday list |
0 |
|
extend |
curve extension |
3 |
give error rather than extend |
table_type |
output table type |
2 |
7 col. (eff date, term date, input df, fwd rate, fwd rate
+ spread, spread, output df) |
Results
Effective Date |
Terminating Date |
Original DF (interpolated) |
Original forward rate |
Forward rate + spread |
Spread |
Output DF |
1-Jan-2000 |
1-Apr-2000 |
0.9879827 |
4.8788% |
5.1288% |
0.25% |
0.987375 |
1-Apr-2000 |
1-Jul-2000 |
0.9759653 |
4.9388% |
5.1888% |
0.25% |
0.974765 |
1-Jul-2000 |
1-Oct-2000 |
0.9641095 |
4.8788% |
5.1288% |
0.25% |
0.962324 |
1-Oct-2000 |
1-Jan-2001 |
0.9522537 |
4.9395% |
5.1895% |
0.25% |
0.949899 |
1-Jan-2001 |
1-Apr-2001 |
0.9409351 |
4.8785% |
5.3785% |
0.50% |
0.937467 |
1-Apr-2001 |
1-Jul-2001 |
0.9294908 |
4.9385% |
5.4385% |
0.50% |
0.924925 |
1-Jul-2001 |
1-Oct-2001 |
0.9181995 |
4.8788% |
5.3788% |
0.50% |
0.912554 |
1-Oct-2001 |
1-Jan-2002 |
0.9069082 |
4.9395% |
5.4395% |
0.50% |
0.900211 |
1-Jan-2002 |
1-Apr-2002 |
0.8961287 |
4.8785% |
5.8785% |
1.00% |
0.887349 |
1-Apr-2002 |
1-Jul-2002 |
0.8852293 |
4.9385% |
5.9385% |
1.00% |
0.874403 |
1-Jul-2002 |
1-Oct-2002 |
0.8744757 |
4.8788% |
5.8788% |
1.00% |
0.861636 |
1-Oct-2002 |
1-Jan-2003 |
0.8637221 |
4.9395% |
5.9395% |
1.00% |
0.848926 |
Suppose we have the curve below, and we wish to extend it
out to 1-Jan-2010 with annual points using constant forward rates.
date |
discount factor |
1-Jan-2000 |
1 |
1-Mar-2000 |
0.991848 |
1-Jul-2000 |
0.974903 |
1-Jan-2001 |
0.949534 |
1-Jan-2002 |
0.900886 |
1-Jan-2003 |
0.853920 |
1-Jan-2004 |
0.807490 |
1-Jan-2005 |
0.761665 |
We can do this using the function aaDFCurve_AddFwdSpreads_fs
with a spread of 0 and forward periods defined as the dates from the input
curve as well as the dates that we want to use to extend the curve. The following table of forward periods will
be used in this case:
effective date |
terminating date |
1-Jan-2000 |
1-Mar-2000 |
1-Mar-2000 |
1-Jul-2000 |
1-Jul-2000 |
1-Jan-2001 |
1-Jan-2001 |
1-Jan-2002 |
1-Jan-2002 |
1-Jan-2003 |
1-Jan-2003 |
1-Jan-2004 |
1-Jan-2004 |
1-Jan-2005 |
1-Jan-2005 |
1-Jan-2006 |
1-Jan-2006 |
1-Jan-2007 |
1-Jan-2007 |
1-Jan-2008 |
1-Jan-2008 |
1-Jan-2009 |
1-Jan-2009 |
1-Jan-2010 |
If we now call aaDFCurve_AddFwdSpreads_fs
with the following inputs, the curve will be extended by assuming that the
forward rate for all the periods by which we are extending the curve is equal
to the forward rate for the last forward period given that is fully contained
in the input curve. In this case this
means the forward rate for the period from 1-Jan-2004 to 1-Jan-2005 will be
used to extend the curve.
aaDFCurve_AddFwdSpreads_fs
Argument |
Description |
Example Data |
Switch |
df_crv |
discount factor curve |
df curve above |
|
intrp |
interpolation method |
1 |
linear |
acc |
day count convention for forward rates |
1 |
actual/365 (fixed) |
sprd_type |
spread behavior |
1 |
add |
sprd_tbl |
spread table |
0 |
|
fwd_tbl |
forward table |
forward periods above |
|
extend |
curve extension |
1 |
extend curve if necessary |
table_type |
output table type |
2 |
7 col. (eff date, term date, input df, fwd rate, fwd rate
+ spread, spread, output df) |
Results
Effective Date |
Terminating Date |
Original DF (interpolated) |
Original forward rate |
Forward rate + spread |
Spread |
Output DF |
1-Jan-2000 |
1-Mar-2000 |
0.991847826 |
5.0000% |
5.0000% |
0.0% |
0.991848 |
1-Mar-2000 |
1-Jul-2000 |
0.974903207 |
5.2000% |
5.2000% |
0.0% |
0.974903 |
1-Jul-2000 |
1-Jan-2001 |
0.949533747 |
5.3000% |
5.3000% |
0.0% |
0.949534 |
1-Jan-2001 |
1-Jan-2002 |
0.900885908 |
5.4000% |
5.4000% |
0.0% |
0.900886 |
1-Jan-2002 |
1-Jan-2003 |
0.853920291 |
5.5000% |
5.5000% |
0.0% |
0.85392 |
1-Jan-2003 |
1-Jan-2004 |
0.807489637 |
5.7500% |
5.7500% |
0.0% |
0.80749 |
1-Jan-2004 |
1-Jan-2005 |
0.761664559 |
6.0000% |
6.0000% |
0.0% |
0.761665 |
1-Jan-2005 |
1-Jan-2006 |
0.71855147 |
6.0000% |
6.0000% |
0.0% |
0.718551 |
1-Jan-2006 |
1-Jan-2007 |
0.677878746 |
6.0000% |
6.0000% |
0.0% |
0.677879 |
1-Jan-2007 |
1-Jan-2008 |
0.639508251 |
6.0000% |
6.0000% |
0.0% |
0.639508 |
1-Jan-2008 |
1-Jan-2009 |
0.603216124 |
6.0000% |
6.0000% |
0.0% |
0.603216 |
1-Jan-2009 |
1-Jan-2010 |
0.569071815 |
6.0000% |
6.0000% |
0.0% |
0.569072 |
Suppose that we wish to create a curve to use as the
discounting curve of any JPY leg in a cross-currency swap. Consider market quotes of the 3m (pay) cross
currency basis swap for JPY against the benchmark USD:
Spread table
swap maturity date |
basis spread |
1-Jan-2007 |
-0.0500% |
1-Jan-2008 |
-0.0500% |
1-Jan-2009 |
-0.0475% |
1-Jan-2010 |
-0.0475% |
1-Jan-2011 |
-0.0500% |
These maturity dates correspond to terms of 1, 2,
3, 4, and 5 years respectively. For
example, the 5-year basis spread of -0.0500% means that a 5-year cross-currency
basis swap in which 3m USD Libor flat is paid, and 3m JPY Libor minus 5.00
basis points is received, is a fair (par) swap.
JPY Libor curve
grid date |
discount factor |
1-Jan-2006 |
1 |
1-Jan-2007 |
0.966078786 |
1-Jan-2008 |
0.897296251 |
1-Jan-2009 |
0.828274963 |
1-Jan-2010 |
0.735107955 |
1-Jan-2011 |
0.630504005 |
For a curve that can be used to value swaps with
maturities up to 5 years, we need following date table:
terminating date |
effective date |
1-Jan-2011 |
1-Jan-2006 |
We can now call aaDFCurve_AddXCBasisSpreads_dgen
with the following inputs:
aaDFCurve_AddXCBasisSpreads_dgen
Argument |
Description |
Example Data |
Switch |
df_crv |
discount factor curve |
JPY Libor curve above |
|
intrp |
interpolation method |
1 |
linear |
acc |
day count convention for forward rates |
1 |
actual/365 (fixed) |
sprd_tbl |
spread table |
spread table as above |
|
dates_tbl |
dates table |
dates table above |
|
freq |
frequency of forward periods |
3 |
quarterly |
d_rul |
business day convention for forward periods |
1 |
no adjustment |
hl |
holiday list |
0 |
|
boot_m |
bootstrapping method |
1 |
linear basis spread |
extend |
curve extension |
3 |
give error rather
than extend |
table_type |
output table type |
1 |
2 col. (date, df) |
Results
grid date |
discount factor |
1-Jan-2006 |
1 |
1-Apr-2006 |
0.991757 |
1-Jul-2006 |
0.983421 |
1-Oct-2006 |
0.97499 |
1-Jan-2007 |
0.966558 |
1-Apr-2007 |
0.949704 |
1-Jul-2007 |
0.932659 |
1-Oct-2007 |
0.915423 |
1-Jan-2008 |
0.898182 |
1-Apr-2008 |
0.881099 |
1-Jul-2008 |
0.864009 |
1-Oct-2008 |
0.846725 |
1-Jan-2009 |
0.829434 |
1-Apr-2009 |
0.806521 |
1-Jul-2009 |
0.783348 |
1-Oct-2009 |
0.759915 |
1-Jan-2010 |
0.736476 |
1-Apr-2010 |
0.710738 |
1-Jul-2010 |
0.684709 |
1-Oct-2010 |
0.658388 |
1-Jan-2011 |
0.632062 |
This resulting discount factor curve can now be
used as the discounting curve for any JPY leg of a cross-currency swap. This JPY leg can be either fixed or
floating. If the other (non-JPY) leg is
not USD, then the other leg should also be discounted with the basis spread
curve corresponding to the non-USD currency, using basis spreads relative to
the same (USD) benchmark. See reference [1]
for a description of the algorithm.
Consider the following base curve:
Base Curve
date |
discount factor |
spot rate (annual / act/365) |
1-Jan-2000 |
1.000000 |
|
1-Jul-2000 |
0.971363 |
6.000% |
1-Jan-2001 |
0.934406 |
7.000% |
1-Jul-2001 |
0.897285 |
7.500% |
1-Jan-2002 |
0.857158 |
8.000% |
1-Jul-2002 |
0.815594 |
8.500% |
1-Jan-2003 |
0.778417 |
8.700% |
Note that the spot rate is increasing non-linearly.
Suppose we want to use the function aaDFCurve_SmoothFwdRate2()
to produce a smooth output curve with double the number of points in the base
curve. The base curve gives discount
factors semi-annually, so we set the output frequency to quarterly (frequency
= 3). We set the first and
last dates to those of the base discount factor curve (1-Jan-2000 and
1-Jan-2003, respectively), the curve smoothing method to 1 (linear forward
rates), the rate basis to annual compounding (rate_basis = 1),
the accrual method to act/365 (acc_rate = 1), and set the output table type
such that we get discount factors and spot rates (table_type = 3). We obtain for the output curve:
Results
date |
discount factor |
spot rate |
1-Jan-2000 |
1.000000 |
6.000% |
1-Apr-2000 |
0.985578 |
6.000% |
1-Jul-2000 |
0.971363 |
6.000% |
1-Oct-2000 |
0.952898 |
6.638% |
1-Jan-2001 |
0.934406 |
7.000% |
1-Apr-2001 |
0.916062 |
7.270% |
1-Jul-2001 |
0.897285 |
7.500% |
1-Oct-2001 |
0.877558 |
7.746% |
1-Jan-2002 |
0.857158 |
8.000% |
1-Apr-2002 |
0.836233 |
8.276% |
1-Jul-2002 |
0.815594 |
8.500% |
1-Oct-2002 |
0.796789 |
8.609% |
1-Jan-2003 |
0.778417 |
8.700% |
Note: The
original points from the base curve still exist. New points have been added mid-way between
the points on the base curve, such that there is a point every 3 months in the
output curve. The new points have spot
rates that are roughly mid-way between the spot rates on the base curve, which
is expected because our curve smoothing method was “linear forward rates”.
Disclaimer
With respect to this document,
FinancialCAD Corporation (“FINCAD”) makes no warranty either express or
implied, including, but not limited to, any implied warranty of merchantability
or fitness for a particular purpose. In no event shall FINCAD be liable to
anyone for special, collateral, incidental, or consequential damages in
connection with or arising out of the use of this document or the information
contained in it. This document should not be relied on as a substitute for your
own independent research or the advice of your professional financial,
accounting or other advisors.
This information is subject to change
without notice. FINCAD assumes no responsibility for any errors in this
document or their consequences and reserves the right to make changes to this
document without notice.
Copyright
Copyright © FinancialCAD Corporation 2008.
All rights reserved.