Class FDMMultiAssetBlackScholesModel
- All Implemented Interfaces:
FiniteDifferenceBoundary, FiniteDifferenceEquityModel, FiniteDifferenceModel, Model
The model is dimension agnostic and describes an arbitrary number
n >= 1 of risky assets
(S_1, ..., S_n). For asset i, the dynamics under the
pricing measure are
dS_i(t) = (r(t) - q_i(t)) S_i(t) dt + sigma_i S_i(t) dW_i(t),
with instantaneous covariation structure
d<W_i, W_j>_t = rho_{i,j} dt.
Here r(t) is the risk-free rate implied by a single risk-free
discount
curve, while each asset has its own dividend-yield discount curve and hence
its own dividend yield q_i(t).
If L denotes a Cholesky factor of the correlation matrix
rho, then the factor-loading matrix is chosen as
b_{i,j}(t,S) = sigma_i S_i L_{i,j},
which yields the instantaneous covariance matrix
(b b^T)_{i,j} = rho_{i,j} sigma_i sigma_j S_i S_j.
The class is a model abstraction only. It is intentionally agnostic with respect to the dimensional limits of the available PDE solvers. In particular, the model may be created for any dimension, even if a given finite-difference solver currently supports only dimensions one, two, or three.
For boundary conditions, this first implementation returns
StandardBoundaryCondition.none() in every spatial direction by
default.
This keeps the model generic and leaves product-specific asymptotic boundary
design to specialized boundary logic introduced later.
- Author:
- Alessandro Gnoatto
-
Constructor Summary
ConstructorsConstructorDescriptionFDMMultiAssetBlackScholesModel(double[] initialValues, double riskFreeRate, double[] dividendYieldRates, double[] volatilities, double[][] correlationMatrix, SpaceTimeDiscretization spaceTimeDiscretization) Creates a multi-asset Black-Scholes finite-difference model from constant rates and constant volatilities.FDMMultiAssetBlackScholesModel(double[] initialValues, DiscountCurve riskFreeCurve, double[] volatilities, double[][] correlationMatrix, SpaceTimeDiscretization spaceTimeDiscretization) Creates a multi-asset Black-Scholes finite-difference model with zero dividend yield for every asset.FDMMultiAssetBlackScholesModel(double[] initialValues, DiscountCurve riskFreeCurve, DiscountCurve[] dividendYieldCurves, double[] volatilities, double[][] correlationMatrix, SpaceTimeDiscretization spaceTimeDiscretization) Creates a multi-asset Black-Scholes finite-difference model. -
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[][]Returns the instantaneous correlation matrix.Returns the legacy single-asset dividend-yield accessor.Returns the dividend-yield discount curves of the model.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 state vector of the model.intReturns the number of risky assets of the model.Returns the risk-free discount curve used for pricing.Returns the space-time discretization used by this finite difference model.double[]Returns the asset volatilities.toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface FiniteDifferenceEquityModel
getJumpComponent
-
Constructor Details
-
FDMMultiAssetBlackScholesModel
public FDMMultiAssetBlackScholesModel(double[] initialValues, DiscountCurve riskFreeCurve, DiscountCurve[] dividendYieldCurves, double[] volatilities, double[][] correlationMatrix, SpaceTimeDiscretization spaceTimeDiscretization) Creates a multi-asset Black-Scholes finite-difference model.- Parameters:
initialValues- Initial asset values.riskFreeCurve- Risk-free discount curve.dividendYieldCurves- Dividend-yield discount curves, one per asset.volatilities- Constant volatilities, one per asset.correlationMatrix- Instantaneous correlation matrix.spaceTimeDiscretization- Space-time discretization.
-
FDMMultiAssetBlackScholesModel
public FDMMultiAssetBlackScholesModel(double[] initialValues, double riskFreeRate, double[] dividendYieldRates, double[] volatilities, double[][] correlationMatrix, SpaceTimeDiscretization spaceTimeDiscretization) Creates a multi-asset Black-Scholes finite-difference model from constant rates and constant volatilities.- Parameters:
initialValues- Initial asset values.riskFreeRate- Constant risk-free rate.dividendYieldRates- Constant dividend-yield rates, one per asset.volatilities- Constant volatilities, one per asset.correlationMatrix- Instantaneous correlation matrix.spaceTimeDiscretization- Space-time discretization.
-
FDMMultiAssetBlackScholesModel
public FDMMultiAssetBlackScholesModel(double[] initialValues, DiscountCurve riskFreeCurve, double[] volatilities, double[][] correlationMatrix, SpaceTimeDiscretization spaceTimeDiscretization) Creates a multi-asset Black-Scholes finite-difference model with zero dividend yield for every asset.- Parameters:
initialValues- Initial asset values.riskFreeCurve- Risk-free discount curve.volatilities- Constant volatilities, one per asset.correlationMatrix- Instantaneous correlation matrix.spaceTimeDiscretization- Space-time 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
Returns the legacy single-asset dividend-yield accessor.For true multi-asset models with more than one dividend curve, callers should use
getDividendYieldCurves()instead.- Specified by:
getDividendYieldCurvein interfaceFiniteDifferenceEquityModel- Returns:
- The unique dividend-yield curve if the model has dimension one.
-
getDividendYieldCurves
Description copied from interface:FiniteDifferenceEquityModelReturns the dividend-yield discount curves of the model.The default implementation preserves backward compatibility with the current single-asset code base by wrapping
FiniteDifferenceEquityModel.getDividendYieldCurve()into a one-element array.Multi-asset models should override this method and return one dividend- yield curve per underlying asset, ordered consistently with the model state vector.
- Specified by:
getDividendYieldCurvesin interfaceFiniteDifferenceEquityModel- Returns:
- The dividend-yield discount curves.
-
getNumberOfAssets
public int getNumberOfAssets()Returns the number of risky assets of the model.- Returns:
- The number of risky assets.
-
getVolatilities
public double[] getVolatilities()Returns the asset volatilities.- Returns:
- The volatilities.
-
getCorrelationMatrix
public double[][] getCorrelationMatrix()Returns the instantaneous correlation matrix.- Returns:
- The correlation matrix.
-
getInitialValue
public double[] getInitialValue()Description copied from interface:FiniteDifferenceEquityModelReturns the initial state vector of the model.The returned values must be consistent with the state variables used by the PDE. For example, if the first spatial coordinate is
log(S), then the first component should belog(S0)rather thanS0.- Specified by:
getInitialValuein interfaceFiniteDifferenceEquityModel- Returns:
- The initial state vector.
-
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.
-
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.
-
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.
-
toString
-