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
Where
- The one-period rate at step t, node j
node_rates - The lowest rate at step t
lowest_rates - Volatility of the one-period rate per year
volatility - The length of one step, in years
step_years - The bond's value at step t, node j
- The coupon paid each step
- Option-adjusted spread added to every rate
oas - The price the option is exercised at
exercise_prices - The value today of 1 paid at step t, node j
- Discount factor for a payment at step t + 1
discount_factors - Par yield of the bond maturing at step t + 1
par_yields - Effective duration
effective_duration - Effective convexity
effective_convexity - The bond's value on the tree
value - Its value with the curve shifted down
value_down - Its value with the curve shifted up
value_up - 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
| Name | Unit | Bounds | Description |
|---|---|---|---|
Curve tenorscurve_tenorsyears (array) · length min 1, max 60; each (0, 100] | years (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] | rate (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 | [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 |
Frequencyfrequencytext | text | Periods a year: the tree's step and the par bonds' coupons | |
Calculationcalculationtext | text | Calibrate the tree to the par curve | |
Yearsyearsyears · (0, 100] | years | (0, 100] | How many years the tree spans |
Value the bond and its option on the tree (value): 12 inputs
| Name | Unit | Bounds | Description |
|---|---|---|---|
Curve tenorscurve_tenorsyears (array) · length min 1, max 60; each (0, 100] | years (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] | rate (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 | [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 |
Frequencyfrequencytext | text | Periods a year: the tree's step and the par bonds' coupons | |
Maturity yearsmaturity_yearsyears · (0, 100] | years | (0, 100] | Years to maturity, a whole number of periods from a coupon date |
Coupon ratecoupon_raterate · [0, 1] | rate | [0, 1] | Annual coupon rate, paid each period |
Facefacemoney · [0.01, 1e+09] | money | [0.01, 1e+09] | Face value, repaid at maturity |
Optionoptiontext | text | '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] | years (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] | money (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) |
Calculationcalculationtext | text | Value the bond and its option on the tree | |
OASoasrate · [-0.5, 1] | rate | [-0.5, 1] | A constant spread added to every node rate (the OAS) |
The option-adjusted spread at a market price (oas): 12 inputs
| Name | Unit | Bounds | Description |
|---|---|---|---|
Curve tenorscurve_tenorsyears (array) · length min 1, max 60; each (0, 100] | years (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] | rate (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 | [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 |
Frequencyfrequencytext | text | Periods a year: the tree's step and the par bonds' coupons | |
Maturity yearsmaturity_yearsyears · (0, 100] | years | (0, 100] | Years to maturity, a whole number of periods from a coupon date |
Coupon ratecoupon_raterate · [0, 1] | rate | [0, 1] | Annual coupon rate, paid each period |
Facefacemoney · [0.01, 1e+09] | money | [0.01, 1e+09] | Face value, repaid at maturity |
Optionoptiontext | text | '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] | years (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] | money (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) |
Calculationcalculationtext | text | The option-adjusted spread at a market price | |
Pricepricemoney · (0, 1e+09] | money | (0, 1e+09] | The bond's market price, in the face value's units |
Effective duration and convexity (effective): 13 inputs
| Name | Unit | Bounds | Description |
|---|---|---|---|
Curve tenorscurve_tenorsyears (array) · length min 1, max 60; each (0, 100] | years (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] | rate (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 | [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 |
Frequencyfrequencytext | text | Periods a year: the tree's step and the par bonds' coupons | |
Maturity yearsmaturity_yearsyears · (0, 100] | years | (0, 100] | Years to maturity, a whole number of periods from a coupon date |
Coupon ratecoupon_raterate · [0, 1] | rate | [0, 1] | Annual coupon rate, paid each period |
Facefacemoney · [0.01, 1e+09] | money | [0.01, 1e+09] | Face value, repaid at maturity |
Optionoptiontext | text | '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] | years (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] | money (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) |
Calculationcalculationtext | text | Effective duration and convexity | |
OASoasrate · [-0.5, 1] | rate | [-0.5, 1] | The OAS held constant while the curve shifts |
Shiftshiftrate · [1e-06, 0.01] | rate | [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
| Name | Unit | Bounds | Description |
|---|---|---|---|
Calculationcalculationtext | text | Calibrate the tree to the par curve | |
Step yearsstep_yearsyears · (0, 1] | years | (0, 1] | Years in one period |
Rate ratiorate_ratioratio · [1, 2.71828] | ratio | [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] | rate (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] | rate (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] | rate (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] | ratio (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
| Name | Unit | Bounds | Description |
|---|---|---|---|
Calculationcalculationtext | text | Value the bond and its option on the tree | |
Valuevaluemoney · [0, 1e+15] | money | [0, 1e+15] | The bond's value, with its option |
Option free valueoption_free_valuemoney · [0, 1e+15] | money | [0, 1e+15] | The value of the same bond with no option |
Option valueoption_valuemoney · [0, 1e+15] | money | [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
| Name | Unit | Bounds | Description |
|---|---|---|---|
Calculationcalculationtext | text | The option-adjusted spread at a market price | |
OASoasrate · [-0.5, 1] | rate | [-0.5, 1] | The spread over every node rate that reprices the bond |
Model valuemodel_valuemoney · [0, 1e+15] | money | [0, 1e+15] | The bond's value with no spread, the tree's own |
Option free valueoption_free_valuemoney · [0, 1e+15] | money | [0, 1e+15] | The option-free bond's value at the OAS |
Option valueoption_valuemoney · [0, 1e+15] | money | [0, 1e+15] | The option's value to its holder at the OAS |
Effective duration and convexity (effective): 6 outputs
| Name | Unit | Bounds | Description |
|---|---|---|---|
Calculationcalculationtext | text | Effective duration and convexity | |
Valuevaluemoney · [0, 1e+15] | money | [0, 1e+15] | The bond's value on the unshifted tree |
Value downvalue_downmoney · [0, 1e+15] | money | [0, 1e+15] | The value with the par curve shifted down |
Value upvalue_upmoney · [0, 1e+15] | money | [0, 1e+15] | The value with the par curve shifted up |
Effective durationeffective_durationyears · [-200, 200] | years | [-200, 200] | (V_down - V_up) / (2 V shift) |
Effective convexityeffective_convexityratio · [-1e+06, 1e+06] | ratio | [-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.
| Field | Concept | Read as | Sources (licence class; hosted) |
|---|---|---|---|
par_yieldstenors in curve_tenors | Treasury par yield curveus.treasury.par_curve | the curve on or before the date: its last row, a value per tenor; real time: as published by the date |
|
Citations
- 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)
- 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)
- 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_modelwith 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:
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())
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