finMath lib documentation

net.finmath.montecarlo.model
Class AbstractModel

java.lang.Object
  extended by net.finmath.montecarlo.model.AbstractModel
All Implemented Interfaces:
AbstractModelInterface
Direct Known Subclasses:
LIBORMarketModel, LIBORMarketModelStandard, MonteCarloBlackScholesModel, MonteCarloMultiAssetBlackScholesModel

public abstract class AbstractModel
extends Object
implements AbstractModelInterface

This class is an abstract base class to implement a model provided to an AbstractProcess. Manages the delegation to AbstractProcessInterface. For details see AbstractModelInterface.

Version:
1.3
Author:
Christian Fries
See Also:
The interface definition contains more details.

Constructor Summary
AbstractModel()
           
 
Method Summary
 RandomVariableInterface[] getInitialValue()
          Returns the initial value of the model.
 RandomVariableInterface getMonteCarloWeights(int timeIndex)
           
 int getNumberOfFactors()
          Returns the number of factors m, i.e., the number of independent Brownian drivers.
 AbstractProcessInterface getProcess()
          Get the numerical scheme used to generate the stochastic process.
 RandomVariableInterface getProcessValue(int timeIndex, int componentIndex)
           
 double getTime(int timeIndex)
          Return the simulation time for a given time index.
 TimeDiscretizationInterface getTimeDiscretization()
          Get the time discretization of the model (simulation time).
 int getTimeIndex(double time)
          Return the time index associated for the given simulation time.
 void setProcess(AbstractProcessInterface process)
          Set the numerical scheme used to generate the stochastic process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.finmath.montecarlo.model.AbstractModelInterface
applyStateSpaceTransform, getDrift, getFactorLoading, getInitialState, getNumberOfComponents, getNumeraire
 

Constructor Detail

AbstractModel

public AbstractModel()
Method Detail

getInitialValue

public RandomVariableInterface[] getInitialValue()
Returns the initial value of the model.

Returns:
The initial value of the model.

setProcess

public void setProcess(AbstractProcessInterface process)
Description copied from interface: AbstractModelInterface
Set the numerical scheme used to generate the stochastic process. The model needs the numerical scheme to calculate, e.g., the numeraire.

Specified by:
setProcess in interface AbstractModelInterface
Parameters:
process - The process.

getProcess

public AbstractProcessInterface getProcess()
Description copied from interface: AbstractModelInterface
Get the numerical scheme used to generate the stochastic process. The model needs the numerical scheme to calculate, e.g., the numeraire.

Specified by:
getProcess in interface AbstractModelInterface
Returns:
the process

getNumberOfFactors

public int getNumberOfFactors()
Description copied from interface: AbstractModelInterface
Returns the number of factors m, i.e., the number of independent Brownian drivers.

Specified by:
getNumberOfFactors in interface AbstractModelInterface
Returns:
The number of factors.

getProcessValue

public RandomVariableInterface getProcessValue(int timeIndex,
                                               int componentIndex)
                                        throws CalculationException
Parameters:
timeIndex - The time index of evaluation time (using this models time discretization)
componentIndex - The component of the process vector
Returns:
Process realization as a random variable
Throws:
CalculationException - Thrown if the valuation fails, specific cause may be available via the cause() method.
See Also:
AbstractProcessInterface.getProcessValue(int, int)

getMonteCarloWeights

public RandomVariableInterface getMonteCarloWeights(int timeIndex)
                                             throws CalculationException
Parameters:
timeIndex - The time index of evaluation time (using this models time discretization)
Returns:
A random variable representing the Monte-Carlo probabilities.
Throws:
CalculationException - Thrown if the valuation fails, specific cause may be available via the cause() method.
See Also:
AbstractProcessInterface.getMonteCarloWeights(int)

getTimeDiscretization

public final TimeDiscretizationInterface getTimeDiscretization()
Get the time discretization of the model (simulation time).

Specified by:
getTimeDiscretization in interface AbstractModelInterface
Returns:
The time discretization of the model (simulation time).
See Also:
AbstractProcess.getTimeDiscretization()

getTime

public final double getTime(int timeIndex)
Return the simulation time for a given time index.

Parameters:
timeIndex - Time index
Returns:
Returns the time for a given time index.
See Also:
AbstractProcess.getTime(int)

getTimeIndex

public final int getTimeIndex(double time)
Return the time index associated for the given simulation time.

Parameters:
time - A given time.
Returns:
The time index corresponding to the given time.
See Also:
AbstractProcess.getTimeIndex(double)

Copyright © 2014 Christian P. Fries.

Copyright © 2014. All rights reserved.