robustfpm.pricing.problem module

This submodule implements a Problem class that incapsulates a problem of pricing and hedging an option under a robust financial portfolio management framework and solver classes for solving such problems: ISolver as an interface and some realisations.

class robustfpm.pricing.problem.Problem(starting_price, price_dynamics, trading_constraints, option, lattice, time_horizon=None, solver=None)

Bases: object

A class representing a problem of pricing and hedging an option under a robust financial portfolio management framework.

Parameters
  • starting_price (np.ndarray, size = (n,)) – Starting prices of assets, as points from \(\mathbb{R}^{n}\)

  • price_dynamics (PriceDynamics) – Price dynamics of a problem. Must be defined for all t <= time_horizon.

  • trading_constraints (IMultivalMap) – A mapping \(D_t(\cdot)\), representing trading constraints

  • option (IOption) – An option (portfolio) to price (and hedge)

  • lattice (Lattice) – A lattice to solve problem on

  • time_horizon (int, optional) – Time horizon \(N\). If not given, then deduced from option expiration and price_dynamics (if possible).

get_precision()

Calculates the precision of given problem

Returns

Precision for value function

Return type

float

Notes

This is not implemented

set_precision(precision)

Changes lattice to match given precision

Parameters

precision (float) – target precision

Notes

This is not implemented

class robustfpm.pricing.problem.ISolver

Bases: abc.ABC

abstract solve(problem, calc_hedge=False)

Solves a given problem and calculates hedging strategy (if calc_hedge is True)

Parameters
  • problem (Problem) – Problem to solve

  • calc_hedge (bool, optional, default = False) – If True, also tries to return hedging strategy

Returns

solution – a dictionary, representing the solution, where:

  • Solution['Vf'] is a list of values of value function

  • Solution['Vx'] is a list of points on problem.lattice where Vf is calculated

  • Solution['hedge'] (optional) is a hedging strategy.

Return type

dict

class robustfpm.pricing.problem.ConvhullSolver(debug_mode=False, ignore_warnings=False, enable_timer=False, iter_tick=1000, profiler_data=None, calc_market_strategies=False, pricer_options=None)

Bases: robustfpm.pricing.problem.ISolver

Represents the numerical solver to the option pricing problem under the robust financial portfolio management framework.

This solver uses the convex hull algorithm.

Parameters
  • debug_mode (boolean) – If True, debug information is displayed during execution. Default is False.

  • ignore_warnings (boolean) – If True, warnings from the linprog optimization procedures are not displayed. Default is False.

  • enable_timer (boolean) – If True, profiler information will be displayed during execution. Default is False.

  • iter_tick (int) – If enable_timer is True, then timer will tick, on average, each iter_tick iteration. Default is 1000.

  • profiler_data (class:'ProfilerData') – Profiler data, to which the execution timing can be appended to. If None, a new profiler data object will be created. Default is None.

  • calc_market_strategies (boolean) – If True, adverse market strategies at every step will calculated. Not used for pricing. True leads to the slower execution speed. Default is False.

  • pricer_options (dict) – Additional numerical method options. Reserved for future versions.

See also

robustfpm.pricing.option_pricer_RU.OptionPricer

solve(problem, calc_hedge=False)

Solves a given problem and calculates hedging strategy (if calc_hedge is True)

Parameters
  • problem (Problem) – Problem to solve

  • calc_hedge (bool, optional, default = False) – If True, also tries to return hedging strategy

Returns

solution – a dictionary, representing the solution, where:

  • Solution['Vf'] is a list of values of value function

  • Solution['Vx'] is a list of points on problem.lattice where Vf is calculated

  • Solution['hedge'] (optional) is a hedging strategy.

Return type

dict