

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object Options.Option
Interface and default methods to price and hedge a possibly path * path dependent European option on a single underlying asset.
* *We define a variety of methods by providing an implementation * which prints an error message and aborts the program. Admittedly * this is less elegant than throwing an exception but sorry I am too lazy * to write all these trycatch blocks. Mostly a call to such a method * when it is undefined is a fatal error in any case.
* *It would be more elegant to define these methods as abstract but then * each concrete subclass has to implement them in some way. Proceeding * as we do we only have to implement what we need.
* *Fundamental methods which must have nontrivial implementations in each * concrete subclass are declared as abstract if they cannot be implemented * at this level of generality.
* *Pricing: analytic option prices (if analytic formulas exist) and * Monte Carlo prices with and without control variates are computed.
* * Default control variate: as default control * variate for the discounted option payoff we use the discounted * price S[T]=S^B(t) of the underlying at expiration simulated under the * risk neutral probability. * *Note that exp(qt)S^B(t) is a martingale in the risk neutral probability * P_B. Thus the conditional control variate mean is given as * E^{P_B}_t[S^B(T)]=exp(q(Tt))S^B(t). * See book, chapter 3, section 1, equation 3.15.
* *Hedging: The profit and loss of * hedging the option using various hedge deltas:
*is analyzed by computing mean and standard deviation from a sample of * price paths of the underlying asset. See the file "HedgeWeights.ps" * for the details.
* *Information: the information available * at time t for conditioning is the history of the price path of the * underlying asset on the interval [0,t] (up to the present). * Conditioning on this information means to limit simulations of the price * of the underlying asset to paths which are branches of the current path where * branching occurs at time t.
* *Warning: the abstract class Option
does not initialize
* the option price path. This is left to the concrete subclasses which can
* decide wether analytic price formulas are available or not.
Field Summary  
static int 
ANALYTIC_DELTA
Flag identifying hedge weights. 
static int 
ANALYTIC_MINIMUM_VARIANCE_DELTA
Flag identifying hedge weights. 
static int 
ANALYTIC_QUOTIENT_DELTA
Flag identifying hedge weights. 
static int 
MARKET_PROBABILITY
Flag indicating probability controlling paths of the underlying. 
static int 
MINIMUM_VARIANCE_DELTA
Flag identifying hedge weights. 
static int 
MONTE_CARLO_DELTA
Flag identifying hedge weights. 
static int 
QUOTIENT_DELTA
Flag identifying hedge weights. 
static int 
RISK_NEUTRAL_PROBABILITY
Flag indicating probability controlling paths of the underlying. 
Constructor Summary  
Option(Asset asset,
java.lang.String name)
Constructor, does not initialize the option price path. 
Method Summary  
double 
analyticDelta(int t)
Delta dC/dS computed from discounted analytic price
* C(t) Implementation at this level
* is an error message and program exit. 
double 
analyticGamma(int t)
Gamma d^2C/dS^2 computed from discounted analytic price
* C(t) . 
double 
analyticMinimumVarianceDelta(int whichProbability,
int t)
Analytic approximation to the minimumVarianceDelta(int, int, int) hedge
* weights. 
double 
analyticQuotientDelta(int t)
Analytic approximation to the quotientDelta(int, int) hedge
* weights. 
double 
analyticSGamma(int t)
S(t)*Gamma(t) . 
double 
analyticTheta(int t)
Theta dC/dt computed from discounted analytic price
* C(t) . 
double 
analyticThetaDelta(int t)
Theta of delta dDelta/dt computed from discounted analytic
* price C(t) . 
double 
analyticVega(int t)
Vega dC/dsigma computed from discounted analytic price
* C(t) . 
double 
conditionalControlVariateCorrelation(int t,
int nPaths)
Correlation of the discounted payoff with the control * variate conditioned on information * available at time t. 
double 
controlledDiscountedMonteCarloPrice(double precision,
double confidence,
int nSignChange)
Monte Carlo price at time t=0 using the * default control variate * with price paths of the underlying simulated until desired precision is * reached with desired confidence. 
double 
controlledDiscountedMonteCarloPrice(int nPath)
Monte Carlo price at time t=0 computed using the * default control variate. 
double 
controlledDiscountedMonteCarloPrice(int t,
double precision,
double confidence,
int nSignChange)
Monte Carlo price at time t using the * default control variate * with price paths of the underlying simulated until desired precision is * reached with desired confidence. 
double 
controlledDiscountedMonteCarloPrice(int t,
int nPath)
Monte Carlo price at time t computed using the * default control variate. 
ControlledRandomVariable 
controlledDiscountedPayoff()
The discounted payoff as a controlled random variable using the * default control variate. 
double 
controlVariateCorrelation(int nPaths)
Correlation of the discounted payoff with the control variate at * time t=0 (no information to condition on). 
double 
currentDiscountedHedgeGain(int whichDelta,
int whichProbability,
int nBranch,
double fixed_trc,
double prop_trc)
HEDGE ERROR: The discounted profit and loss of hedging a short * position in one call on one share of the underlying along one path of the * underlying. 
abstract double 
currentDiscountedPayoff()
Option payoff discounted to time t=0 and computed from the current * discounted price path of the underlying. 
double 
discountedAnalyticPrice(int t)
Discounted option price C(t) . 
RandomVariable 
discountedHedgeGain(int whichDelta,
int whichProbability,
int nBranch,
double fixed_trc,
double prop_trc)
The hedge gain as a random variable. 
double 
discountedMonteCarloPrice(double precision,
double confidence,
int nSignChange)
Monte Carlo price at time t=0 * with price paths of the underlying simulated until desired precision is * reached with desired confidence. 
double 
discountedMonteCarloPrice(int nPath)
Monte Carlo option price at time t=0. 
double 
discountedMonteCarloPrice(int t,
double precision,
double confidence,
int nSignChange)
Monte Carlo price at time t computed as a conditional expectation * conditioned on information available at time t * with price paths of the underlying simulated until desired precision is * reached with desired confidence. 
double 
discountedMonteCarloPrice(int t,
int nPath)
Monte Carlo price at time t computed as a conditional expectation * conditioned on information available at time t * and computed from a sample of nPath (branches of) the price path of the * underlying. 
RandomVariable 
discountedPayoff()
The discounted option payoff as a random variable. 
double[] 
get_C()
Reference to the array C[ ] containing the discounted option * price path. 
double 
get_dt()
Size of time step. 
int 
get_T()
Number of time steps to horizon. 
Asset 
get_underlying()
Reference to the underlying asset. 
java.lang.String 
getName()
The name of the option (a string). 
boolean 
hasAnalyticPrice()
True if and analytic formula for the option price
* is implemented, false otherwise. 
double 
minimumVarianceDelta(int whichProbability,
int t,
int nPath)
The minimum variance delta at time t (see file "HedgeWeights.ps") * minimizing the squared hedge error over the next time step. 
double 
minimumVarianceDelta(int whichProbability,
int t,
int nPath,
Trigger rebalance)
Same as minimumVarianceDelta(int,int,int) but the
* hedge is rebalanced when the next hedge trade is triggered and the
* squared error minimized over the stochastic time interval until
* the next hedge trade. 
double 
monteCarloDelta(int t,
int nPath)
The Monte Carlo delta at time t (see file "HedgeWeights.ps"). 
void 
newDiscountedPricePath(int whichProbability,
int nPath)
Computes one path of the underlying S and a corresponding path C of the * option (discounted prices). 
double 
quotientDelta(int t,
int nPath)
Weight w=E^P_t(\DeltaC(t))/E^P_t(\DeltaS(t)) mich makes the * conditional mean of the hedge error between hedge trades equal to zero. 
double 
quotientDelta(int t,
int nPath,
Trigger rebalance)
Same as quotientDelta(int,int) but the
* hedge is rebalanced when the next hedge trade is triggered. 
boolean 
underlyingIsCVA()
Returns true if the underlying is a
* ConstantVolatilityAsset , false otherwise. 
boolean 
underlyingIsDividendFreeCVA()
Returns true if the underlying is a dividend free
* ConstantVolatilityAsset , false otherwise. 
Methods inherited from class java.lang.Object 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
Field Detail 
public static final int MARKET_PROBABILITY
public static final int RISK_NEUTRAL_PROBABILITY
public static final int MINIMUM_VARIANCE_DELTA
public static final int ANALYTIC_MINIMUM_VARIANCE_DELTA
public static final int MONTE_CARLO_DELTA
public static final int ANALYTIC_DELTA
public static final int QUOTIENT_DELTA
public static final int ANALYTIC_QUOTIENT_DELTA
Constructor Detail 
public Option(Asset asset, java.lang.String name)
Constructor, does not initialize the option price path. * This is left to the concrete subclasses which can * decide wether analytic price formulas are available or not.
* * @param asset the underlying asset. * @param name name of the option.
Method Detail 
public int get_T()
public double get_dt()
public double[] get_C()
public java.lang.String getName()
public Asset get_underlying()
public boolean hasAnalyticPrice()
True
if and analytic formula for the option price
* is implemented, false
otherwise.
public boolean underlyingIsCVA()
true
if the underlying is a
* ConstantVolatilityAsset
, false
otherwise.
*
public boolean underlyingIsDividendFreeCVA()
true
if the underlying is a dividend free
* ConstantVolatilityAsset
, false
otherwise.
*
public abstract double currentDiscountedPayoff()
public RandomVariable discountedPayoff()
public ControlledRandomVariable controlledDiscountedPayoff()
The discounted payoff as a controlled random variable using the * default control variate. * Underlying is modelled in the risk neutral probability.
public double conditionalControlVariateCorrelation(int t, int nPaths)
Correlation of the discounted payoff with the control * variate conditioned on information * available at time t. * Underlying is modelled in the risk neutral probability.
* *This method is used only to examine the quality of a control variate. * thus we forgo efficiency and simply reduce it to a random vector * correlation computation.
* * @param t current time. * @param nPaths number of paths generated to estimate the correlation.
public double controlVariateCorrelation(int nPaths)
Correlation of the discounted payoff with the control variate at * time t=0 (no information to condition on). * Underlying is modelled in the risk neutral probability.
* *Unconditional version of
* conditionalControlVariateCorrelation(int,int)
.
public double discountedAnalyticPrice(int t)
Discounted option price C(t)
. Implementation at this level
* is an error message and program exit. Overridden in subclasses where a
* nontrivial implementation is possible.
public double analyticDelta(int t)
Delta dC/dS
computed from discounted analytic price
* C(t)
Implementation at this level
* is an error message and program exit. Overridden in subclasses where a
* nontrivial implementation is possible.
public double analyticTheta(int t)
Theta dC/dt
computed from discounted analytic price
* C(t)
. Implementation at this level
* is an error message and program exit. Overridden in subclasses where a
* nontrivial implementation is possible.
public double analyticVega(int t)
Vega dC/dsigma
computed from discounted analytic price
* C(t)
. Implementation at this level
* is an error message and program exit. Overridden in subclasses where a
* nontrivial implementation is possible.
public double analyticGamma(int t)
Gamma d^2C/dS^2
computed from discounted analytic price
* C(t)
. Implementation at this level
* is an error message and program exit. Overridden in subclasses where a
* nontrivial implementation is possible.
public double analyticSGamma(int t)
S(t)*Gamma(t)
. It's not defined here like that since it
* is often easier to implement than Gamma(t) and can then be used to
* implement Gamma(t)
. Implementation at this level
* is an error message and program exit. Overridden in subclasses where a
* nontrivial implementation is possible.
public double analyticThetaDelta(int t)
Theta of delta dDelta/dt
computed from discounted analytic
* price C(t)
. Implementation at this level
* is an error message and program exit. Overridden in subclasses where a
* nontrivial implementation is possible.
public double discountedMonteCarloPrice(int t, int nPath)
Monte Carlo price at time t computed as a conditional expectation * conditioned on information available at time t * and computed from a sample of nPath (branches of) the price path of the * underlying.
* *No standard deviation is computed so we do not need to pay attention to * the fact that paths of the uderlying may come in groups of dependent paths * (sign changes in standard normal increments).
* * @param t current time (determines information to condition on). * @param nPath number of path branches used to compute the option price.
public double discountedMonteCarloPrice(int nPath)
Monte Carlo option price at time t=0.
* * @param nPath number of asset price paths used to compute the option price.
public double discountedMonteCarloPrice(int t, double precision, double confidence, int nSignChange)
Monte Carlo price at time t computed as a conditional expectation * conditioned on information available at time t * with price paths of the underlying simulated until desired precision is * reached with desired confidence.
* *Note: underlying.newPathBranch simulates asset price paths in groups of
* dependent paths of size
* sampleGroupsize=underlying.nSignChange
.
public double discountedMonteCarloPrice(double precision, double confidence, int nSignChange)
Monte Carlo price at time t=0 * with price paths of the underlying simulated until desired precision is * reached with desired confidence.
* *See discountedMonteCarloPrice(int,double,double,int)
.
public double controlledDiscountedMonteCarloPrice(int t, int nPath)
Monte Carlo price at time t computed using the * default control variate.
* *Same discountedMonteCarloPrice(int,int)
using the
* default control variate.
public double controlledDiscountedMonteCarloPrice(int nPath)
Monte Carlo price at time t=0 computed using the * default control variate.
* *Same as controlledDiscountedMonteCarloPrice(int,int)
* at time t=0.
public double controlledDiscountedMonteCarloPrice(int t, double precision, double confidence, int nSignChange)
Monte Carlo price at time t using the * default control variate * with price paths of the underlying simulated until desired precision is * reached with desired confidence.
* *Same as controlledDiscountedMonteCarloPrice(int,int)
* but paths simulated until desired precision is reached with desired
* confidence.
Note: underlying.newPathBranch simulates asset price paths in groups of
* dependent paths of size
* sampleGroupsize=underlying.nSignChange
.
public double controlledDiscountedMonteCarloPrice(double precision, double confidence, int nSignChange)
Monte Carlo price at time t=0 using the * default control variate * with price paths of the underlying simulated until desired precision is * reached with desired confidence.
* *Same as
* controlledDiscountedMonteCarloPrice(int,double,double,int)
* at time t=0.
public void newDiscountedPricePath(int whichProbability, int nPath)
Computes one path of the underlying S and a corresponding path C of the * option (discounted prices).
* * @param whichProbability probability for simulation (risk neutral/market). * @param nPath number of asset price path branches used in the Monte Carlo * computation of the option price at each time step.
public double minimumVarianceDelta(int whichProbability, int t, int nPath)
The minimum variance delta at time t (see file "HedgeWeights.ps") * minimizing the squared hedge error over the next time step. If * the underlying evolves in the risk neutral probability, the stepwise * hedge error have zero mean and are uncorrelated. In this case these weights * minimize the step wise and cumulative hedge error variance.
* *It is assumed that a path S of the underlying has been computed * up to time t.
* *Use for hedges rebalancing at each time step. * No standard deviation is computed so we do not need to pay attention to * the fact that paths of the underlying may come in groups of dependent paths. * It's not efficient here to introduce random variables to compute * the conditional expectations, we do it directly.
* *WARNING: the computation is extremely slow (O(nPath^2)) if the * underlying evolves in the market probability and no analytic option * price is implemented. Otherwise it is O(nPath).
* * @param whichProbability probability for simulation (risk neutral/market). * @param t current time (time of branching). * @param nPath number of asset price path branches expended on each * conditional expectation.
public double minimumVarianceDelta(int whichProbability, int t, int nPath, Trigger rebalance)
Same as minimumVarianceDelta(int,int,int)
but the
* hedge is rebalanced when the next hedge trade is triggered and the
* squared error minimized over the stochastic time interval until
* the next hedge trade.
WARNING: the computation is extremely slow (O(nPath^2)) if the * underlying evolves in the market probability and no analytic option * price is implemented. Otherwise it is O(nPath).
* * @param whichProbability probability for simulation (risk neutral/market). * @param t current time (time of branching). * @param nPath number of asset price path branches expended on each * conditional expectation. * @param rebalance triggers the hedge trades.
public double monteCarloDelta(int t, int nPath)
The Monte Carlo delta at time t (see file "HedgeWeights.ps").
* *It is assumed that a price path of the underlying asset has been * computed up to time t. * No standard deviation is computed so we do not need to pay attention to * the fact that paths of the uderlying may come in groups of dependent paths. * It's not efficient here to introduce random variables to compute * the conditional expectations, we do it directly.
* *WARNING: this assumes that Z[t]=(W[t+1]W[t])/sqrt(dt)
,
* where W(t)
is the Brownian motion driving the paths of the
* underlying. Presently this is correct only for
* ConstantVolatilityAsset
s.
public double quotientDelta(int t, int nPath)
Weight w=E^P_t(\DeltaC(t))/E^P_t(\DeltaS(t)) mich makes the * conditional mean of the hedge error between hedge trades equal to zero. * Underlying must evolve in the market probability (otherwise denominator * is zero). Hedge rebalanced at each time step. See the file * "HedgeWeights.ps".
* *WARNING: the computation is extremely slow (O(nPath^2)) if the * underlying evolves in the market probability and no analytic option * price is implemented. Otherwise it is O(nPath).
* * @param t current time. * @param nPath number of path branches spent on each conditional expectation.
public double quotientDelta(int t, int nPath, Trigger rebalance)
Same as quotientDelta(int,int)
but the
* hedge is rebalanced when the next hedge trade is triggered.
WARNING: the computation is extremely slow (O(nPath^2)) if the * underlying evolves in the market probability and no analytic option * price is implemented. Otherwise it is O(nPath).
* * @param t current time. * @param nPath number of path branches spent on each conditional expectation. * @param rebalance triggers the hedge trades.
public double analyticMinimumVarianceDelta(int whichProbability, int t)
Analytic approximation to the minimumVarianceDelta(int, int, int)
hedge
* weights. Implemented only if the underlying is a dividend free
* ConstantVolatilityAsset. Exits program otherwise. See the file
* "HedgeWeights.ps".
public double analyticQuotientDelta(int t)
Analytic approximation to the quotientDelta(int, int)
hedge
* weights. Implemented only if the underlying is a dividend free
* ConstantVolatilityAsset. Exits program otherwise. See the file
* "HedgeWeights.ps".
public double currentDiscountedHedgeGain(int whichDelta, int whichProbability, int nBranch, double fixed_trc, double prop_trc)
HEDGE ERROR: The discounted profit and loss of hedging a short * position in one call on one share of the underlying along one path of the * underlying.
* *Price paths of the underlying asset can be simulated in the market
* probability or risk neutral probability and the hedge is rebalance at each
* time step. More general rebalance policies are implemented in the class
* Hedge
.
Any one of the hedge weights (deltas) can be specified.
* *At each time step nonanalytic hedge weights are derived from conditional * expectations. In the case of minimum variance deltas these conditional * expectations are computed in the same probability in which the underlying * asset price paths are simulated. Monte Carlo deltas are always computed * in the risk neutral probability.
* *In each case the conditional expectations make it necessary to branch * price paths of the underlying asset, a very time consuming activity. * Each branch simulation destroys an existing price path of the underlying * asset from the time of branching forward. * Consequently we cannot simply compute a full path of the underlying and * then move the hedge along this path. Instead we evolve the path * simultaneous with the hedge in single time steps.
* *The flags whichDelta, whichProbability
indicate which type
* of deltas are used in the hedge and under which probability the underlying
* asset is evolved.
Transaction costs have a fixed and a proportional component. The * fixed component also has to be normalized to cost per one share. * If you transact in lots of 1000 shares and such a trade costs 10 dollars * fixed transaction costs are 10/1000=0.01. The proportional transaction * costs come from bidask spread etc., 0.1 is a conservative number. * Transaction costs are assumed to remain constant in today's dollars.
* *The option price path C[0] must be initialized with the option price at * time zero before this routine is called.
* *This method is superceded by the more general methods
* in the class Hedge
(for general options) but should be
* left in place since some programs use it.
* * @param whichDelta type of delta employed. * @param whichProbability the probability under which deltas are computed. * @param nBranch number of branches spent on each conditional expectation. * @param fixed_trc fixed transaction costs (normalized to one share). * @param prop_trc proportional transaction costs.
public RandomVariable discountedHedgeGain(int whichDelta, int whichProbability, int nBranch, double fixed_trc, double prop_trc)
The hedge gain as a random variable.
* * @param whichDelta type of delta employed. * @param deltaProbability the probability under which deltas are computed. * @param nBranch number of branches spent on each conditional expectation. * @param assetPathProbability probability for asset path simulation. * @param fixed_trc fixed transaction costs (normalized to one share). * @param prop_trc proportional transaction costs.


PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 