Skip to main content

Module binomial

Module binomial 

Source
Expand description

Binomial lattice engine for equity options: a thin adapter over the asset-class-agnostic core::lattice framework.

The tree parameterization and step count come from the option’s LatticeConfig (tree_type / tree_steps in JSON, .tree_type() / .tree_steps() on the builder). The default is Leisen-Reimer at 1001 steps — strictly more accurate than the historical CRR-1000 default at the same cost; select CRR explicitly to reproduce the classic tree. European, American and Bermudan exercise all price on the optimized rolling-array engine; npv_with_diagnostics runs the debug engine instead, keeping the full trees, the exercise boundary, tree Greeks and timing.

Greeks are engine-consistent (so American and Bermudan sensitivities reflect the exercise boundary, not a European closed form): solution reads value, delta, gamma and theta off one backward pass, and pricing_result adds the bump-based Greeks (vega, rho, vanna, charm, zomma) from a shared set of shifted trees — seven passes for the value plus all nine Greeks, instead of a rebuild per Greek.

Functions§

charm
Charm from the spot derivative of the tree’s calendar theta.
delta
gamma
npv
Lattice price on the optimized rolling-array engine; routes to the term-structure lattice when lattice.term_structure is set.
npv_with_diagnostics
Lattice price on the debug engine: the full spot/value trees, the early-exercise boundary per layer, tree Greeks and wall-clock time. Same price as npv, bit for bit — greeks come from solution / pricing_result on the production engine.
pricing_result
Value and all nine Greeks from a shared set of tree passes instead of a rebuild per Greek: the base pass yields the price plus delta/gamma/theta for free, the two vol-bumped passes yield vega, vanna and zomma together, two rate bumps yield rho, and two spot-bumped passes yield charm — seven passes in total.
rho
solution
Value and the tree delta/gamma/theta from one backward pass, on both the uniform and the term-structure lattice. Same price as npv, bit for bit.
theta
vanna
Vanna from the change in the tree delta under a parallel vol bump.
vega
volga
Volga as the second price derivative under a parallel vol bump (the larger step tempers roundoff in the second difference).
zomma
Zomma from the change in the tree gamma under a parallel vol bump.