Module net.finmath.lib
Class MertonModel
java.lang.Object
net.finmath.montecarlo.model.AbstractProcessModel
net.finmath.montecarlo.assetderivativevaluation.models.MertonModel
- All Implemented Interfaces:
ProcessModel
This class implements a Merton Model, that is, it provides the drift and volatility specification
and performs the calculation of the numeraire (consistent with the dynamics, i.e. the drift).
The model is
\[
dS = \mu S dt + \sigma S dW + S dJ, \quad S(0) = S_{0},
\]
\[
dN = r N dt, \quad N(0) = N_{0},
\]
where \( W \) is Brownian motion and \( J \) is a jump process (compound Poisson process).
The process \( J \) is given by \( J(t) = \sum_{i=1}^{N(t)} (Y_{i}-1) \), where
\( \log(Y_{i}) \) are i.i.d. normals with mean \( a - \frac{1}{2} b^{2} \) and standard deviation \( b \).
Here \( a \) is the jump size mean and \( b \) is the jump size std. dev.
The model can be rewritten as \( S = \exp(X) \), where
\[
dX = \mu dt + \sigma dW + dJ^{X}, \quad X(0) = \log(S_{0}),
\]
with
\[
J^{X}(t) = \sum_{i=1}^{N(t)} \log(Y_{i})
\]
with \( \mu = r - \frac{1}{2} \sigma^2 - (exp(a)-1) \lambda \).
The class provides the model of S to an
MonteCarloProcess
via the specification of
\( f = exp \), \( \mu = r - \frac{1}{2} \sigma^2 - (exp(a)-1) \lambda \), \( \lambda_{1,1} = \sigma, \lambda_{1,2} = a - \frac{1}{2} b^2, \lambda_{1,3} = b \), i.e.,
of the SDE
\[
dX = \mu dt + \lambda_{1,1} dW + \lambda_{1,2} dN + \lambda_{1,3} Z dN, \quad X(0) = \log(S_{0}),
\]
with \( S = f(X) \). See MonteCarloProcess
for the notation.
For an example on the construction of the three factors \( dW \), \( dN \), and \( Z dN \) see MonteCarloMertonModel
.- Version:
- 1.0
- Author:
- Christian Fries
- See Also:
MonteCarloMertonModel
,The interface for numerical schemes.
,The interface for models provinding parameters to numerical schemes.
-
Constructor Summary
ConstructorsConstructorDescriptionMertonModel(double initialValue, double riskFreeRate, double volatility, double jumpIntensity, double jumpSizeMean, double jumpSizeStDev)
Create a Merton model.MertonModel(double initialValue, double riskFreeRate, double volatility, double discountRate, double jumpIntensity, double jumpSizeMean, double jumpSizeStDev)
Create a Merton model.MertonModel(double initialValue, double riskFreeRate, double volatility, double discountRate, double jumpIntensity, double jumpSizeMean, double jumpSizeStDev, RandomVariableFactory randomVariableFactory)
Create a Merton model.MertonModel(double initialValue, DiscountCurve discountCurveForForwardRate, double volatility, DiscountCurve discountCurveForDiscountRate, double jumpIntensity, double jumpSizeMean, double jumpSizeStDev)
Create a Merton model.MertonModel(double initialValue, DiscountCurve discountCurveForForwardRate, double volatility, DiscountCurve discountCurveForDiscountRate, double jumpIntensity, double jumpSizeMean, double jumpSizeStDev, RandomVariableFactory randomVariableFactory)
Create a Merton model.MertonModel(MertonModelDescriptor descriptor)
Create the model from a descriptor.MertonModel(RandomVariable initialValue, DiscountCurve discountCurveForForwardRate, RandomVariable volatility, DiscountCurve discountCurveForDiscountRate, RandomVariable jumpIntensity, RandomVariable jumpSizeMean, RandomVariable jumpSizeStDev, RandomVariableFactory randomVariableFactory)
Create a Merton model.MertonModel(RandomVariable initialValue, RandomVariable riskFreeRate, RandomVariable volatility, RandomVariable discountRate, RandomVariable jumpIntensity, RandomVariable jumpSizeMean, RandomVariable jumpSizeStDev, RandomVariableFactory randomVariableFactory)
Create a Merton model. -
Method Summary
Modifier and TypeMethodDescriptionapplyStateSpaceTransform(MonteCarloProcess process, int timeIndex, int componentIndex, RandomVariable randomVariable)
Applies the state space transform fi to the given state random variable such that Yi → fi(Yi) =: Xi.applyStateSpaceTransformInverse(MonteCarloProcess process, int timeIndex, int componentIndex, RandomVariable randomVariable)
Applies the inverse state space transform f-1i to the given random variable such that Xi → f-1i(Xi) =: Yi.getCloneWithModifiedData(Map<String,Object> dataModified)
Returns a clone of this model where the specified properties have been modified.getDrift(MonteCarloProcess process, int timeIndex, RandomVariable[] realizationAtTimeIndex, RandomVariable[] realizationPredictor)
This method has to be implemented to return the drift, i.e.getFactorLoading(MonteCarloProcess process, int timeIndex, int componentIndex, RandomVariable[] realizationAtTimeIndex)
This method has to be implemented to return the factor loadings, i.e.getInitialState(MonteCarloProcess process)
Returns the initial value of the state variable of the process Y, not to be confused with the initial value of the model X (which is the state space transform applied to this state value.int
Returns the number of componentsint
Returns the number of factors m, i.e., the number of independent Brownian drivers.getNumeraire(MonteCarloProcess process, double time)
Return the numeraire at a given time index.getRandomVariableForConstant(double value)
Return a random variable initialized with a constant using the models random variable factory.Methods inherited from class net.finmath.montecarlo.model.AbstractProcessModel
getInitialValue, getReferenceDate
-
Constructor Details
-
MertonModel
public MertonModel(RandomVariable initialValue, DiscountCurve discountCurveForForwardRate, RandomVariable volatility, DiscountCurve discountCurveForDiscountRate, RandomVariable jumpIntensity, RandomVariable jumpSizeMean, RandomVariable jumpSizeStDev, RandomVariableFactory randomVariableFactory)Create a Merton model.- Parameters:
initialValue
- \( S_{0} \) - spot - initial value of SdiscountCurveForForwardRate
- The curve specifying \( t \mapsto exp(- r^{\text{c}}(t) \cdot t) \) - with \( r^{\text{c}}(t) \) the risk free ratevolatility
- The log volatility.discountCurveForDiscountRate
- The curve specifying \( t \mapsto exp(- r^{\text{d}}(t) \cdot t) \) - with \( r^{\text{d}}(t) \) the discount ratejumpIntensity
- The intensity parameter lambda of the compound Poisson process.jumpSizeMean
- The mean jump size of the normal distributes jump sizes of the compound Poisson process.jumpSizeStDev
- The standard deviation of the normal distributes jump sizes of the compound Poisson process.randomVariableFactory
- The factory to be used to construct random variables.
-
MertonModel
public MertonModel(double initialValue, DiscountCurve discountCurveForForwardRate, double volatility, DiscountCurve discountCurveForDiscountRate, double jumpIntensity, double jumpSizeMean, double jumpSizeStDev, RandomVariableFactory randomVariableFactory)Create a Merton model.- Parameters:
initialValue
- \( S_{0} \) - spot - initial value of SdiscountCurveForForwardRate
- The curve specifying \( t \mapsto exp(- r^{\text{c}}(t) \cdot t) \) - with \( r^{\text{c}}(t) \) the risk free ratevolatility
- The log volatility.discountCurveForDiscountRate
- The curve specifying \( t \mapsto exp(- r^{\text{d}}(t) \cdot t) \) - with \( r^{\text{d}}(t) \) the discount ratejumpIntensity
- The intensity parameter lambda of the compound Poisson process.jumpSizeMean
- The mean jump size of the normal distributes jump sizes of the compound Poisson process.jumpSizeStDev
- The standard deviation of the normal distributes jump sizes of the compound Poisson process.randomVariableFactory
- The factory to be used to construct random variables.
-
MertonModel
public MertonModel(RandomVariable initialValue, RandomVariable riskFreeRate, RandomVariable volatility, RandomVariable discountRate, RandomVariable jumpIntensity, RandomVariable jumpSizeMean, RandomVariable jumpSizeStDev, RandomVariableFactory randomVariableFactory)Create a Merton model.- Parameters:
initialValue
- Spot value.riskFreeRate
- The risk free rate.volatility
- The log volatility.discountRate
- The discount rate used in the numeraire.jumpIntensity
- The intensity parameter lambda of the compound Poisson process.jumpSizeMean
- The mean jump size of the normal distributes jump sizes of the compound Poisson process.jumpSizeStDev
- The standard deviation of the normal distributes jump sizes of the compound Poisson process.randomVariableFactory
- The factory to be used to construct random variables.
-
MertonModel
public MertonModel(double initialValue, double riskFreeRate, double volatility, double discountRate, double jumpIntensity, double jumpSizeMean, double jumpSizeStDev, RandomVariableFactory randomVariableFactory)Create a Merton model.- Parameters:
initialValue
- Spot value.riskFreeRate
- The risk free rate.volatility
- The log volatility.discountRate
- The discount rate used in the numeraire.jumpIntensity
- The intensity parameter lambda of the compound Poisson process.jumpSizeMean
- The mean jump size of the normal distributes jump sizes of the compound Poisson process.jumpSizeStDev
- The standard deviation of the normal distributes jump sizes of the compound Poisson process.randomVariableFactory
- The factory to be used to construct random variables.
-
MertonModel
Create the model from a descriptor.- Parameters:
descriptor
- A descriptor of the model.
-
MertonModel
public MertonModel(double initialValue, DiscountCurve discountCurveForForwardRate, double volatility, DiscountCurve discountCurveForDiscountRate, double jumpIntensity, double jumpSizeMean, double jumpSizeStDev)Create a Merton model.- Parameters:
initialValue
- \( S_{0} \) - spot - initial value of SdiscountCurveForForwardRate
- The curve specifying \( t \mapsto exp(- r^{\text{c}}(t) \cdot t) \) - with \( r^{\text{c}}(t) \) the risk free ratevolatility
- The log volatility.discountCurveForDiscountRate
- The curve specifying \( t \mapsto exp(- r^{\text{d}}(t) \cdot t) \) - with \( r^{\text{d}}(t) \) the discount ratejumpIntensity
- The intensity parameter lambda of the compound Poisson process.jumpSizeMean
- The mean jump size of the normal distributes jump sizes of the compound Poisson process.jumpSizeStDev
- The standard deviation of the normal distributes jump sizes of the compound Poisson process.
-
MertonModel
public MertonModel(double initialValue, double riskFreeRate, double volatility, double discountRate, double jumpIntensity, double jumpSizeMean, double jumpSizeStDev)Create a Merton model.- Parameters:
initialValue
- Spot value.riskFreeRate
- The risk free rate.volatility
- The log volatility.discountRate
- The discount rate used in the numeraire.jumpIntensity
- The intensity parameter lambda of the compound Poisson process.jumpSizeMean
- The mean jump size of the normal distributes jump sizes of the compound Poisson process.jumpSizeStDev
- The standard deviation of the normal distributes jump sizes of the compound Poisson process.
-
MertonModel
public MertonModel(double initialValue, double riskFreeRate, double volatility, double jumpIntensity, double jumpSizeMean, double jumpSizeStDev)Create a Merton model.- Parameters:
initialValue
- Spot value.riskFreeRate
- The risk free rate.volatility
- The log volatility.jumpIntensity
- The intensity parameter lambda of the compound Poisson process.jumpSizeMean
- The mean jump size of the normal distributes jump sizes of the compound Poisson process.jumpSizeStDev
- The standard deviation of the normal distributes jump sizes of the compound Poisson process.
-
-
Method Details
-
applyStateSpaceTransform
public RandomVariable applyStateSpaceTransform(MonteCarloProcess process, int timeIndex, int componentIndex, RandomVariable randomVariable)Description copied from interface:ProcessModel
Applies the state space transform fi to the given state random variable such that Yi → fi(Yi) =: Xi.- Parameters:
process
- The discretization process generating this model. The process provides call backs for TimeDiscretization and allows calls to getProcessValue for timeIndices less or equal the given one.timeIndex
- The time index (related to the model times discretization).componentIndex
- The component index i.randomVariable
- The state random variable Yi.- Returns:
- New random variable holding the result of the state space transformation.
-
applyStateSpaceTransformInverse
public RandomVariable applyStateSpaceTransformInverse(MonteCarloProcess process, int timeIndex, int componentIndex, RandomVariable randomVariable)Description copied from interface:ProcessModel
Applies the inverse state space transform f-1i to the given random variable such that Xi → f-1i(Xi) =: Yi.- Parameters:
process
- The discretization process generating this model. The process provides call backs for TimeDiscretization and allows calls to getProcessValue for timeIndices less or equal the given one.timeIndex
- The time index (related to the model times discretization).componentIndex
- The component index i.randomVariable
- The state random variable Xi.- Returns:
- New random variable holding the result of the state space transformation.
-
getInitialState
Description copied from interface:ProcessModel
Returns the initial value of the state variable of the process Y, not to be confused with the initial value of the model X (which is the state space transform applied to this state value.- Parameters:
process
- The discretization process generating this model. The process provides call backs for TimeDiscretization and allows calls to getProcessValue for timeIndices less or equal the given one.- Returns:
- The initial value of the state variable of the process Y(t=0).
-
getNumeraire
Description copied from interface:ProcessModel
Return the numeraire at a given time index. Note: The random variable returned is a defensive copy and may be modified.- Parameters:
process
- The discretization process generating this model. The process provides call backs for TimeDiscretization and allows calls to getProcessValue for timeIndices less or equal the given one.time
- The time t for which the numeraire N(t) should be returned.- Returns:
- The numeraire at the specified time as
RandomVariable
-
getDrift
public RandomVariable[] getDrift(MonteCarloProcess process, int timeIndex, RandomVariable[] realizationAtTimeIndex, RandomVariable[] realizationPredictor)Description copied from interface:ProcessModel
This method has to be implemented to return the drift, i.e. the coefficient vector
μ = (μ1, ..., μn) such that X = f(Y) and
dYj = μj dt + λ1,j dW1 + ... + λm,j dWm
in an m-factor model. Here j denotes index of the component of the resulting process. Since the model is provided only on a time discretization, the method may also (should try to) return the drift as \( \frac{1}{t_{i+1}-t_{i}} \int_{t_{i}}^{t_{i+1}} \mu(\tau) \mathrm{d}\tau \).- Parameters:
process
- The discretization process generating this model. The process provides call backs for TimeDiscretization and allows calls to getProcessValue for timeIndices less or equal the given one.timeIndex
- The time index (related to the model times discretization).realizationAtTimeIndex
- The given realization at timeIndexrealizationPredictor
- The given realization attimeIndex+1
or null if no predictor is available.- Returns:
- The drift or average drift from timeIndex to timeIndex+1, i.e. \( \frac{1}{t_{i+1}-t_{i}} \int_{t_{i}}^{t_{i+1}} \mu(\tau) \mathrm{d}\tau \) (or a suitable approximation).
-
getFactorLoading
public RandomVariable[] getFactorLoading(MonteCarloProcess process, int timeIndex, int componentIndex, RandomVariable[] realizationAtTimeIndex)Description copied from interface:ProcessModel
This method has to be implemented to return the factor loadings, i.e. the coefficient vector
λj = (λ1,j, ..., λm,j) such that X = f(Y) and
dYj = μj dt + λ1,j dW1 + ... + λm,j dWm
in an m-factor model. Here j denotes index of the component of the resulting process.- Parameters:
process
- The discretization process generating this model. The process provides call backs for TimeDiscretization and allows calls to getProcessValue for timeIndices less or equal the given one.timeIndex
- The time index (related to the model times discretization).componentIndex
- The index j of the driven component.realizationAtTimeIndex
- The realization of X at the time corresponding to timeIndex (in order to implement local and stochastic volatlity models).- Returns:
- The factor loading for given factor and component.
-
getNumberOfComponents
public int getNumberOfComponents()Description copied from interface:ProcessModel
Returns the number of components- Returns:
- The number of components
-
getNumberOfFactors
public int getNumberOfFactors()Description copied from interface:ProcessModel
Returns the number of factors m, i.e., the number of independent Brownian drivers.- Returns:
- The number of factors.
-
getRandomVariableForConstant
Description copied from interface:ProcessModel
Return a random variable initialized with a constant using the models random variable factory.- Parameters:
value
- The constant value.- Returns:
- A new random variable initialized with a constant value.
-
getCloneWithModifiedData
Description copied from interface:ProcessModel
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 mapdataModified
. 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).
-
getRiskFreeRate
- Returns:
- the riskFreeRate
-
getVolatility
- Returns:
- the volatility
-
getJumpIntensity
- Returns:
- the jumpIntensity
-
getJumpSizeMean
- Returns:
- the jumpSizeMean
-
getJumpSizeStdDev
- Returns:
- the jumpSizeStdDev
-