WebCab Bonds
v2.01
(J2SE Edition)

webcab.lib.finance.pricing.models.other
Class ExtremumModel

java.lang.Object
  |
  +--webcab.lib.finance.pricing.models.StochasticDifferentialModel
        |
        +--webcab.lib.finance.pricing.core.models.MarkovModel
              |
              +--webcab.lib.finance.pricing.core.models.SemimartingaleMarkovModel
                    |
                    +--webcab.lib.finance.pricing.models.other.ExtremumModel

public class ExtremumModel
extends SemimartingaleMarkovModel

This model provides the minimum or maximum of some value. The value used is an external variable of the model. The variable can be a price, a volatility, a spot rate, an average, even another extremum, or any other variable offered by a ScalarContext. You specify which variable will be used by adding a dependency between the extremum context and the scalar context of that variable. Of course you must include a new submodel in the compound model which produces this ScalarContext. The extremum is computed using the scalar value, so the extremum is the dependent while the scalar is the dependee. Example: compoundModel.addDependency("Price", "Price.Minimum");

This model produces a MinContext or a MaxContext. The type of extrem (minimum or maximum) is specified in the model's constructor.

Note: If you have a contract dependent on an average, you will always be able to implement it so that it does not need an extremum model. You do this by using the historical values of the scalar variable to compute the maximum or minimum when you evaluate the payoffs.

Remark: It may seem that this model is redundant. However, there are cases when you are restricted to using a Markovian contract (for example, if PDE pricing is used). Moreover, pricing Markovian contracts is more efficient, so, if you are not bothered by the added complexity, you should use the Markovian version when available. (e.g. LookbackOption - is the Markovian version of LookbackOptionPathDependent and requires the presence of an extremum context).


Field Summary
static int MAX
           
static int MIN
           
 
Constructor Summary
ExtremumModel(String contextName, int extremumType, double initialValue)
          Creates a new ExtremumModel instance.
 
Method Summary
 Context dV(Context context, double t, double dt, RandomGenerator generator, Context partialDelta)
           
 double evaluateCoef(int nProcess, int nCoef, double[] x)
           
 int[] getCategoriesForExternalReferences()
           
 double[][] getCorrelationMatrix()
           
 int getExternal()
           
 String[] getExternalReferences(Context context)
           
 double[] getExternalVariables(Context context)
           
 Context getInitialContext()
           
 int[] getNFactors()
           
 int getNumeraire()
           
 int getNVariables()
           
 int getTraded()
           
 StochasticDifferentialModel getUpdatedModel(Context context, double t)
          Sets the initial values of the models' variables to the ones given as parameters.
 
Methods inherited from class webcab.lib.finance.pricing.core.models.SemimartingaleMarkovModel
addInternalJumpConditions, comp, evaluateNotTradedAbsoluteCoef, evaluateNotTradedTimeCoef, evaluateNotTradedWienerCoef, evaluateTimeCoef, evaluateWienerCoef, getAbsoluteCoef, getExternalCorrelationMatrix, getExternalReferencesInJumpConditions, getFixedVariablesForCondition, getJumpCondition, getJumpValue, getNExternalFactors, getNJumpConditions, getNotTradedAbsoluteCoef, getNotTradedTimeCoef, getNotTradedWienerCoef, getTimeCoef, getTotalExternalFactors, getTotalTradedFactors, getWienerCoef, hasExternalJumpConditions, resetOnDemand
 
Methods inherited from class webcab.lib.finance.pricing.core.models.MarkovModel
dV_MarkovModel, dV
 
Methods inherited from class webcab.lib.finance.pricing.models.StochasticDifferentialModel
compoundModel, compoundModel, compoundModel, compoundModel, compoundModel, compoundModel, dV_StochasticDifferentialModel, getCholeskyMatrix, getContext, getStartVariableForContext, getSuperModel, getTotalFactors, getVariables, seekRoot, seekUpwards, setCholeskyMatrix, setSuperModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIN

public static final int MIN
See Also:
Constant Field Values

MAX

public static final int MAX
See Also:
Constant Field Values
Constructor Detail

ExtremumModel

public ExtremumModel(String contextName,
                     int extremumType,
                     double initialValue)
Creates a new ExtremumModel instance.

Parameters:
contextName - the name of the context produced.
extremumType - either MIN or MAX.
initialValue - the initial value of the extremum. This should be identical to the initial value for the variable used to compute the extremum.
Method Detail

getNVariables

public int getNVariables()
Specified by:
getNVariables in class StochasticDifferentialModel

getNFactors

public int[] getNFactors()
Specified by:
getNFactors in class StochasticDifferentialModel

getNumeraire

public int getNumeraire()
Specified by:
getNumeraire in class StochasticDifferentialModel

getInitialContext

public Context getInitialContext()
Specified by:
getInitialContext in class StochasticDifferentialModel

getCorrelationMatrix

public double[][] getCorrelationMatrix()
Specified by:
getCorrelationMatrix in class StochasticDifferentialModel

getTraded

public int getTraded()
Specified by:
getTraded in class SemimartingaleMarkovModel

getExternal

public int getExternal()
Specified by:
getExternal in class SemimartingaleMarkovModel

getExternalVariables

public double[] getExternalVariables(Context context)
                              throws BondsException
Specified by:
getExternalVariables in class SemimartingaleMarkovModel
BondsException

getExternalReferences

public String[] getExternalReferences(Context context)
                               throws BondsException
Specified by:
getExternalReferences in class SemimartingaleMarkovModel
BondsException

getCategoriesForExternalReferences

public int[] getCategoriesForExternalReferences()
Specified by:
getCategoriesForExternalReferences in class SemimartingaleMarkovModel

evaluateCoef

public double evaluateCoef(int nProcess,
                           int nCoef,
                           double[] x)
                    throws BondsException
Specified by:
evaluateCoef in class SemimartingaleMarkovModel
BondsException

dV

public Context dV(Context context,
                  double t,
                  double dt,
                  RandomGenerator generator,
                  Context partialDelta)
           throws BondsException
Overrides:
dV in class SemimartingaleMarkovModel
BondsException

getUpdatedModel

public StochasticDifferentialModel getUpdatedModel(Context context,
                                                   double t)
                                            throws BondsException
Description copied from class: StochasticDifferentialModel
Sets the initial values of the models' variables to the ones given as parameters.

Specified by:
getUpdatedModel in class StochasticDifferentialModel
Parameters:
context - the context which will be the new initial context of the model
t - the initial moment for the model
Returns:
StochasticDifferentialModel
Throws:
BondsException

WebCab Bonds
v2.01
(J2SE Edition)