American-transaction costs 1.0.0.0
American option pricer under proportional transaction costs
FlexibleTreeTrinomial Class Reference

Flexible trinomial tree with proportional transaction costs. More...

#include <trinomial.h>

Inheritance diagram for FlexibleTreeTrinomial:
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
 FlexibleTreeTrinomial (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< Portfoliohedge (const size_t scenario, const TreeProduct &product, const coefficient shares=0.0) const
StatisticsGathererPath< Portfoliohedge (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
size_t nodes (const size_t n) const
path_type path (const size_t scenario) const
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
size_t scenario (const path_type &path) const
size_t scenarios () const
std::vector< Spotspot (const size_t n) const
void spot_function (const size_t n, std::vector< Spot > &spot) const
StatisticsGathererPath< Spotspot_path (const size_t scenario) const
StatisticsGathererPath< Spotspot_path (const path_type &course) const
void spot_path_function (StatisticsGathererPath< Spot > &gather_spot) const
path_type successors (const size_t n, const size_t k) const
void successors_function (const size_t n, const size_t k, path_type &successors) const
coefficient T () const
std::vector< path_typewith_siblings (const path_type &path) const

Detailed Description

Flexible trinomial tree with proportional transaction costs.

The underlying stock price $ S\left(\frac{kT}{N}\right) $ at time step $ k $ takes the form

\[ S\left(\frac{kT}{N}\right) = S\left(\frac{(k-1)T}{N}\right)\exp\left\{X_k\sqrt{\int_{\frac{(k-1)T}{N}}^{\frac{kT}{N}}\sigma^2(t)dt} + \int_{\frac{(k-1)T}{N}}^{\frac{kT}{N}}\kappa(t)\sigma^2(t)dt\right\}, \]

where $ X_k \in\left\{1,0,-1\right\} $.

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

Constructor & Destructor Documentation

FlexibleTreeTrinomial::FlexibleTreeTrinomial ( 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:
SInitial stock price
sigmaStock price volatility
kappa_sigma_squareStock price drift
rShort rate
muBid price premium
lambdaAsk price premium
NNumber of steps
TMaturity date

Member Function Documentation

coefficient FlexibleTree::accumulate ( const size_t  n) const [inline, inherited]

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

coefficient FlexibleTree::discount ( const size_t  n) const [inline, inherited]

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

coefficient FlexibleTree::drift ( const size_t  n) const [inline, inherited]

Drift over one step from n dt() to (n + 1)dt(). The formula is $ \int_{t_1}^{t_2}\kappa(t)\sigma^2(t)dt $, where $t_1$ is n dt() and $t_2$ is (n +1)dt().

coefficient FlexibleTree::dt ( ) const [inline, inherited]

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 [inherited]

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 $ \chi $ and $ p $ in the interval $[0,1]$ and $ x $, $ y $ and $ S $ in the bid-ask interval has the property that $ x[n][k] = \chi[n]S[n]+(1-\chi[n])y[n] $ for all $ n $ and nodes $ k $ and $ y[n]accumulate(n) = \sum_{k=1}^mp[n+1][m]x[n+1][m] $ for all $n$ 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 [inherited]

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 [inherited]

Computes superreplicating strategy for an option.

Parameters:
pathScenario in which to superreplicate
productObjective to superreplicate
sharesInitial 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 $ k $-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, inherited]

Computes superreplicating strategy for an option.

Parameters:
scenarioScenario in which to superreplicate
productObjective to superreplicate
sharesInitial 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 $ k $-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 [inherited]

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, inherited]

Jump over one step from n dt() to (n + 1)dt(). The formula is $ \sqrt{\int_{t_1}^{t_2}\sigma^2(s)ds} $ where $t_1$ is n dt() and $t_2$ is (n +1)dt().

coefficient FlexibleTree::lambda ( const size_t  n) const [inline, inherited]

Ask price premium at step n.

coefficient FlexibleTree::logS ( ) const [inline, inherited]

Logarithm of initial stock price.

coefficient FlexibleTree::mu ( const size_t  n) const [inline, inherited]

Bid price discount at step n.

size_t FlexibleTree::N ( ) const [inline, inherited]

Number of steps.

size_t FlexibleTreeTrinomial::nodes ( const size_t  n) const [virtual]

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

Implements FlexibleTree.

path_type FlexibleTreeTrinomial::path ( const size_t  scenario) const [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:
scenarioIndex 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().

Implements FlexibleTree.

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

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 [inherited]

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.

size_t FlexibleTreeTrinomial::scenario ( const path_type path) const [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

Implements FlexibleTree.

size_t FlexibleTreeTrinomial::scenarios ( ) const [virtual]

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

Implements FlexibleTree.

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

Spot prices at time step n, indexed by node.

void FlexibleTreeTrinomial::spot_function ( const size_t  n,
std::vector< Spot > &  spot 
) const [virtual]

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

Implements FlexibleTree.

StatisticsGathererPath<Spot> FlexibleTree::spot_path ( const path_type course) const [inline, inherited]

Stock price path for given scenario.

StatisticsGathererPath<Spot> FlexibleTree::spot_path ( const size_t  scenario) const [inline, inherited]

Stock price path for given scenario.

void FlexibleTreeTrinomial::spot_path_function ( StatisticsGathererPath< Spot > &  gather_spot) const [virtual]

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

Implements FlexibleTree.

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

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

void FlexibleTreeTrinomial::successors_function ( const size_t  n,
const size_t  k,
path_type successors 
) const [virtual]

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

Implements FlexibleTree.

coefficient FlexibleTree::T ( ) const [inline, inherited]

Maturity date.

std::vector<path_type > FlexibleTree::with_siblings ( const path_type path) const [inline, inherited]

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

Parameters:
pathAn (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:
 All Classes Namespaces Files Functions Variables Typedefs Defines