option_value module

option_value.price_option(s, k, r, T, call_put='call', option_type='european')[source]

Calculate the time 0 value of an option.

Paths s are constructed from gbm_simulator.simulate_gbm().

The unique thing about this approach is that it takes advantage of Python allowing functions to be first class objects. The correct option pricing function is constructed, and the passed up as the variable pricing_method.

Parameters:
  • s (Numpy array) – The simulated paths of the option.
  • k (double) – The strike price for the option.
  • r (double) – The risk free interest rate to discount at.
  • T (double) – The expiration date of the option. Used to discount.
  • call_put ({"call", "put"}, default "call") – Specifications for the side of the option to price.
  • option_type ({"european", "american"}, default "european") – The type of option to price.
Returns:

price – The Monte Carlo value of the option

Return type:

double