option_value_dispatch module

option_value_dispatch.american(call_put_option_price_at_T)[source]

Formulate a function that prices an American option.

This method prices the option using a regression method. The continuation value at time t is calculated by regressing the discounted value of the option at time t+1 on the price at time t. The continuation value is then compared to the value of the payoff at time t, and the max is chosen as the value of the option at t.

The regression method is well documented here.

Parameters:call_put_option_price_at_T (function) – A pricing function that prices the value of the option at T. This is different depending on whether the option is a call or a put.
Returns:pricing_method – A function that prices the specified type of option.
Return type:function

See also

european()

option_value_dispatch.dispatch_pricing_method(call_put='call', option_type='european')[source]

Formulate the correct option pricing function from user inputs.

Called by option_value.price_option().

Parameters:
  • 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:

pricing_method – A function that prices the specified type of option

Return type:

function

option_value_dispatch.european(call_put_option_price_at_T)[source]

Formulate a function that prices a European option.

This method discounts the time T values of the payoffs calculated from the simulations back to time 0, then takes an average.

Parameters:call_put_option_price_at_T (function) – A pricing function that prices the value of the option at T. This is different depending on whether the option is a call or a put.
Returns:pricing_method – A function that prices the specified type of option
Return type:function

See also

american()

option_value_dispatch.option_price_at_T_call(s_T, k)[source]

Return a function that calculates the value of a call option at time T

The value of the option is calculated as, \(max(S_T - K, 0)\)

Parameters:
  • s_T (vector) – The simulated paths at time T
  • k (double) – The strike price for the option.
Returns:

v_T – The price of the call option at time T

Return type:

vector

option_value_dispatch.option_price_at_T_put(s_T, k)[source]

Return a function that calculates the value of a put option at time T

Parameters:
  • s_T (vector) – The simulated paths at time T
  • k (double) – The strike price for the option.
Returns:

v_T – The price of the put option at time T

Return type:

vector