## Market Class ConstantVolBasket

```java.lang.Object Market.Basket Market.ConstantVolBasket
```
Direct Known Subclasses:
BasicAssetPair

public abstract class ConstantVolBasket
extends Basket

 Constructor Summary ```ConstantVolBasket(int T, double dt, double[] S_0, double r, double[] mu, double[] sigma, double[] q)```

 Method Summary ` double` ```covarianceOfReturns(double a, double b, int i, int j)```           The covariations Cov(R_i,R_j) of the asset returns R_i=log(S_i(b)/S_i(a)) over the time interval [a,b]. ` ColtMatrix` ```covarianceOfReturnsMatrix(int t, int s)```           The covariance matrix Cov(R_i,R_j) of the returns R_i=log(S_i(s)/S_i(t)) over the time step t -> s (depends only on s-t). ` double` `get_r()`           Constant short rate. ` ColtVector` `get_Z()`           The vector of standard normal increments driving the current time step ` void` `new_Z_vector()`           A new standard normal vector driving a time step. `abstract  double` ```rho(int i, int j)```           Constant correlation of the asset returns R_i=log(S_i(t)): d< R_i,R_j >_t=rho(i,j)dt. ` double` `sigma(int i)`           Volatility of the asset S_i at time t. ` void` ```stepToHorizonSimulationInit(int whichProbability, int t)```           Must be called before each simulation of path branches which step from current time t to the horizon T in one time step. ` void` ```timeStep(int whichProbability, int t)```           Time step t -> t+1 of the discounted asset prices. ` void` `timeStepToHorizon(int t)`           Single time step t -> s of discounted asset price paths. ` ColtMatrix` `volatilityMatrix(int t)`           The Cholesky root of the covariance matrix of the returns log(S_i(t+1)/S_i(t)) over any time step t -> t+1.

 Methods inherited from class Market.Basket `covarianceOfReturnsMatrix, dividendReductionFactor, forwardPrice, get_B, get_dim, get_dt, get_q, get_S_0, get_S, get_T, get_volatilityIsDeterministic, newPath, newPathBranch, newPathSegment, S, simulationInit`

 Methods inherited from class java.lang.Object `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

 Constructor Detail

### ConstantVolBasket

```public ConstantVolBasket(int T,
double dt,
double[] S_0,
double r,
double[] mu,
double[] sigma,
double[] q)```
Parameters:
`T` - Number of time steps to horizon.
`dt` - Size of time step.
`S_0` - Vector of asset prices S(0).
`r` - Constant short rate.
`mu` - vector of constant drifts of returns.
`sigma` - vector of constant volatilities of returns.
`q` - vector of constant continuous dividend yields.
 Method Detail

### get_r

`public double get_r()`
Constant short rate.

### get_Z

`public ColtVector get_Z()`
The vector of standard normal increments driving the current time step

Overrides:
`get_Z` in class `Basket`

### sigma

`public double sigma(int i)`
Volatility of the asset S_i at time t. Fasy way of retrieving this volatlity from array.

Parameters:
`i` - asset index

### rho

```public abstract double rho(int i,
int j)```

Constant correlation of the asset returns R_i=log(S_i(t)): d< R_i,R_j >_t=rho(i,j)dt. Will be stored (constructor) rather than recomputed in each path.

Parameters:
`i` - asset index.
`j` - asset index.

### covarianceOfReturns

```public double covarianceOfReturns(double a,
double b,
int i,
int j)```

The covariations Cov(R_i,R_j) of the asset returns R_i=log(S_i(b)/S_i(a)) over the time interval [a,b].

Overrides:
`covarianceOfReturns` in class `Basket`
Parameters:
`a` - time begin
`b` - time stop.
`i` - asset index.
`j` - asset index.

### covarianceOfReturnsMatrix

```public ColtMatrix covarianceOfReturnsMatrix(int t,
int s)```

The covariance matrix Cov(R_i,R_j) of the returns R_i=log(S_i(s)/S_i(t)) over the time step t -> s (depends only on s-t). Symmetry not exploited, full matrix allocated.

Parameters:
`t` - time step start.
`s` - time step stop.

### volatilityMatrix

`public ColtMatrix volatilityMatrix(int t)`

The Cholesky root of the covariance matrix of the returns log(S_i(t+1)/S_i(t)) over any time step t -> t+1. This matrix drives the any single time step t->t+1.

Overrides:
`volatilityMatrix` in class `Basket`

### new_Z_vector

`public void new_Z_vector()`
A new standard normal vector driving a time step. We'll seprate this out so we can easily switch to Quasi Monte Carlo dynamics by merely changing this routine.

### stepToHorizonSimulationInit

```public void stepToHorizonSimulationInit(int whichProbability,
int t)```

Must be called before each simulation of path branches which step from current time t to the horizon T in one time step. Sets up the needed drift vector and volatility matrix.

Overrides:
`stepToHorizonSimulationInit` in class `Basket`
Parameters:
`t` - time of branching.
`whichProbability` - simulation probability (market/risk neutral)

### timeStep

```public void timeStep(int whichProbability,
int t)```
Time step t -> t+1 of the discounted asset prices.

Specified by:
`timeStep` in class `Basket`
Parameters:
`t` - current time.
`whichProbability` - simulation probability (market/risk neutral)

### timeStepToHorizon

`public void timeStepToHorizon(int t)`

Single time step t -> s of discounted asset price paths. Assumes `stepToHorizonSimulationInit(int, int)` has been called to set the `drift` vector and the `returnsVolatilityMatrix` with the values for the returns t -> T. This also takes account of the probability under which the simulation proceeds.

Overrides:
`timeStepToHorizon` in class `Basket`
Parameters:
`t` - Current time.