## Market Class DeterministicVolAsset

java.lang.Object Market.Asset Market.DeterministicVolAsset


public abstract class DeterministicVolAsset
extends Asset

Implementation of Asset. The asset path t->S(t) follows a geometric Brownian motion with constant drift mu and deterministic volatility sigma(t). 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.

For details on the price dynamics see ConstantVolatilityAsset. Simply replace sigma*sqrt(dt) with sqrt(integral_t^{t+dt}sigma^2(u)du).

Driver: The increment W(s)-W(t) is normal with mean zero and variance (s-t)*dt, that is,

W(s)-W(t)=sqrt((s-t)*dt)*Z,

where Z is standard normal. In particular for the time step s=t+1 we have

S^B(t+1)=S^B(t)*exp[driftDelta[t]+standardDeviationOfReturn[t]*Z(t)],

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 Z-increments. 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:

• They can be reused by simple random sign change.
• Some methods make explicit use of them (Monte Carlo hedge deltas)
To keep track of where we are in the cycle through sign changes the pathCounter respectively branchCounter variable monitor the progress through a cycle of sign changes of a path respectively branch simulation. The reason for this is that paths in the same cycle of sign changes are not independent.

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.

 Constructor Summary DeterministicVolAsset(int T, double dt, int nSignChange, double S_0, double r, double q, double mu)

 Method Summary  double get_mu()           Constant asset price drift.  double get_r()           Constant short rate.  double get_sigmaSqrtdt(int t)           sigma(t)*sqrt(dt), where sigma(t) is the volatility of the asset. abstract  double integralSigmaSquare(double a, double b)           The quadratic variation < log(S)>_a^bintegral_a^b sigma^2(u)du variation of the return process log(S) over the time interval [a,b].  void newPath(int whichProbability)           Computes a new discounted price path driven by new (as opposed to sign changed) Z-increments.  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,...T-1, 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. abstract  double sigma(int t)           Volatility at discrete time t (continuous time t*dt).  double Sigma(int t)           sqrt(\int_t^T sigma^2(u)du), standard deviaition of the return from the current time t to the horizon.  void simulationInit(int t)           Sets pathCounter (if t=0) or branchCounter (if t>0) to zero.  double standardDeviationOfReturn(double a, double b)           Standard deviation of the return process over the time interval [a,b].  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) Z-increment.  void timeStep(int whichProbability, int t, int s)           Single time step t -> s of discounted price path driven by new Z-increment.

 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

### DeterministicVolAsset

public DeterministicVolAsset(int T,
double dt,
int nSignChange,
double S_0,
double r,
double q,
double mu)
Parameters:
T - Number of time steps to horizon.
dt - Size of time step.
nSignChange - Number of times the Z-increments are reused through random sign changes.
S_0 - Asset price S(0).
r - Constant short rate.
q - Constant dividend yield.
mu - Constant asset price drift.
 Method Detail

### sigma

public abstract double sigma(int t)

Volatility at discrete time t (continuous time t*dt).

### integralSigmaSquare

public abstract double integralSigmaSquare(double a,
double b)

The quadratic variation < log(S)>_a^bintegral_a^b sigma^2(u)du variation of the return process log(S) over the time interval [a,b]. Because of its nonstochastic nature it is also the variance (expected quadratic variation) of the return over this interval.

### standardDeviationOfReturn

public double standardDeviationOfReturn(double a,
double b)

Standard deviation of the return process over the time interval [a,b].

### get_sigmaSqrtdt

public double get_sigmaSqrtdt(int t)

sigma(t)*sqrt(dt), where sigma(t) is the volatility of the asset.

Overrides:
get_sigmaSqrtdt in class Asset
Parameters:
t - Current time.

### Sigma

public double Sigma(int t)

sqrt(\int_t^T sigma^2(u)du), standard deviaition of the return from the current time t to the horizon.

Overrides:
Sigma in class Asset
Parameters:
t - Current time.

### get_r

public double get_r()
Constant short rate.

### get_mu

public double get_mu()
Constant asset price drift.

### simulationInit

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 Z-increments. 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.

Overrides:
simulationInit in class Asset
Parameters:
t - Current time (time of branching).

### newWienerIncrements

public void newWienerIncrements(int t)

Computes a new sequence of standard normal increments Z[j], j=t,t+1,...T-1, 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.

Parameters:
t - Current time.

### newPathBranch

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 Z-increments driving the path branch are the next set of Z-increments in a group of nSignChange dependent sets of increments which differ only by sign. Only after nSignChange sign changes is a new set of Z-increments computed.

Overrides:
newPathBranch in class Asset
Parameters:
whichProbability - Probability for simulation (market/risk neutral).
t - Current time (time at which the new path branch starts).

### timeStep

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) Z-increment.

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.

Specified by:
timeStep in class Asset
Parameters:
whichProbability - probability for simulation (market/risk neutral)
t - branching time (time at which new branch starts)

### timeStep

public void timeStep(int whichProbability,
int t,
int s)

Single time step t -> s of discounted price path driven by new Z-increment. Sets only the value S[s] in the price path S[ ].

Overrides:
timeStep in class Asset
Parameters:
whichProbability - Probability for simulation (market/risk neutral).
t - Current time.
s - Future time to be reached.

### pathSegment

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 Z-increments and so a new independent path branch is computed.

Overrides:
pathSegment in class Asset
Parameters:
whichProbability - Probability for simulation (market/risk neutral).
t - Current time (time at which new path branch starts).
trg - triggers stopping the path.

### newPath

public void newPath(int whichProbability)

Computes a new discounted price path driven by new (as opposed to sign changed) Z-increments. Thus the new path is indpendent of preceeding paths.

Overrides:
newPath in class Asset
Parameters:
whichProbability - Probability for simulation (market/risk neutral).