Crate binomial_tree

Source
Expand description

Binomial tree approach to pricing options. This approach is extremely general. It allows pricing of any style option when the underlying is a 1-dimensional diffusion. Currently only European and American optionality is provided but it isn’t difficult to add Bermudan optionality. The approach works by transforming a diffusion into a pure Brownian component and building a tree off the pure Browning component. Given a diffusion dX=alpha(X, t)dt+sigma(X, t)dW, the user must specify the function alpha(X, t)/sigma(X, t), the function sigma’(X, t) (the derivative of sigma with respect to X), and the inverse function of the indefinite integral of 1/sigma(y, t) with respect to y.

Functions§

compute_price_american
Returns American option price using tree method
compute_price_raw
Returns price using tree method
get_all_t
Returns iterator over every t except the maturity
get_dt
Returns increment of t between time steps
get_t
Returns t at some time step