Bond_Functions

FunctionIt equals the first date in the accrual schedule and does not necessarily coincide with the payment date of the first coupon.

Function

It equals the last date in the accrual schedule and does not necessarily coincide with the payment date of the last coupon.

Function

It is defined as the present value of all cash flows received after

There exist 3 distinct methods for obtaining the dirty price:

If

Function

It is defined as the bond's dirty price at

There exist 4 distinct methods for obtaining the clean price:

If

Function

If

Function

If

Function

Function

Function

Function

Function

Function

Function

If

Function

If

Function

If

Function

If

Function

If

Function

If

Function

If

Function

If

Function

Note the reference period can differ from the corresponding accrual period and is needed in the calculation of the time length of the accrual period by a few day count conventions, such as ACT/ACT(ICMA)

If

Function

Note the reference period can differ from the corresponding accrual period and is needed in the calculation of the time length of the accrual period by a few day count conventions, such as ACT/ACT(ICMA)

If

Function

This equals the number of calendar days of the accrual period containing

If

Function

This equals the number of calendar days of the accrual period containing

If

Function

This equals the number of calendar days from the start of the accrual period containing

If

Function

This equals the number of calendar days from the start of the accrual period containing

If

Function

This equals the interest amount that has been earned up to

If

Function

This equals the change in NPV (on a notional of 100) due to a uniform 1-basis-point change in the rate paid by the cash flows, provided all discounting is done according to the provided yield or discounting curve,

Concretely, in the case where a yield is supplied, a discounting curve is constructed with a flat zero rate equal to the supplied yield.

Otherwise, the supplied discount curve is used.

Then all coupons - regardless of being fixed or floating - are replaced with fixed payments of an amount equal to one basis point on a notional of 100, i.e. an amount of

Then the NPV of all these replaced coupons is calculated using the applicable discounting curve mentioned above.

There exist 2 distinct methods for obtaining the NPV:

If

PRECAUTION: This function treats the referenced bond as if it were a fixed rate bond even if this is not the case! All index-linked cash flows are treated as fixed cash flows that pay the amount forecasted by the corresponding curve.

Function

This is the theoretical fixed flat coupon rate that the bond would need to have in order for its calculated clean price to equal a given clean price input.

A discounting yield curve must be provided.

If a clean price is not provided, it is calculated from the given discounting yield curve.

If

PRECAUTION: This function treats the referenced bond as if it were a fixed rate bond even if this is not the case! All index-linked cash flows are treated as fixed cash flows that pay the amount forecasted by the corresponding curve.

Function

The exact duration definition should be specified out of the list Bond::Duration Type

If

PRECAUTION: This function treats the referenced bond as if it were a fixed rate bond even if this is not the case! All index-linked cash flows are treated as fixed cash flows that pay the amount forecasted by the corresponding curve.

Function

KRD is defined and implemented outside of QuantLib as follows:

Let

KRD is an array of

More specifically:

, where

In order to explain

Due to the way the bond's continuously compounded yield

Now

Note all yield curves are built using linear interpolation and flat extrapolation with respect to the input zero rates.

This has the consequense that the curves

This in turn implies that

The conclusion is that the

PRECAUTION: This function treats the referenced bond as if it were a fixed rate bond even if this is not the case! All index-linked cash flows are treated as fixed cash flows that pay the amount forecasted by the corresponding curve.

Function

The convexity is defined as follows:

Let

Let

Then the second derivative (a measure of curvature)

Note that

Convexity is then defined as

If

PRECAUTION: This function treats the referenced bond as if it were a fixed rate bond even if this is not the case! All index-linked cash flows are treated as fixed cash flows that pay the amount forecasted by the corresponding curve.

Function

It equals the change in NPV

Obtained by setting

The coefficients

If

PRECAUTION: This function treats the referenced bond as if it were a fixed rate bond even if this is not the case! All index-linked cash flows are treated as fixed cash flows that pay the amount forecasted by the corresponding curve.

Function

The yield value of a one basis point change in price is the derivative of the yield with respect to the price multiplied by 0.01

The exact calculation proceeds as follows:

By definition, for the modified duration

where

and

Solving for the derivative

Therefore the inverse derivative is:

and this function's output is:

If

PRECAUTION: This function treats the referenced bond as if it were a fixed rate bond even if this is not the case! All index-linked cash flows are treated as fixed cash flows that pay the amount forecasted by the corresponding curve.

Function

Here the Z-spread is defined as the single rate

This function requires the input of a "risk-free" curve - a treasury or swap curve - that is used to imply the time-dependent rate

It also needs the bond clean price as of time

If

PRECAUTION: This function treats the referenced bond as if it were a fixed rate bond even if this is not the case! All index-linked cash flows are treated as fixed cash flows that pay the amount forecasted by the corresponding curve.

Function

Here the yield is defined as the single rate

There exist 2 distinct methods for obtaining the yield:

If

PRECAUTION: This function treats the referenced bond as if it were a fixed rate bond even if this is not the case! All index-linked cash flows are treated as fixed cash flows that pay the amount forecasted by the corresponding curve.

Function

This is based on the actual bond's notional (not scaled to 100).

The theoretical settlement value is returned if no clean price is provided.

The default bond settlement date is used for calculation.