price.dirty2clean {QuantBondCurves}R Documentation

From one price to another

Description

Converts bond prices from dirty to clean and viceversa.

Usage

price.dirty2clean(
  maturity,
  analysis.date = Sys.Date(),
  price,
  dirty = 1,
  coupon.rate,
  principal = 1,
  asset.type = "TES",
  freq = NULL,
  daycount = "NL/365"
)

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.

analysis.date

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

price

Numeric value. Price of the bond to convert.

dirty

Numeric value. Determines if the input price corresponds to the dirty price or the clean price. For dirty price, set dirty = 1. Otherwise, dirty = 0

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

daycount

Day count convention. See also 'Details'.

Details

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

daycount convention accepts the following values:

Value

The dirty price or clean price of a bond.

Examples

price.dirty2clean(maturity = "2026-01-03", analysis.date = "2023-01-02",
                  price = 1, dirty = 1, coupon.rate = 0.04, principal = 1)
price.dirty2clean(maturity = "2026-01-03", analysis.date = "2023-01-02",
                  price = 0.9601096, dirty = 0, coupon.rate = 0.04, principal = 1)

[Package QuantBondCurves version 0.2.0 Index]