Class VarianceGammaModel
- java.lang.Object
-
- net.finmath.montecarlo.model.AbstractProcessModel
-
- net.finmath.montecarlo.assetderivativevaluation.models.VarianceGammaModel
-
- All Implemented Interfaces:
ProcessModel
public class VarianceGammaModel extends AbstractProcessModel
This class implements a Variance Gamma 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_t = r S dt + S dL, \quad S(0) = S_{0}, \] \[ dN = r N dt, \quad N(0) = N_{0}, \] where the process L is a.VarianceGammaProcess- Version:
- 1.0
- Author:
- Alessandro Gnoatto
- See Also:
The interface for numerical schemes.,The interface for models provinding parameters to numerical schemes.
-
-
Constructor Summary
Constructors Constructor Description VarianceGammaModel(double initialValue, double riskFreeRate, double sigma, double theta, double nu)Construct a Variance Gamma model with constant rates for the forward price (i.e. repo rate minus dividend yield) and for the discount curve.VarianceGammaModel(double initialValue, double riskFreeRate, double discountRate, double sigma, double theta, double nu)Construct a Variance Gamma model with constant rates for the forward price (i.e. repo rate minus dividend yield) and for the discount curve.VarianceGammaModel(double initialValue, DiscountCurve discountCurveForForwardRate, DiscountCurve discountCurveForDiscountRate, double sigma, double theta, double nu)Construct a Variance Gamma model with discount curves for the forward price (i.e. repo rate minus dividend yield) and for discounting.VarianceGammaModel(VarianceGammaModelDescriptor descriptor)Create the model from a descriptor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RandomVariableapplyStateSpaceTransform(int componentIndex, RandomVariable randomVariable)Applies the state space transform fi to the given state random variable such that Yi → fi(Yi) =: Xi.RandomVariableapplyStateSpaceTransformInverse(int componentIndex, RandomVariable randomVariable)ProcessModelgetCloneWithModifiedData(Map<String,Object> dataModified)Returns a clone of this model where the specified properties have been modified.DiscountCurvegetDiscountCurveForDiscountRate()DiscountCurvegetDiscountCurveForForwardRate()doublegetDiscountRate()RandomVariable[]getDrift(int timeIndex, RandomVariable[] realizationAtTimeIndex, RandomVariable[] realizationPredictor)This method has to be implemented to return the drift, i.e.RandomVariable[]getFactorLoading(int timeIndex, int componentIndex, RandomVariable[] realizationAtTimeIndex)This method has to be implemented to return the factor loadings, i.e.RandomVariable[]getInitialState()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.doublegetNu()intgetNumberOfComponents()Returns the number of componentsRandomVariablegetNumeraire(double time)Return the numeraire at a given time index.RandomVariablegetRandomVariableForConstant(double value)Return a random variable initialized with a constant using the models random variable factory.doublegetRiskFreeRate()doublegetSigma()doublegetTheta()StringtoString()-
Methods inherited from class net.finmath.montecarlo.model.AbstractProcessModel
getInitialValue, getMonteCarloWeights, getNumberOfFactors, getProcess, getProcessValue, getReferenceDate, getTime, getTimeDiscretization, getTimeIndex, setProcess
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.finmath.montecarlo.model.ProcessModel
getDrift, getFactorLoading, getInitialState, getNumeraire
-
-
-
-
Constructor Detail
-
VarianceGammaModel
public VarianceGammaModel(VarianceGammaModelDescriptor descriptor)
Create the model from a descriptor.- Parameters:
descriptor- A descriptor of the model.
-
VarianceGammaModel
public VarianceGammaModel(double initialValue, DiscountCurve discountCurveForForwardRate, DiscountCurve discountCurveForDiscountRate, double sigma, double theta, double nu)Construct a Variance Gamma model with discount curves for the forward price (i.e. repo rate minus dividend yield) and for discounting.- 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 ratediscountCurveForDiscountRate- The curve specifying \( t \mapsto exp(- r^{\text{d}}(t) \cdot t) \) - with \( r^{\text{d}}(t) \) the discount ratesigma- The parameter \( \sigma \).theta- The parameter \( \theta \).nu- The parameter \( \nu \).
-
VarianceGammaModel
public VarianceGammaModel(double initialValue, double riskFreeRate, double discountRate, double sigma, double theta, double nu)Construct a Variance Gamma model with constant rates for the forward price (i.e. repo rate minus dividend yield) and for the discount curve.- Parameters:
initialValue- \( S_{0} \) - spot - initial value of SriskFreeRate- The constant risk free rate for the drift (repo rate of the underlying).discountRate- The constant rate used for discounting.sigma- The parameter \( \sigma \).theta- The parameter \( \theta \).nu- The parameter \( \nu \).
-
VarianceGammaModel
public VarianceGammaModel(double initialValue, double riskFreeRate, double sigma, double theta, double nu)Construct a Variance Gamma model with constant rates for the forward price (i.e. repo rate minus dividend yield) and for the discount curve.- Parameters:
initialValue- \( S_{0} \) - spot - initial value of SriskFreeRate- The constant risk free rate for the drift (repo rate of the underlying).sigma- The parameter \( \sigma \).theta- The parameter \( \theta \).nu- The parameter \( \nu \).
-
-
Method Detail
-
getNumberOfComponents
public int getNumberOfComponents()
Description copied from interface:ProcessModelReturns the number of components- Returns:
- The number of components
-
applyStateSpaceTransform
public RandomVariable applyStateSpaceTransform(int componentIndex, RandomVariable randomVariable)
Description copied from interface:ProcessModelApplies the state space transform fi to the given state random variable such that Yi → fi(Yi) =: Xi.- Parameters:
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(int componentIndex, RandomVariable randomVariable)
-
getInitialState
public RandomVariable[] getInitialState()
Description copied from interface:ProcessModelReturns 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.- Returns:
- The initial value of the state variable of the process Y(t=0).
-
getNumeraire
public RandomVariable getNumeraire(double time) throws CalculationException
Description copied from interface:ProcessModelReturn the numeraire at a given time index. Note: The random variable returned is a defensive copy and may be modified.- Parameters:
time- The time t for which the numeraire N(t) should be returned.- Returns:
- The numeraire at the specified time as
RandomVariableFromDoubleArray - Throws:
CalculationException- Thrown if the valuation fails, specific cause may be available via thecause()method.
-
getDrift
public RandomVariable[] getDrift(int timeIndex, RandomVariable[] realizationAtTimeIndex, RandomVariable[] realizationPredictor)
Description copied from interface:ProcessModelThis 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:
timeIndex- The time index (related to the model times discretization).realizationAtTimeIndex- The given realization at timeIndexrealizationPredictor- The given realization attimeIndex+1or 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(int timeIndex, int componentIndex, RandomVariable[] realizationAtTimeIndex)
Description copied from interface:ProcessModelThis 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:
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.
-
getRandomVariableForConstant
public RandomVariable getRandomVariableForConstant(double value)
Description copied from interface:ProcessModelReturn 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
public ProcessModel getCloneWithModifiedData(Map<String,Object> dataModified) throws CalculationException
Description copied from interface:ProcessModelReturns 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).
- Throws:
CalculationException- Thrown when the model could not be created.
-
getDiscountCurveForForwardRate
public DiscountCurve getDiscountCurveForForwardRate()
- Returns:
- the discountCurveForForwardRate
-
getRiskFreeRate
public double getRiskFreeRate()
- Returns:
- the riskFreeRate
-
getDiscountCurveForDiscountRate
public DiscountCurve getDiscountCurveForDiscountRate()
- Returns:
- the discountCurveForDiscountRate
-
getDiscountRate
public double getDiscountRate()
- Returns:
- the discountRate
-
getSigma
public double getSigma()
- Returns:
- the sigma
-
getTheta
public double getTheta()
- Returns:
- the theta
-
getNu
public double getNu()
- Returns:
- the nu
-
-