American-transaction costs 1.0.0.0 American option pricer under proportional transaction costs

- Main Page
- Namespaces
- Classes
- Files
- Directories

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions
FlexibleTree Class Reference

`#include <flexibletree.h>`

Inheritance diagram for FlexibleTree:

List of all members.

## Public Member Functions
coefficient | accumulate (const size_t n) const
coefficient | discount (const size_t n) const
coefficient | drift (const size_t n) const
coefficient | dt () const
void | EMM_exercise_function (const TreeProductAmericanSeller &product, const StatisticsGathererPath< Spot > &gather_spot, const StatisticsGathererSome< PiecewiseLinear > &gather_current_hedge, const StatisticsGathererPath< PiecewiseLinear > &gather_future_hedge, StatisticsGathererSome< coefficient > &value, StatisticsGathererPath< coefficient > &chi, StatisticsGathererSome< coefficient > &x, StatisticsGathererPath< coefficient > &y, StatisticsGathererPath< coefficient > &S, StatisticsGathererSome< coefficient > &p, StatisticsGatherer< Portfolio > &strategy, const coefficient shares=0.0) const
void | exercise_function (const TreeProductAmericanBuyer &product, const StatisticsGathererPath< Spot > &gather_spot, const StatisticsGathererPath< Portfolio > &strategy, StatisticsGathererPath< int > &decision) const
| FlexibleTree (const coefficient &S, const ParameterIntegrableBridge &sigma, const ParameterIntegrableBridge &kappa_sigma_square, const ShortRate &r, const ParameterBridge &mu, const ParameterBridge &lambda, const size_t N, const coefficient &T)
StatisticsGathererPath< Portfolio > | hedge (const size_t scenario, const TreeProduct &product, const coefficient shares=0.0) const
StatisticsGathererPath< Portfolio > | hedge (const path_type &path, const TreeProduct &product, const coefficient shares=0.0) const
void | hedging_function (const TreeProduct &product, const StatisticsGathererPath< Spot > &gather_spot, const PiecewiseLinear &current_hedge, const StatisticsGathererPath< PiecewiseLinear > &gather_future_hedge, StatisticsGathererPath< Portfolio > &strategy, const coefficient shares=0.0) const
coefficient | jump (const size_t n) const
coefficient | lambda (const size_t n) const
coefficient | logS () const
coefficient | mu (const size_t n) const
size_t | N () const
virtual size_t | nodes (const size_t n) const =0
virtual path_type | path (const size_t scenario) const =0
coefficient | price (const TreeProduct &product, const Portfolio &wealth=Portfolio(0, 0)) const
void | pricing_function (const TreeProduct &product, StatisticsGatherer< Spot > &gather_spot, StatisticsGatherer< PiecewiseLinear > &gather_current_hedge, StatisticsGatherer< PiecewiseLinear > &gather_future_hedge) const
virtual size_t | scenario (const path_type &path) const =0
virtual size_t | scenarios () const =0
std::vector< Spot > | spot (const size_t n) const
virtual void | spot_function (const size_t n, std::vector< Spot > &spot) const =0
StatisticsGathererPath< Spot > | spot_path (const path_type &course) const
StatisticsGathererPath< Spot > | spot_path (const size_t scenario) const
virtual void | spot_path_function (StatisticsGathererPath< Spot > &gather_spot) const =0
path_type | successors (const size_t n, const size_t k) const
virtual void | successors_function (const size_t n, const size_t k, path_type &successors) const =0
coefficient | T () const
std::vector< path_type > | with_siblings (const path_type &path) const

## Detailed Description

Flexible tree with proportional transaction costs.

Author:
  Alet Roux <alet.roux@york.ac.uk>

The value of the friction-free stock price at time step takes the form

for some discrete random variable , with . The bid price at time is then given by and the ask price by .

## Constructor & Destructor Documentation

FlexibleTree::FlexibleTree | ( | const coefficient & | S,
|  | const ParameterIntegrableBridge & | sigma,
|  | const ParameterIntegrableBridge & | kappa_sigma_square,
|  | const ShortRate & | r,
|  | const ParameterBridge & | mu,
|  | const ParameterBridge & | lambda,
|  | const size_t | N,
|  | const coefficient & | T
| ) |  |

Constructor.

Parameters:

  S | Initial stock price
  sigma | Stock price volatility
  kappa_sigma_square | Stock price drift
  r | Short rate
  mu | Bid price premium
  lambda | Ask price premium
  N | Number of steps
  T | Maturity date

## Member Function Documentation

coefficient FlexibleTree::accumulate | ( | const size_t | n | ) | const`[inline]`

Interest accumulation factor over one step from n dt() to (n +1) dt()

coefficient FlexibleTree::discount | ( | const size_t | n | ) | const`[inline]`

Discount factor over one step from (n + 1) dt() to n dt()

coefficient FlexibleTree::drift | ( | const size_t | n | ) | const`[inline]`

Drift over one step from n dt() to (n + 1)dt(). The formula is , where is n dt() and is (n +1)dt().

coefficient FlexibleTree::dt | ( |  | ) | const`[inline]`

Time between steps.

void FlexibleTree::EMM_exercise_function | ( | const TreeProductAmericanSeller & | product,
|  | const StatisticsGathererPath< Spot > & | gather_spot,
|  | const StatisticsGathererSome< PiecewiseLinear > & | gather_current_hedge,
|  | const StatisticsGathererPath< PiecewiseLinear > & | gather_future_hedge,
|  | StatisticsGathererSome< coefficient > & | value,
|  | StatisticsGathererPath< coefficient > & | chi,
|  | StatisticsGathererSome< coefficient > & | x,
|  | StatisticsGathererPath< coefficient > & | y,
|  | StatisticsGathererPath< coefficient > & | S,
|  | StatisticsGathererSome< coefficient > & | p,
|  | StatisticsGatherer< Portfolio > & | strategy,
|  | const coefficient | shares = `0.0`
| ) |  | const

Service method. Computation of optimal equivalent martingale measure for product, with optimal superreplication strategy as side effect. The parameters gather_current_hedge and gather_future_hedge must have been part of the output of a run of pricing_function. The parameters spot, gather_current_hedge, gather_future_hedge, value, chi, x, y, S, p and strategy must pertain to the same scenario (enriched by adding relevant successor nodes): this is not checked. The processses and in the interval and , and in the bid-ask interval has the property that for all and nodes and for all before N() and where the sum is taken over successors.

void FlexibleTree::exercise_function | ( | const TreeProductAmericanBuyer & | product,
|  | const StatisticsGathererPath< Spot > & | gather_spot,
|  | const StatisticsGathererPath< Portfolio > & | strategy,
|  | StatisticsGathererPath< int > & | decision
| ) |  | const

Service method. Computes stopping time for the buyer of an option. The input strategy must superreplicate product for the buyer, and must correspond to the same scenario as gather_spot (this is not checked).

StatisticsGathererPath<Portfolio> FlexibleTree::hedge | ( | const path_type & | path,
|  | const TreeProduct & | product,
|  | const coefficient | shares = `0.0`
| ) |  | const

Computes superreplicating strategy for an option.

Parameters:

  path | Scenario in which to superreplicate
  product | Objective to superreplicate
  shares | Initial share holding. The cash holding is adjusted to reflect the cost of superreplication

Returns:
  Sequence of N()+1 portfolios where the first portfolio is the initial hedging potfolio (with share holding wealth.shares()) and the -th portfolio is held between (k-1)dt() and k dt()

StatisticsGathererPath<Portfolio> FlexibleTree::hedge | ( | const size_t | scenario,
|  | const TreeProduct & | product,
|  | const coefficient | shares = `0.0`
| ) |  | const`[inline]`

Computes superreplicating strategy for an option.

Parameters:

  scenario | Scenario in which to superreplicate
  product | Objective to superreplicate
  shares | Initial share holding. The cash holding is adjusted to reflect the cost of superreplication

Returns:
  Sequence of N()+1 portfolios where the first portfolio is the initial hedging potfolio (with share holding wealth.shares()) and the -th portfolio is held between (k-1)dt() and k dt()

void FlexibleTree::hedging_function | ( | const TreeProduct & | product,
|  | const StatisticsGathererPath< Spot > & | gather_spot,
|  | const PiecewiseLinear & | current_hedge,
|  | const StatisticsGathererPath< PiecewiseLinear > & | gather_future_hedge,
|  | StatisticsGathererPath< Portfolio > & | strategy,
|  | const coefficient | shares = `0.0`
| ) |  | const

Service method. Computation of superreplicating strategy for an option. The parameters current_hedge, gather_spot and gather_future_hedge must have been part of the output of a run of pricing_function (where current_hedge is the initial hedging function). The parameters gather_spot, portfolios and gather_future_hedge must pertain to the same scenario (this is not checked).

coefficient FlexibleTree::jump | ( | const size_t | n | ) | const`[inline]`

Jump over one step from n dt() to (n + 1)dt(). The formula is where is n dt() and is (n +1)dt().

coefficient FlexibleTree::lambda | ( | const size_t | n | ) | const`[inline]`

Ask price premium at step n.

coefficient FlexibleTree::logS | ( |  | ) | const`[inline]`

Logarithm of initial stock price.

coefficient FlexibleTree::mu | ( | const size_t | n | ) | const`[inline]`

Bid price discount at step n.

size_t FlexibleTree::N | ( |  | ) | const`[inline]`

Number of steps.

virtual size_t FlexibleTree::nodes | ( | const size_t | n | ) | const`[pure virtual]`

Number of nodes at time step n. Nodes at time step n are numbered from 0 to nodes(n)-1.

Implemented in FlexibleTreeBinomial, and FlexibleTreeTrinomial.

virtual path_type FlexibleTree::path | ( | const size_t | scenario | ) | const`[pure virtual]`

Turns scenario code into path. Each scenario is given a unique positive number, which corresponds uniquely to the path of the stock price in that scenario.

Parameters:

  scenario | Index number of scenario

Returns:
  (N()+1)-dimensional std::vector of node numbers, with the k-th entry being the node number at time k dt().

Implemented in FlexibleTreeBinomial, and FlexibleTreeTrinomial.

coefficient FlexibleTree::price | ( | const TreeProduct & | product,
|  | const Portfolio & | wealth = `Portfolio (0,0)`
| ) |  | const`[inline]`

Price at time 0 of product for an investor with initial wealth wealth.

void FlexibleTree::pricing_function | ( | const TreeProduct & | product,
|  | StatisticsGatherer< Spot > & | gather_spot,
|  | StatisticsGatherer< PiecewiseLinear > & | gather_current_hedge,
|  | StatisticsGatherer< PiecewiseLinear > & | gather_future_hedge
| ) |  | const

Service method. Pricing function at time 0 of product that allows gathering of statistics for use outside this class. Application of product.current_price() to the first value of gather_future_hedge yields the initial price.

virtual size_t FlexibleTree::scenario | ( | const path_type & | path | ) | const`[pure virtual]`

Turns path into scenario code. Each scenario is given a unique positive number, which corresponds uniquely to the path of the stock price in that scenario.

Parameters:

  path | (N()+1)-dimensional std::vector of node numbers, with the k-th entry being the node number at time k dt()

Returns:
  Index number of scenario

Implemented in FlexibleTreeBinomial, and FlexibleTreeTrinomial.

virtual size_t FlexibleTree::scenarios | ( |  | ) | const`[pure virtual]`

Number of scenarios. Scenarios are numbered from 0 to scenarios()-1.

Implemented in FlexibleTreeBinomial, and FlexibleTreeTrinomial.

std::vector<Spot> FlexibleTree::spot | ( | const size_t | n | ) | const`[inline]`

Spot prices at time step n, indexed by node.

virtual void FlexibleTree::spot_function | ( | const size_t | n,
|  | std::vector< Spot > & | spot
| ) |  | const`[pure virtual]`

Service method. Spot prices at time step n, indexed by node.

Implemented in FlexibleTreeBinomial, and FlexibleTreeTrinomial.

StatisticsGathererPath<Spot> FlexibleTree::spot_path | ( | const size_t | scenario | ) | const`[inline]`

Stock price path for given scenario.

StatisticsGathererPath<Spot> FlexibleTree::spot_path | ( | const path_type & | course | ) | const`[inline]`

Stock price path for given scenario.

virtual void FlexibleTree::spot_path_function | ( | StatisticsGathererPath< Spot > & | gather_spot | ) | const`[pure virtual]`

Service method. Computes stock price path for scenario to which gather_spot has been initialised.

Implemented in FlexibleTreeBinomial, and FlexibleTreeTrinomial.

path_type FlexibleTree::successors | ( | const size_t | n,
|  | const size_t | k
| ) |  | const`[inline]`

Nodes at time step n + 1 that succeed node k at time step n.

virtual void FlexibleTree::successors_function | ( | const size_t | n,
|  | const size_t | k,
|  | path_type & | successors
| ) |  | const`[pure virtual]`

Service method. Nodes at time step n + 1 that succeed node k at time step n.

Implemented in FlexibleTreeBinomial, and FlexibleTreeTrinomial.

coefficient FlexibleTree::T | ( |  | ) | const`[inline]`

Maturity date.

std::vector<path_type > FlexibleTree::with_siblings | ( | const path_type & | path | ) | const`[inline]`

Extends stock price path to include siblings of those nodes already on the path.

Parameters:

  path | An (N()+1)-dimensional std::vector of node numbers, with the k-th entry being the node number at time k dt().

Returns:
  A std::vector of node std::vectors, with the (t,k)-th entry being a node at time t dt().

The documentation for this class was generated from the following files:

- flexibletree/flexibletree.h
- flexibletree/flexibletree.cpp

All Classes Namespaces Files Functions Variables Typedefs Defines