Skip to content

Fixed income

Binomial interest-rate tree

A lognormal binomial tree of rates calibrated to a par curve; values of option-free, callable and putable bonds, their options, the OAS and effective duration and convexity.

Model id
fixed_income.interest_rate_tree, version 1
Domain
Fixed income
Evidence
standard
Cost class
light: A short numerical method; a hosted run may take up to 10 seconds.

Formula

rt,j=rt,0 e2σΔjr_{t,j} = r_{t,0}\, e^{2 \sigma \sqrt{\Delta} j}Vt,j=12(Vt+1,j+C)+12(Vt+1,j+1+C)1+(rt,j+s)ΔV_{t,j} = \frac{\tfrac12 (V_{t+1,j} + C) + \tfrac12 (V_{t+1,j+1} + C)}{1 + (r_{t,j} + s) \Delta}V←min⁡(V,K) (call), max⁡(V,K) (put)V \leftarrow \min(V, K) \text{ (call)}, \ \max(V, K) \text{ (put)}∑jqt,j1+rt,jΔ=dt+1=1−ct+1Δ∑k≤tdk1+ct+1Δ\sum_j \frac{q_{t,j}}{1 + r_{t,j}\Delta} = d_{t+1} = \frac{1 - c_{t+1} \Delta \sum_{k \le t} d_k}{1 + c_{t+1} \Delta}Deff=V−−V+2V0Δy,Ceff=V−+V+−2V0V0Δy2D_{\mathrm{eff}} = \frac{V_- - V_+}{2 V_0 \Delta y}, \quad C_{\mathrm{eff}} = \frac{V_- + V_+ - 2 V_0}{V_0 \Delta y^2}

Where

rt,jr_{t,j}
The one-period rate at step t, node j node_rates
rt,0r_{t,0}
The lowest rate at step t lowest_rates
σ\sigma
Volatility of the one-period rate per year volatility
Δ\Delta
The length of one step, in years step_years
Vt,jV_{t,j}
The bond's value at step t, node j
CC
The coupon paid each step
ss
Option-adjusted spread added to every rate oas
KK
The price the option is exercised at exercise_prices
qt,jq_{t,j}
The value today of 1 paid at step t, node j
dt+1d_{t+1}
Discount factor for a payment at step t + 1 discount_factors
ct+1c_{t+1}
Par yield of the bond maturing at step t + 1 par_yields
DeffD_{\mathrm{eff}}
Effective duration effective_duration
CeffC_{\mathrm{eff}}
Effective convexity effective_convexity
V0V_0
The bond's value on the tree value
V−V_-
Its value with the curve shifted down value_down
V+V_+
Its value with the curve shifted up value_up
Δy\Delta y
The parallel shift of the par curve shift

Each symbol's field is named beside it; the inputs and outputs, with their units and bounds, are under Variables, and the citations give each formula's source.

Variables

Rates, returns and yields are decimals: 0.05 is five percent. Bounds in brackets include their end; in parentheses they exclude it.

Inputs

Calibrate the tree to the par curve (calibrate): 6 inputs
Inputs of the calculation calibrate
NameDescription
Curve tenorscurve_tenorsyears (array) · length min 1, max 60; each (0, 100]Tenor of each par yield, in years, increasing
Par yieldspar_yieldsrate (array) · length min 1, max 60; each [0, 1]Par yield at each tenor: the coupon rate, paid each period, of a bond priced at par; linear between tenors and flat before the first
Volatilityvolatilityvolatility · [0, 0.5]Volatility of the one-period rate a year (0.1 is 10%); zero gives the forward rates, so the bound is widened to include it
FrequencyfrequencytextPeriods a year: the tree's step and the par bonds' coupons
CalculationcalculationtextCalibrate the tree to the par curve
Yearsyearsyears · (0, 100]How many years the tree spans
Value the bond and its option on the tree (value): 12 inputs
Inputs of the calculation value
NameDescription
Curve tenorscurve_tenorsyears (array) · length min 1, max 60; each (0, 100]Tenor of each par yield, in years, increasing
Par yieldspar_yieldsrate (array) · length min 1, max 60; each [0, 1]Par yield at each tenor: the coupon rate, paid each period, of a bond priced at par; linear between tenors and flat before the first
Volatilityvolatilityvolatility · [0, 0.5]Volatility of the one-period rate a year (0.1 is 10%); zero gives the forward rates, so the bound is widened to include it
FrequencyfrequencytextPeriods a year: the tree's step and the par bonds' coupons
Maturity yearsmaturity_yearsyears · (0, 100]Years to maturity, a whole number of periods from a coupon date
Coupon ratecoupon_raterate · [0, 1]Annual coupon rate, paid each period
Facefacemoney · [0.01, 1e+09]Face value, repaid at maturity
Optionoptiontext'none', 'call' (the issuer may redeem at the exercise price) or 'put' (the holder may sell back at it)
Exercise yearsexercise_yearsyears (array) · length max 120; each (0, 100]When the option may be exercised, in years: coupon dates, after the coupon is paid, before maturity
Exercise pricesexercise_pricesmoney (array) · length max 120; each (0, 1e+09]The exercise price at each of those dates, in the face value's units (100 for par on a face of 100)
CalculationcalculationtextValue the bond and its option on the tree
OASoasrate · [-0.5, 1]A constant spread added to every node rate (the OAS)
The option-adjusted spread at a market price (oas): 12 inputs
Inputs of the calculation oas
NameDescription
Curve tenorscurve_tenorsyears (array) · length min 1, max 60; each (0, 100]Tenor of each par yield, in years, increasing
Par yieldspar_yieldsrate (array) · length min 1, max 60; each [0, 1]Par yield at each tenor: the coupon rate, paid each period, of a bond priced at par; linear between tenors and flat before the first
Volatilityvolatilityvolatility · [0, 0.5]Volatility of the one-period rate a year (0.1 is 10%); zero gives the forward rates, so the bound is widened to include it
FrequencyfrequencytextPeriods a year: the tree's step and the par bonds' coupons
Maturity yearsmaturity_yearsyears · (0, 100]Years to maturity, a whole number of periods from a coupon date
Coupon ratecoupon_raterate · [0, 1]Annual coupon rate, paid each period
Facefacemoney · [0.01, 1e+09]Face value, repaid at maturity
Optionoptiontext'none', 'call' (the issuer may redeem at the exercise price) or 'put' (the holder may sell back at it)
Exercise yearsexercise_yearsyears (array) · length max 120; each (0, 100]When the option may be exercised, in years: coupon dates, after the coupon is paid, before maturity
Exercise pricesexercise_pricesmoney (array) · length max 120; each (0, 1e+09]The exercise price at each of those dates, in the face value's units (100 for par on a face of 100)
CalculationcalculationtextThe option-adjusted spread at a market price
Pricepricemoney · (0, 1e+09]The bond's market price, in the face value's units
Effective duration and convexity (effective): 13 inputs
Inputs of the calculation effective
NameDescription
Curve tenorscurve_tenorsyears (array) · length min 1, max 60; each (0, 100]Tenor of each par yield, in years, increasing
Par yieldspar_yieldsrate (array) · length min 1, max 60; each [0, 1]Par yield at each tenor: the coupon rate, paid each period, of a bond priced at par; linear between tenors and flat before the first
Volatilityvolatilityvolatility · [0, 0.5]Volatility of the one-period rate a year (0.1 is 10%); zero gives the forward rates, so the bound is widened to include it
FrequencyfrequencytextPeriods a year: the tree's step and the par bonds' coupons
Maturity yearsmaturity_yearsyears · (0, 100]Years to maturity, a whole number of periods from a coupon date
Coupon ratecoupon_raterate · [0, 1]Annual coupon rate, paid each period
Facefacemoney · [0.01, 1e+09]Face value, repaid at maturity
Optionoptiontext'none', 'call' (the issuer may redeem at the exercise price) or 'put' (the holder may sell back at it)
Exercise yearsexercise_yearsyears (array) · length max 120; each (0, 100]When the option may be exercised, in years: coupon dates, after the coupon is paid, before maturity
Exercise pricesexercise_pricesmoney (array) · length max 120; each (0, 1e+09]The exercise price at each of those dates, in the face value's units (100 for par on a face of 100)
CalculationcalculationtextEffective duration and convexity
OASoasrate · [-0.5, 1]The OAS held constant while the curve shifts
Shiftshiftrate · [1e-06, 0.01]How far the par curve shifts down and up (0.001 is 10 bp); at least 0.01 bp, below which the second difference is rounding error

Outputs

Calibrate the tree to the par curve (calibrate): 7 outputs
Outputs of the calculation calibrate
NameDescription
CalculationcalculationtextCalibrate the tree to the par curve
Step yearsstep_yearsyears · (0, 1]Years in one period
Rate ratiorate_ratioratio · [1, 2.71828]The ratio of adjacent rates in a period, e^(2 sigma sqrt(step))
Par yieldspar_yieldsrate (array) · length max 120; each [0, 10]The par yield at the end of each period, read off the curve
Lowest rateslowest_ratesrate (array) · length max 120; each [0, 10]Each period's lowest one-period rate
Node ratesnode_ratesrate (array) (array) · length max 120; each length min 1, max 120; each [0, 10]Each period's one-period rates, lowest first, one row a period
Discount factorsdiscount_factorsratio (array) · length max 120; each (0, 1]The tree's discount factor to the end of each period
Value the bond and its option on the tree (value): 4 outputs
Outputs of the calculation value
NameDescription
CalculationcalculationtextValue the bond and its option on the tree
Valuevaluemoney · [0, 1e+15]The bond's value, with its option
Option free valueoption_free_valuemoney · [0, 1e+15]The value of the same bond with no option
Option valueoption_valuemoney · [0, 1e+15]The option's value to its holder: option-free less callable, or putable less option-free
The option-adjusted spread at a market price (oas): 5 outputs
Outputs of the calculation oas
NameDescription
CalculationcalculationtextThe option-adjusted spread at a market price
OASoasrate · [-0.5, 1]The spread over every node rate that reprices the bond
Model valuemodel_valuemoney · [0, 1e+15]The bond's value with no spread, the tree's own
Option free valueoption_free_valuemoney · [0, 1e+15]The option-free bond's value at the OAS
Option valueoption_valuemoney · [0, 1e+15]The option's value to its holder at the OAS
Effective duration and convexity (effective): 6 outputs
Outputs of the calculation effective
NameDescription
CalculationcalculationtextEffective duration and convexity
Valuevaluemoney · [0, 1e+15]The bond's value on the unshifted tree
Value downvalue_downmoney · [0, 1e+15]The value with the par curve shifted down
Value upvalue_upmoney · [0, 1e+15]The value with the par curve shifted up
Effective durationeffective_durationyears · [-200, 200](V_down - V_up) / (2 V shift)
Effective convexityeffective_convexityratio · [-1e+06, 1e+06](V_down + V_up - 2 V) / (V shift^2)

Calculator

Run the model on your own inputs, starting from its example. Rates are decimals: 0.05 is five percent. The run goes to the pyeconomics API on this site: your values travel only in the request, and nothing is stored.

Loading the calculator…

Worked example

Kalotay, Williams and Fabozzi's (1993) callable bond.

Example kwf_callable_bond. Inputs:

{
  "calculation": "value",
  "coupon_rate": 0.0525,
  "curve_tenors": [1, 2, 3],
  "exercise_prices": [100, 100],
  "exercise_years": [1, 2],
  "face": 100,
  "frequency": "annual",
  "maturity_years": 3,
  "oas": 0,
  "option": "call",
  "par_yields": [0.035, 0.04, 0.045],
  "volatility": 0.1
}

Outputs:

{
  "calculation": "value",
  "option_free_value": 102.07456540408485,
  "option_value": 0.6438978168903589,
  "value": 101.43066758719449
}

Assumptions

  • Rates move each period to one of two equally likely values whose ratio is e^(2 sigma sqrt(step)); a node discounts one period at 1 / (1 + r step), so rates compound once a period.
  • The par yields describe bonds paying a coupon each period; the curve is linear in par yield between its tenors and flat before the first.
  • The bond is valued on a coupon date; an option is exercised on its dates after the coupon is paid, when exercise is worth more to its holder than continuing.
  • Effective duration and convexity shift the whole par curve down and up, recalibrate the tree and hold the OAS.
  • Profile: default binds the calibration to Treasury's par curve on the date (the tenors it publishes); the volatility is an input.

Limitations

  • A lognormal tree has no negative rates: a par curve implying a negative forward rate, or no positive discount factor, raises DomainError, as does a value or duration outside its bounds. The calibrate calculation reports the node rates, so it refuses a tree whose highest rates exceed 10 (a long, volatile tree); the other calculations value on it, those nodes weighing 2^-t.
  • Effective duration shifts the par curve down by the shift: a curve within the shift of zero (US bills in 2009-2015 and 2020-2021) can then imply a negative forward rate, and the calculation raises DomainError naming the shifted curve; pass a smaller shift.
  • The volatility is constant across periods and the tree has one factor; it does not fit a volatility term structure.
  • No spread in [-0.5, 1] repricing the bond to its price raises ConvergenceError.
  • Accrued interest, call notice and lockout are not modelled: values are on a coupon date, at the exercise dates given.

Evidence

Status: standard. Textbook consensus, such as bond duration or the CAPM formula.

Every model declares one status: standard (textbook consensus), practitioner (a widely used convention), contested (under active debate), rejected (failed out of sample) or historical (a superseded methodology).

Syllabus

The 2027 CFA® Program's topic areas this model relates to, as factual tags. Each links to CFA Institute's page for its level; pyeconomics holds none of the curriculum's text.

Data

This model can read its data for you: each bound field names a data series, and the sources listed can fill it, in the order they are tried. This website reads only the sources whose terms let it serve their data (marked "hosted"); every source is available when you run pyeconomics on your own computer.

Profile: Default
FieldConceptRead asSources (licence class; hosted)
par_yieldstenors in curve_tenorsTreasury par yield curveus.treasury.par_curvethe curve on or before the date: its last row, a value per tenor; real time: as published by the date
  • US Department of the Treasury (hosted-safe; hosted)

Citations

  1. Kalotay, A. J., Williams, G. O. and Fabozzi, F. J. (1993). A Model for Valuing Bonds and Embedded Options. Financial Analysts Journal, 49(3), 35-46. doi:10.2469/faj.v49.n3.35 (The lognormal tree, its calibration to the on-the-run par curve, and the valuation of option-free, callable and putable bonds, pp. 37-45)
  2. Black, F., Derman, E. and Toy, W. (1990). A One-Factor Model of Interest Rates and Its Application to Treasury Bond Options. Financial Analysts Journal, 46(1), 33-39. doi:10.2469/faj.v46.n1.33 (The lognormal short-rate tree fitted to the term structure)
  3. Jamshidian, F. (1991). Forward Induction and Construction of Yield Curve Diffusion Models. Journal of Fixed Income, 1(1), 62-74. doi:10.3905/jfi.1991.692345 (Calibrating a tree period by period from its state prices)

Changelog

  • Version 1: First version.

Use it elsewhere

Documentation
The model's reference page
REST API
GET or POST /v1/models/fixed_income.interest_rate_tree/run
MCP tool
run_model with the model's id, fixed_income.interest_rate_tree. Connect an assistant
Command line
pyeconomics models run fixed_income.interest_rate_tree --help

The worked example, from Python and from the command line:

Python
import pyeconomics

inputs = {
    "calculation": "value",
    "coupon_rate": 0.0525,
    "curve_tenors": [1, 2, 3],
    "exercise_prices": [100, 100],
    "exercise_years": [1, 2],
    "face": 100,
    "frequency": "annual",
    "maturity_years": 3,
    "oas": 0,
    "option": "call",
    "par_yields": [0.035, 0.04, 0.045],
    "volatility": 0.1,
}
result = pyeconomics.run("fixed_income.interest_rate_tree", inputs)
print(result.to_json())
Command line
pyeconomics models run fixed_income.interest_rate_tree --inputs - <<'JSON'
{
  "calculation": "value",
  "coupon_rate": 0.0525,
  "curve_tenors": [1, 2, 3],
  "exercise_prices": [100, 100],
  "exercise_years": [1, 2],
  "face": 100,
  "frequency": "annual",
  "maturity_years": 3,
  "oas": 0,
  "option": "call",
  "par_yields": [0.035, 0.04, 0.045],
  "volatility": 0.1
}
JSON