

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object Market.Asset Market.ConstantVolatilityAsset
Implementation of Asset
. The asset path t>S(t) follows a
* geometric Brownian motion with constant drift mu and
* volatility sigma. The short rate r is also constant and so
* the path t>B(t)=exp(r*t) of the riskfree bond can be computed at
* initialization (by the constructor).
These paths are stored in the arrays B[] and S[] respectively. * Discrete time t is measured in multiples t*dt of the * time step dt and so for example B[t]=B(t*dt)=exp(r*t*dt).
* *The array S[] contains the discounted price path t>S(t)/B(t), * that is, S[t]=S(t*dt)/B(t*dt). Remember this when computing option * payoffs.
* *Write S^B(t)=S(t)/B(t). The dynamics of the return process * log(S(t)/B(t)) depends on the probability (market/risk neutral) and is * given by
* *where q is the continuous dividend yield of the asset, W a Brownian motion * under the market probability respectively risk neutral probability. * Thus we introduce the constants
* *where dt is the size of the time step. With this we have explicit * solutions
* *where the driftDelta corresponds to the probability underlying the * simulation and W is a Brownian motion with respect to this probability. * Consequently we can make large time steps t>s without loss * of precision if intermediate values of the price path are not needed. * *
Driver: The increment W(s)W(t) is * normal with mean zero and variance (st)*dt, that is, *
* *where Z is standard normal. In particular for the time step s=t+1 we have *
* *where Z(t) is the standard normal increment driving this time step. * The entire price path is driven by the sequence of independent standard * normal Zincrements. * These increments are stored in the array Z[ ] and * Z[t] is the increment driving the time step t>t+1. These increments are * stored for wo reasons: *
To compute correct standard deviations of Monte Carlo estimators these
* variables need to be set to zero at the beginning of each simulation
* simulationInit(int)
.
* If only means but no standard deviations are required then this is not
* necessary
This scheme is correct for expectations and conditional * expectations but not for conditional expectations of conditional expecations * (branchBranchCounter needed). However computational cost makes iterated * conditional expectations forbidding and we will not compute them.
* * @author Michael J. Meyer *
Constructor Summary  
ConstantVolatilityAsset(int T,
double dt,
int nSignChange,
double S_0,
double r,
double q,
double mu,
double sigma)
* @param T Number of time steps to horizon. 
Method Summary  
double 
get_mu()
Constant asset price drift. 
double 
get_r()
Constant short rate. 
double 
get_sigma()
Constant asset price volatility. 
double 
get_sigmaSqrtdt(int t)
sigma*sqrt(dt). 
SFSMarkovChainImpl 
markovChain(int N,
double ds,
double delta)
Approximation of the discounted asset price path as a stationary finite * state Markov chain. 
void 
newPath(int whichProbability)
Computes a new discounted price path driven by new (as opposed to * sign changed) Zincrements. 
void 
newPathBranch(int whichProbability,
int t)
Continues a discounted asset price path existing up to time t from this * time t to the horizon (branching at time t). 
void 
newWienerIncrements(int t)
Computes a new sequence of standard normal increments Z[j], * j=t,t+1,...T1, needed to compute a path forward from time t to the horizon. 
int 
pathSegment(int whichProbability,
int t,
Trigger trg)
Continues a discounted price path which exists up to time t from * time t to the next time s>t at which the Trigger trg is triggered or * s=T, whichever comes first, and returns this time s. 
double 
Sigma(int t)
Aggregate volatility sigma*sqrt(Tt) to the horizon. 
void 
simulationInit(int t)
Sets pathCounter (if t=0) or branchCounter (if t>0) to zero. 
void 
timeStep(int whichProbability,
int t)
Time step t > t+1 of discounted asset price path driven by a new * (as opposed to sign changed) Zincrement. 
void 
timeStep(int whichProbability,
int t,
int s)
Single time step t > s of discounted price path driven by new * Zincrement. 
Methods inherited from class Market.Asset 
dividendReductionFactor, forwardPrice, get_B, get_dt, get_nSignChange, get_q, get_S_0, get_S, get_T, get_volatilityIsDeterministic, get_Z 
Methods inherited from class java.lang.Object 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
Constructor Detail 
public ConstantVolatilityAsset(int T, double dt, int nSignChange, double S_0, double r, double q, double mu, double sigma)
Method Detail 
public double get_r()
public double get_mu()
public double get_sigma()
public double get_sigmaSqrtdt(int t)
get_sigmaSqrtdt
in class Asset
t
 Current time.public void simulationInit(int t)
Sets pathCounter (if t=0) or branchCounter (if t>0) to zero.
* *Must be called before every new simulation run of full paths (t=0) or * branches of an existing path (t>0) which are used to compute standard * deviations to keep track of where we are cycling through the sign changes * of the Zincrements. This is necessary to correctly identify groups of * dependent paths.
* *Not necessary if only means are computed. * For simplicity call it before every new simulation.
* * @param t Current time (time of branching).
simulationInit
in class Asset
t
 Time of branching.public double Sigma(int t)
Sigma
in class Asset
t
 Current time.public void newWienerIncrements(int t)
Computes a new sequence of standard normal increments Z[j], * j=t,t+1,...T1, needed to compute a path forward from time t to the horizon. * These sequences are produced in independent groups of size nSignChange each. * In each group only the signs are changed.
* *If t=0 a path simulation is under way while in case t>0 a simulation of * branches of an existing path is taking place. Correspondingly the pathCounter * or branchCounter variables are incremented.
* * @param t Current time.
public void newPathBranch(int whichProbability, int t)
Continues a discounted asset price path existing up to time t from this * time t to the horizon (branching at time t).
* *The Zincrements driving the path branch are the * next set of Zincrements in a group of nSignChange dependent sets of * increments which differ only by sign. Only after nSignChange sign changes * is a new set of Zincrements computed.
* * @param whichProbability Probability for simulation (market/risk neutral). * @param t Current time (time at which the new path branch starts).
newPathBranch
in class Asset
whichProbability
 Probability for simulation (market/risk neutral).t
 time of branching.public void timeStep(int whichProbability, int t)
Time step t > t+1 of discounted asset price path driven by a new * (as opposed to sign changed) Zincrement.
* *Sets the value S[t+1] in the price path and registers the * standard normal increment Z[t] generated to drive the time step. * This increment is used in the computation of some hedge deltas.
* * @param whichProbability probability for simulation (market/risk neutral) * @param t branching time (time at which new branch starts)
timeStep
in class Asset
whichProbability
 Probability for simulation (market/risk neutral).t
 Current time.public void timeStep(int whichProbability, int t, int s)
Single time step t > s of discounted price path driven by new * Zincrement. Sets only the value S[s] in the price path S[ ].
* * @param whichProbability Probability for simulation (market/risk neutral). * @param t Current time. * @param s Future time to be reached.
timeStep
in class Asset
whichProbability
 Probability for simulation (market/risk neutral).t
 Current time.s
 Time to be reached.public int pathSegment(int whichProbability, int t, Trigger trg)
Continues a discounted price path which exists up to time t from * time t to the next time s>t at which the Trigger trg is triggered or * s=T, whichever comes first, and returns this time s.
* *The Trigger could be a signal triggering a hedge trade or option * exercise for example. No sign changes are applied to the Zincrements and * so a new independent path branch is computed.
* * @param whichProbability Probability for simulation (market/risk neutral). * @param t Current time (time at which new path branch starts). * @param trg triggers stopping the path.
pathSegment
in class Asset
whichProbability
 Probability for simulation (market/risk neutral).t
 branching time (time at which new branch starts).trg
 Stopping time >= t until which the path is computed.public void newPath(int whichProbability)
Computes a new discounted price path driven by new (as opposed to * sign changed) Zincrements. Thus the new path is indpendent of * preceeding paths.
* * @param whichProbability Probability for simulation (market/risk neutral).
newPath
in class Asset
whichProbability
 Probability for simulation (market/risk neutral).public SFSMarkovChainImpl markovChain(int N, double ds, double delta)


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