abaquant.financial_math.bonds

Import path: abaquant.financial_math.bonds

Domain: Time-value, actuarial, fixed-income, corporate-finance, and portfolio mathematics.

Purpose

Deterministic coupon-bond valuation and interest-rate risk measures.

When to use it

Use these functions for deterministic calculations where explicit cash-flow, rate, compounding, sign, and annualization conventions matter.

Public objects

  • function: bond_price — Value a coupon bond from deterministic promised cash flows.

  • function: bond_yield — Solve the yield per coupon period consistent with an observed bond price.

  • function: bond_risk — Compute price, duration, and convexity measures for a coupon bond.

Detailed reference

Deterministic coupon-bond valuation and interest-rate risk measures.

Purpose

The module computes coupon-bond prices, solves yield to maturity numerically, and reports duration and convexity measures.

Conventions

Coupon and yield rates are per coupon period. Redemption and face values use currency units. Payment frequency converts period measures to annual measures.

Scope and limitations

The risk metrics assume parallel yield shifts and deterministic promised cash flows.

References

[ 1 ] Kellison, S. G. (2009), The Theory of Interest.

abaquant.financial_math.bonds.bond_price(face_value, coupon_rate_per_period, redemption_value, yield_per_period, periods)

Value a coupon bond from deterministic promised cash flows.

Parameters:
  • face_value (float) – Bond face or par value in currency units.

  • coupon_rate_per_period (float) – Coupon rate per payment period in decimal units.

  • redemption_value (float) – Bond redemption value paid at maturity in currency units.

  • yield_per_period (float) – Yield rate per coupon period in decimal units.

  • periods (int) – Number of discrete compounding or payment periods.

Returns:

(price, coupon_per_period, coupon_present_value, redemption_present_value) in positional order.

Return type:

tuple[float, float, float, float]

abaquant.financial_math.bonds.bond_risk(face_value, coupon_rate_per_period, redemption_value, yield_per_period, periods, payments_per_year)

Compute price, duration, and convexity measures for a coupon bond.

Parameters:
  • face_value (float) – Bond face or par value in currency units.

  • coupon_rate_per_period (float) – Coupon rate per payment period in decimal units.

  • redemption_value (float) – Bond redemption value paid at maturity in currency units.

  • yield_per_period (float) – Yield rate per coupon period in decimal units.

  • periods (int) – Number of discrete compounding or payment periods.

  • payments_per_year (int | float) – Coupon or payment frequency per year.

Returns:

(price, Macaulay_duration_years, convexity_years_squared) under the implemented coupon-bond convention.

Return type:

tuple[float, float, float]

abaquant.financial_math.bonds.bond_yield(price, face_value, coupon_rate_per_period, redemption_value, periods)

Solve the yield per coupon period consistent with an observed bond price.

Parameters:
  • price (float) – Price or option premium in currency units.

  • face_value (float) – Bond face or par value in currency units.

  • coupon_rate_per_period (float) – Coupon rate per payment period in decimal units.

  • redemption_value (float) – Bond redemption value paid at maturity in currency units.

  • periods (int) – Number of discrete compounding or payment periods.

Returns:

Computed bond yield as a dimensionless decimal quantity.

Return type:

float