## Class EulerSchemeFromProcessModel

• All Implemented Interfaces:
Cloneable, MonteCarloProcess, Process

public class EulerSchemeFromProcessModel
extends MonteCarloProcessFromProcessModel
This class implements some numerical schemes for multi-dimensional multi-factor Ito process.

It features the standard Euler scheme and the standard predictor-corrector Euler scheme for Y, then applies the state space transform $$X = f(Y)$$.

For the standard Euler scheme the process $$Y = (Y_{1},\ldots,Y_{d})$$ is discretized as $Y_{j}(t_{i+1}) = Y_{j}(t_{i}) + \mu_{j}(t_{i}) \Delta t_{i} + \lambda_{1,j}(t_{i}) \Delta W_{1}(t_{i}) + \ldots + \lambda_{m,j} \Delta W_{m} \text{.}$

The parameters have to be provided by a ProcessModel:
• $$f$$ - applyStateSpaceTransform
• $$Y(t_{0})$$ - getInitialState
• $$\mu$$ - getDrift
• $$\lambda_{j}$$ - getFactorLoading

Using the state space transform $$(t,x) \mapsto \exp(x)$$, it is possible to create a log-Euler scheme, i.e., $X(t_{i+1}) = X(t_{i}) \cdot \exp\left( (r(t_{i}) - \frac{1}{2} \sigma(t_{i})^2) \Delta t_{i} + \sigma(t_{i}) \Delta W(t_{i}) \right) \text{.}$ for a process $$\mathrm{d} X = r X \mathrm{d}t + \sigma X \mathrm{d}W$$.

The dimension $$d$$ is called numberOfComponents here. The value $$m$$ is called numberOfFactors here. The default for numberOfFactors is 1.
Version:
1.4
Author:
Christian Fries
The interface definition contains more details.
• ### Nested Class Summary

Nested Classes
Modifier and Type Class Description
static class  EulerSchemeFromProcessModel.Scheme
• ### Constructor Summary

Constructors
Constructor Description
EulerSchemeFromProcessModel​(ProcessModel model, IndependentIncrements stochasticDriver)
Create an Euler discretization scheme.
EulerSchemeFromProcessModel​(ProcessModel model, IndependentIncrements stochasticDriver, EulerSchemeFromProcessModel.Scheme scheme)
Create an Euler discretization scheme.
• ### Method Summary

All Methods
Modifier and Type Method Description
EulerSchemeFromProcessModel clone()
Create and return a clone of this process.
MonteCarloProcess getCloneWithModifiedData​(Map<String,​Object> dataModified)
Returns a clone of this model where the specified properties have been modified.
MonteCarloProcess getCloneWithModifiedModel​(ProcessModel model)
Returns a clone of this model where the specified properties have been modified.
Object getCloneWithModifiedSeed​(int seed)
RandomVariable getMonteCarloWeights​(int timeIndex)
This method returns the weights of a weighted Monte Carlo method (the probability density).
int getNumberOfFactors()
int getNumberOfPaths()
RandomVariable getProcessValue​(int timeIndex, int componentIndex)
This method returns the realization of the process at a certain time index.
EulerSchemeFromProcessModel.Scheme getScheme()
IndependentIncrements getStochasticDriver()
String toString()
• ### Methods inherited from class net.finmath.montecarlo.process.MonteCarloProcessFromProcessModel

applyStateSpaceTransform, applyStateSpaceTransformInverse, getDrift, getFactorLoading, getInitialState, getModel, getNumberOfComponents, getTime, getTimeDiscretization, getTimeIndex
• ### Methods inherited from class java.lang.Object

equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
• ### Methods inherited from interface net.finmath.montecarlo.process.Process

getProcessValue
• ### Constructor Detail

• #### EulerSchemeFromProcessModel

public EulerSchemeFromProcessModel​(ProcessModel model,
IndependentIncrements stochasticDriver,
EulerSchemeFromProcessModel.Scheme scheme)
Create an Euler discretization scheme.
Parameters:
model - The model (the SDE specifcation) used to generate the (sampling of the) stochastic process.
stochasticDriver - The stochastic driver of the process (e.g. a Brownian motion).
scheme - The scheme to use. See EulerSchemeFromProcessModel.Scheme.
• #### EulerSchemeFromProcessModel

public EulerSchemeFromProcessModel​(ProcessModel model,
IndependentIncrements stochasticDriver)
Create an Euler discretization scheme.
Parameters:
model - The model (the SDE specification) used to generate the (sampling of the) stochastic process.
stochasticDriver - The stochastic driver of the process (e.g. a Brownian motion).
• ### Method Detail

• #### getProcessValue

public RandomVariable getProcessValue​(int timeIndex,
int componentIndex)
This method returns the realization of the process at a certain time index.
Parameters:
timeIndex - Time index at which the process should be observed
componentIndex - Component index of the process.
Returns:
A vector of process realizations (on path)
• #### getMonteCarloWeights

public RandomVariable getMonteCarloWeights​(int timeIndex)
This method returns the weights of a weighted Monte Carlo method (the probability density).
Parameters:
timeIndex - Time index at which the process should be observed
Returns:
A vector of positive weights
• #### getNumberOfPaths

public int getNumberOfPaths()
Returns:
Returns the numberOfPaths.
• #### getNumberOfFactors

public int getNumberOfFactors()
Returns:
Returns the numberOfFactors.
• #### getStochasticDriver

public IndependentIncrements getStochasticDriver()
Returns:
Returns the independent increments interface used in the generation of the process
• #### getScheme

public EulerSchemeFromProcessModel.Scheme getScheme()
Returns:
Returns the scheme.
• #### clone

public EulerSchemeFromProcessModel clone()
Description copied from interface: MonteCarloProcess
Create and return a clone of this process. The clone is not tied to any model, but has the same process specification, that is, if the model is the same, it would generate the same paths.
Specified by:
clone in interface MonteCarloProcess
Specified by:
clone in interface Process
Specified by:
clone in class MonteCarloProcessFromProcessModel
Returns:
Clone of the process
• #### getCloneWithModifiedModel

public MonteCarloProcess getCloneWithModifiedModel​(ProcessModel model)
Description copied from interface: MonteCarloProcess
Returns a clone of this model where the specified properties have been modified. Note that there is no guarantee that a model reacts on a specification of a properties in the parameter map dataModified. If data is provided which is ignored by the model no exception may be thrown.
Parameters:
model - The model to be used.
Returns:
A clone of this model (or this model if no parameter was modified).
• #### getCloneWithModifiedData

public MonteCarloProcess getCloneWithModifiedData​(Map<String,​Object> dataModified)
Description copied from interface: MonteCarloProcess
Returns a clone of this model where the specified properties have been modified. Note that there is no guarantee that a model reacts on a specification of a properties in the parameter map dataModified. If data is provided which is ignored by the model no exception may be thrown.
Parameters:
dataModified - Key-value-map of parameters to modify.
Returns:
A clone of this model (or this model if no parameter was modified).
• #### getCloneWithModifiedSeed

public Object getCloneWithModifiedSeed​(int seed)
Specified by:
getCloneWithModifiedSeed in class MonteCarloProcessFromProcessModel
• #### toString

public String toString()
Overrides:
toString in class Object