valuation.bonds {QuantBondCurves}R Documentation

Bond valuation

Description

Function that values various asset types with varying payment frequencies. It covers fixed-coupon assets, spread income assets, floating notes and fixed legs of interest rate swaps.

Usage

valuation.bonds(
  maturity,
  coupon.rate,
  rates,
  principal = 1,
  analysis.date = Sys.Date(),
  asset.type = "TES",
  freq = NULL,
  rate.type = 1,
  spread = 0,
  daycount = "NL/365",
  dirty = 1,
  convention = "F",
  trade.date = NULL,
  coupon.schedule = "SF",
  spread.only = FALSE
)

Arguments

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.

coupon.rate

Coupon rate of the asset. Can be an unique numeric value or a vector corresponding to each coupon payment date.

rates

Discount rates given by the zero coupon rate curve. Can also be a unique discount rate.

principal

Notional amount for the asset.

analysis.date

Date in which the asset is valued. By default, the current date.

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 annual compounded discount rates and (0) for continuosly compounded discount rates. By default, rates are assumed to be the former.

spread

Decimal value of spread added to coupon payment rate. By default, 0.

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 dirty = 1. Otherwise, dirty = 0.

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'.

spread.only

Logical condition that establishes if the output should just include the spread or the complete bond value. By default, FALSE, referring to the output being bond value.

Details

asset.type makes reference to the following type of assets:

daycount convention accepts the following values:

convention makes reference to the following type of business day conventions:

coupon.schedule makes reference to the following type of coupon payment schedule of a bond:

Value

Bond value.

Examples

valuation.bonds(maturity = "2026-06-01", coupon.rate = 0.06, rates = 0.08,
                analysis.date = "2022-06-01")
valuation.bonds(maturity = "2026-06-01", coupon.rate = 0.06, rates = rep(0.08,4),
                analysis.date = "2022-06-01", rate.type = 0)
valuation.bonds(maturity = "2026-06-01", analysis.date= "2025-02-27",
                coupon.rate = c(0.06, 0.062, 0.063, 0.065, 0.066, 0.068),
                rates = c(0.08, 0.082, 0.078, 0.09, 0.077, 0.085),
                asset.type = "IBR")
valuation.bonds(maturity = "2026-06-01", coupon.rate = 0.06,
                rates = 0.08, asset.type = "IBR", freq = 4,
                spread = 0.03)
valuation.bonds(maturity = 4.58, coupon.rate = 0.1256, rates = seq(0.05, 0.14, by = 0.005),
                analysis.date = "2019-07-14", asset.type = "FixedIncome", freq = 4,
                principal = 567, daycount = "ACT/360", rate.type = 0, trade.date = "2019-07-14",
                coupon.schedule = "LL")

[Package QuantBondCurves version 0.3.0 Index]