Class FDMHestonModel
- All Implemented Interfaces:
FiniteDifferenceBoundary, FiniteDifferenceEquityModel, FiniteDifferenceModel, Model
- Direct Known Subclasses:
FDMBatesModel
State variables are (S, v) where S is the spot and v
is the
instantaneous variance.
The methods getDrift(double, double...) and getFactorLoading(double, double...)
follow the conventions used in FiniteDifferenceEquityModel:
getDriftreturns the vector of drifts for the state variables.getFactorLoadingreturns the matrix of factor loadings (here 2 factors), producing the correct covariance with correlationrho.
Boundary conditions are provided through the FiniteDifferenceBoundary
interface methods,
via FDBoundaryFactory.
- Author:
- Alessandro Gnoatto, Enrico De Vecchi
-
Constructor Summary
ConstructorsConstructorDescriptionFDMHestonModel(double initialSpot, double initialVariance, double riskFreeRate, double dividendYieldRate, double kappa, double thetaV, double sigma, double rho, SpaceTimeDiscretization spaceTimeDiscretization) Constructs a Heston finite difference model for option pricing from constant rates.FDMHestonModel(double initialSpot, double initialVariance, double riskFreeRate, double kappa, double thetaV, double sigma, double rho, SpaceTimeDiscretization spaceTimeDiscretization) Constructs a Heston finite difference model for option pricing from a constant risk-free rate and zero dividend yield.FDMHestonModel(double initialSpot, double initialVariance, DiscountCurve riskFreeCurve, double kappa, double thetaV, double sigma, double rho, SpaceTimeDiscretization spaceTimeDiscretization) Constructs a Heston finite difference model for option pricing without dividend yield curve (i.e. dividend yield is assumed to be zero).FDMHestonModel(double initialSpot, double initialVariance, DiscountCurve riskFreeCurve, DiscountCurve dividendYieldCurve, double kappa, double thetaV, double sigma, double rho, SpaceTimeDiscretization spaceTimeDiscretization) Constructs a Heston finite difference model for option pricing. -
Method Summary
Modifier and TypeMethodDescriptiongetBoundaryConditionsAtLowerBoundary(FiniteDifferenceEquityProduct product, double time, double... riskFactors) Returns the boundary conditions at the lower boundary.getBoundaryConditionsAtUpperBoundary(FiniteDifferenceEquityProduct product, double time, double... riskFactors) Returns the boundary conditions at the upper boundary.getCloneWithModifiedSpaceTimeDiscretization(SpaceTimeDiscretization newSpaceTimeDiscretization) Returns a clone of this model with a modified space-time discretization.double[][]getCovariance(double time, double... stateVariables) Convenience method returning the covariance matrixa = B B^T, derived fromgetFactorLoading(double, double...).Returns the dividend-yield discount curve.double[]getDrift(double time, double... stateVariables) Returns the drift vector of the model state variables.double[][]getFactorLoading(double time, double... stateVariables) Returns the factor-loading matrix of the model state variables.double[]Returns the initial value of the system of SDEs.doublegetKappa()Returns the mean reversion speed of variance.doublegetRho()Returns the correlation between the Brownian motions.Returns the risk-free discount curve used for pricing.doublegetSigma()Returns the vol-of-vol parameter.Returns the space-time discretization used by this finite difference model.doubleReturns the long-term mean of variance.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface FiniteDifferenceEquityModel
getDividendYieldCurves, getJumpComponent
-
Constructor Details
-
FDMHestonModel
public FDMHestonModel(double initialSpot, double initialVariance, DiscountCurve riskFreeCurve, DiscountCurve dividendYieldCurve, double kappa, double thetaV, double sigma, double rho, SpaceTimeDiscretization spaceTimeDiscretization) Constructs a Heston finite difference model for option pricing.- Parameters:
initialSpot- Initial spot price.initialVariance- Initial variance.riskFreeCurve- Risk-free discount curve.dividendYieldCurve- Dividend yield discount curve.kappa- Mean reversion speed of variance.thetaV- Long-term mean of variance.sigma- Vol-of-vol parameter.rho- Correlation between spot and variance Brownian motions.spaceTimeDiscretization- Grid object defining the spatial discretization.
-
FDMHestonModel
public FDMHestonModel(double initialSpot, double initialVariance, DiscountCurve riskFreeCurve, double kappa, double thetaV, double sigma, double rho, SpaceTimeDiscretization spaceTimeDiscretization) Constructs a Heston finite difference model for option pricing without dividend yield curve (i.e. dividend yield is assumed to be zero).- Parameters:
initialSpot- Initial spot price.initialVariance- Initial variance.riskFreeCurve- Risk-free discount curve.kappa- Mean reversion speed of variance.thetaV- Long-term mean of variance.sigma- Vol-of-vol parameter.rho- Correlation between spot and variance Brownian motions.spaceTimeDiscretization- Grid object defining the spatial discretization.
-
FDMHestonModel
public FDMHestonModel(double initialSpot, double initialVariance, double riskFreeRate, double dividendYieldRate, double kappa, double thetaV, double sigma, double rho, SpaceTimeDiscretization spaceTimeDiscretization) Constructs a Heston finite difference model for option pricing from constant rates.- Parameters:
initialSpot- Initial spot price.initialVariance- Initial variance.riskFreeRate- Constant risk-free rate.dividendYieldRate- Constant dividend yield rate.kappa- Mean reversion speed of variance.thetaV- Long-term mean of variance.sigma- Vol-of-vol parameter.rho- Correlation between spot and variance Brownian motions.spaceTimeDiscretization- Grid object defining the spatial discretization.
-
FDMHestonModel
public FDMHestonModel(double initialSpot, double initialVariance, double riskFreeRate, double kappa, double thetaV, double sigma, double rho, SpaceTimeDiscretization spaceTimeDiscretization) Constructs a Heston finite difference model for option pricing from a constant risk-free rate and zero dividend yield.- Parameters:
initialSpot- Initial spot price.initialVariance- Initial variance.riskFreeRate- Constant risk-free rate.kappa- Mean reversion speed of variance.thetaV- Long-term mean of variance.sigma- Vol-of-vol parameter.rho- Correlation between spot and variance Brownian motions.spaceTimeDiscretization- Grid object defining the spatial discretization.
-
-
Method Details
-
getRiskFreeCurve
Description copied from interface:FiniteDifferenceEquityModelReturns the risk-free discount curve used for pricing.- Specified by:
getRiskFreeCurvein interfaceFiniteDifferenceEquityModel- Returns:
- The risk-free discount curve.
-
getDividendYieldCurve
Description copied from interface:FiniteDifferenceEquityModelReturns the dividend-yield discount curve.This is the legacy single-asset accessor and remains part of the interface to preserve backward compatibility with the current code base.
For true multi-asset models with one dividend curve per underlying, prefer
FiniteDifferenceEquityModel.getDividendYieldCurves(). Such models may override this method with a convention suitable for backward compatibility.- Specified by:
getDividendYieldCurvein interfaceFiniteDifferenceEquityModel- Returns:
- The dividend-yield discount curve.
-
getInitialValue
public double[] getInitialValue()Returns the initial value of the system of SDEs.- Specified by:
getInitialValuein interfaceFiniteDifferenceEquityModel- Returns:
- The initial spot.
-
getKappa
public double getKappa()Returns the mean reversion speed of variance.- Returns:
- The parameter
kappa.
-
getThetaV
public double getThetaV()Returns the long-term mean of variance.- Returns:
- The parameter
thetaV.
-
getSigma
public double getSigma()Returns the vol-of-vol parameter.- Returns:
- The parameter
sigma.
-
getRho
public double getRho()Returns the correlation between the Brownian motions.- Returns:
- The parameter
rho.
-
getSpaceTimeDiscretization
Description copied from interface:FiniteDifferenceModelReturns the space-time discretization used by this finite difference model.The discretization defines the grid in both time and space on which the PDE approximation is constructed.
- Specified by:
getSpaceTimeDiscretizationin interfaceFiniteDifferenceModel- Returns:
- The
SpaceTimeDiscretizationused by this model.
-
getDrift
public double[] getDrift(double time, double... stateVariables) Description copied from interface:FiniteDifferenceEquityModelReturns the drift vector of the model state variables.The returned coefficients must be expressed in the same coordinates as the PDE state variables used by the finite-difference solver.
If the state vector is
X = (X1, ..., Xn), then this method returns the vectormu(t, X)indX_i(t) = mu_i(t, X_t) dt + ....- Specified by:
getDriftin interfaceFiniteDifferenceEquityModel- Parameters:
time- The evaluation time.stateVariables- The current values of the model state variables.- Returns:
- The drift vector.
-
getFactorLoading
public double[][] getFactorLoading(double time, double... stateVariables) Description copied from interface:FiniteDifferenceEquityModelReturns the factor-loading matrix of the model state variables.The returned coefficients must be expressed in the same coordinates as the PDE state variables used by the finite-difference solver.
If the state vector is
X = (X1, ..., Xn), then this method returns the matrixb(t, X)indX_i(t) = mu_i(t, X_t) dt + sum_j b_{i,j}(t, X_t) dW_j(t).- Specified by:
getFactorLoadingin interfaceFiniteDifferenceEquityModel- Parameters:
time- The evaluation time.stateVariables- The current values of the model state variables.- Returns:
- The factor-loading matrix.
-
getCovariance
public double[][] getCovariance(double time, double... stateVariables) Convenience method returning the covariance matrixa = B B^T, derived fromgetFactorLoading(double, double...).- Parameters:
time- Evaluation time.stateVariables- State variables.- Returns:
- The covariance matrix.
-
getBoundaryConditionsAtLowerBoundary
public BoundaryCondition[] getBoundaryConditionsAtLowerBoundary(FiniteDifferenceEquityProduct product, double time, double... riskFactors) Description copied from interface:FiniteDifferenceBoundaryReturns the boundary conditions at the lower boundary.The returned array is indexed by state-variable dimension.
- Specified by:
getBoundaryConditionsAtLowerBoundaryin interfaceFiniteDifferenceBoundary- Parameters:
product- The product being valued.time- The running time.riskFactors- The state variables specifying the boundary location.- Returns:
- The lower-boundary conditions by dimension.
-
getBoundaryConditionsAtUpperBoundary
public BoundaryCondition[] getBoundaryConditionsAtUpperBoundary(FiniteDifferenceEquityProduct product, double time, double... riskFactors) Description copied from interface:FiniteDifferenceBoundaryReturns the boundary conditions at the upper boundary.The returned array is indexed by state-variable dimension.
- Specified by:
getBoundaryConditionsAtUpperBoundaryin interfaceFiniteDifferenceBoundary- Parameters:
product- The product being valued.time- The running time.riskFactors- The state variables specifying the boundary location.- Returns:
- The upper-boundary conditions by dimension.
-
getCloneWithModifiedSpaceTimeDiscretization
public FiniteDifferenceEquityModel getCloneWithModifiedSpaceTimeDiscretization(SpaceTimeDiscretization newSpaceTimeDiscretization) Description copied from interface:FiniteDifferenceEquityModelReturns a clone of this model with a modified space-time discretization.The returned model should represent the same stochastic dynamics and market data as the original one, but on the provided discretization.
- Specified by:
getCloneWithModifiedSpaceTimeDiscretizationin interfaceFiniteDifferenceEquityModel- Parameters:
newSpaceTimeDiscretization- The new space-time discretization.- Returns:
- A clone of this model with the modified discretization.
-