Class FDMMultiAssetBlackScholesModel

java.lang.Object
net.finmath.finitedifference.assetderivativevaluation.models.FDMMultiAssetBlackScholesModel
All Implemented Interfaces:
FiniteDifferenceBoundary, FiniteDifferenceEquityModel, FiniteDifferenceModel, Model

public class FDMMultiAssetBlackScholesModel extends Object implements FiniteDifferenceEquityModel
Finite-difference model for a multi-asset Black-Scholes market with constant volatilities and constant instantaneous correlation.

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 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

      public DiscountCurve getRiskFreeCurve()
      Description copied from interface: FiniteDifferenceEquityModel
      Returns the risk-free discount curve used for pricing.
      Specified by:
      getRiskFreeCurve in interface FiniteDifferenceEquityModel
      Returns:
      The risk-free discount curve.
    • getDividendYieldCurve

      public DiscountCurve 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:
      getDividendYieldCurve in interface FiniteDifferenceEquityModel
      Returns:
      The unique dividend-yield curve if the model has dimension one.
    • getDividendYieldCurves

      public DiscountCurve[] getDividendYieldCurves()
      Description copied from interface: FiniteDifferenceEquityModel
      Returns 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:
      getDividendYieldCurves in interface FiniteDifferenceEquityModel
      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: FiniteDifferenceEquityModel
      Returns 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 be log(S0) rather than S0.

      Specified by:
      getInitialValue in interface FiniteDifferenceEquityModel
      Returns:
      The initial state vector.
    • getDrift

      public double[] getDrift(double time, double... stateVariables)
      Description copied from interface: FiniteDifferenceEquityModel
      Returns 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 vector mu(t, X) in

      dX_i(t) = mu_i(t, X_t) dt + ....

      Specified by:
      getDrift in interface FiniteDifferenceEquityModel
      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: FiniteDifferenceEquityModel
      Returns 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 matrix b(t, X) in

      dX_i(t) = mu_i(t, X_t) dt + sum_j b_{i,j}(t, X_t) dW_j(t).

      Specified by:
      getFactorLoading in interface FiniteDifferenceEquityModel
      Parameters:
      time - The evaluation time.
      stateVariables - The current values of the model state variables.
      Returns:
      The factor-loading matrix.
    • getSpaceTimeDiscretization

      public SpaceTimeDiscretization getSpaceTimeDiscretization()
      Description copied from interface: FiniteDifferenceModel
      Returns 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:
      getSpaceTimeDiscretization in interface FiniteDifferenceModel
      Returns:
      The SpaceTimeDiscretization used by this model.
    • getBoundaryConditionsAtLowerBoundary

      public BoundaryCondition[] getBoundaryConditionsAtLowerBoundary(FiniteDifferenceEquityProduct product, double time, double... riskFactors)
      Description copied from interface: FiniteDifferenceBoundary
      Returns the boundary conditions at the lower boundary.

      The returned array is indexed by state-variable dimension.

      Specified by:
      getBoundaryConditionsAtLowerBoundary in interface FiniteDifferenceBoundary
      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: FiniteDifferenceBoundary
      Returns the boundary conditions at the upper boundary.

      The returned array is indexed by state-variable dimension.

      Specified by:
      getBoundaryConditionsAtUpperBoundary in interface FiniteDifferenceBoundary
      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: FiniteDifferenceEquityModel
      Returns 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:
      getCloneWithModifiedSpaceTimeDiscretization in interface FiniteDifferenceEquityModel
      Parameters:
      newSpaceTimeDiscretization - The new space-time discretization.
      Returns:
      A clone of this model with the modified discretization.
    • toString

      public String toString()
      Overrides:
      toString in class Object