Skip to main content

Module analytic

Module analytic 

Expand description

Closed-form option formulas.

Structs§

AmericanOnFuture 🔒
An American option on a future priced by Barone-Adesi–Whaley, in parts.

Enums§

BarrierKind
Which side a single barrier sits on and whether touching it brings the option in or knocks it out.
ModelError
A model that cannot price the inputs it was given.
OptionKind
Which side of an option is held.

Functions§

bachelier
The Bachelier (normal) forward price, undiscounted.
barone_adesi_whaley_on_future 🔒
The Barone-Adesi–Whaley quadratic approximation to an American option on a future: zero cost of carry, the premium paid up front and discounted by discount (the discount factor to expiry, e^{−rT}).
barrier_option
A continuously monitored single-barrier European on a zero-dividend lognormal spot: the Reiner-Rubinstein closed form, as Haug states it, term for term. discount is the risk-free discount factor to expiry and expiry the vol’s year fraction to it; the rate is the one that makes the two agree, r = −ln P / τ. A knock-in’s rebate is paid at expiry if it never knocks in, a knock-out’s when it is hit. The spot is assumed on the live side of the barrier and the variance positive.
black76
The Black-76 forward-lognormal price, undiscounted.
black76_implied_vol
The Black-76 volatility implying price, by bisection.
critical_on_future 🔒
The Barone-Adesi–Whaley critical futures price, on passive values: value matching solved by Newton safeguarded by a bracket — (K, ∞) for a call, (0, K) for a put — widened until it brackets.
value_matching 🔒
Value matching g(S) = ω(S − K) − v(S) − ω(1 − discount·N(ω·d₁(S)))·S/q at the futures price s — zero at the critical price — and its slope in s, in the mode the vol, the discount and the exponent carry.