sens.bonds {QuantBondCurves} | R Documentation |
Bond Sensitivity
Description
Calculates the sensitivity of a given bond by numerically averaging the percentage change in bonds price when moving upwards and downwards, by 1 basic point, the Yield to Maturity vector.
Usage
sens.bonds(
input,
price,
maturity,
analysis.date = Sys.Date(),
coupon.rate,
principal = 1,
asset.type = "TES",
freq = 1,
rate.type = 1,
spread = 0,
daycount = "ACT/365",
dirty = 1,
convention = "F",
trade.date = NULL,
coupon.schedule = "SF"
)
Arguments
input |
String that establishes if the |
price |
Numeric value of either market price or Internal Rate of Return of a given bond. Instead of IRR, can also be a vector of multiple rates, one for every coupon date. |
maturity |
Last day of the contract: YYYY-MM-DD. Alternatively, it can be a numeric value that represents the duration of the contract in years. |
analysis.date |
Date in which the asset is valued. By default, the current date. |
coupon.rate |
Coupon rate of the asset. Can be an unique numeric value or a vector corresponding to each coupon payment date. |
principal |
Notional amount for the asset. |
asset.type |
String that determines the asset type to value. See also 'Details'. |
freq |
Frequency of payments of a given asset in a year. For LIBOR and IBR the default frequency is four (quarterly payments). TES has a default frequency of one (annual payments). |
rate.type |
(1) for discrete compounded discount rates and (0) for continuosly compounded discount rates. By default rates are assumed to be discrete. |
spread |
Decimal value of spread added to coupon payment rate. By
default, |
daycount |
Day count convention. See also 'Details'. |
dirty |
Numeric value to determine if the calculated price is dirty or
clean. To calculate dirty price, set |
convention |
String that establishes if the effective dates are calculated using Following, Modified Following, Backward or Backward Following. See also 'Details'. |
trade.date |
The date on which the transaction occurs. It is used to calculate maturity as a date, when given in years. Also required for non-trivial cases such as bonds with long first coupon. |
coupon.schedule |
String that establishes if a bond first coupon period is a long first coupon or a short first coupon. On the contrary, establishes if last coupon period is long last coupon or a short last coupon. See also 'Details'. |
Details
asset.type
makes reference to the following type of assets:
"TES" for Colombian Treasury Bonds (default).
"FixedIncome" for assets that are indexed to a fixed income with different frequency of payments.
"IBR" for bonds and assets indexed to 3M IBR rate.
"LIBOR" for bonds and assets indexed to 3M LIBOR.
daycount
convention accepts the following values:
30/360.
ACT/365.
ACT/360 (Default).
ACT/365L.
NL/365.
ACT/ACT-ISDA
ACT/ACT-AFB
convention
makes reference to the following type of business day conventions:
"F" for Following business day convention.
"MF" for Modified Following business day convention.
"B" for Backward business day convention.
"MB" for Modified Backward business day convention.
coupon.schedule
makes reference to the following type of coupon payment schedule
of a bond:
"LF" for Long First coupon payment.
"LL" for Long Last coupon payment.
"SF" for Short First coupon payment.
"SL" for Short Last coupon payment.
Value
Bond sensitivity
Examples
sens.bonds(input = c("price"), price = 0.98, maturity = "2023-01-03",
analysis.date = "2019-01-05", coupon.rate = 0.04,
principal = 1, asset.type = "IBR", rate.type = 1)
sens.bonds(input = c("rate"), price = rep(0.08,8), maturity = "2023-01-03",
analysis.date = "2015-02-03", coupon.rate = 0.04,
principal = 1, asset.type = "FixedIncome", freq = 1,
rate.type = 1, daycount = "ACT/365", dirty = 1,
convention = "MB", trade.date = "2015-02-03",
coupon.schedule = "LF")