Class ForwardSensitivities

java.lang.Object
net.finmath.montecarlo.automaticdifferentiation.forwardsensitivities.ForwardSensitivities

public class ForwardSensitivities extends Object
Provides static methods to obtain reduced stochastic hedge ratios dV/dP_j. The hedge ratios are represented in a finite solution basis \[ phi_j^r(omega_l) = sum_q xi_j^q X_q(omega_l) \text{.} \] Two reduced coefficient criteria are supported: Here b_l is the pathwise derivative of the derivative value with respect to model primitives M_i, and A_l is the pathwise derivative of hedge instruments P_j with respect to the same primitives. See https://ssrn.com/abstract=6758541 for documentation.
Author:
Christian Fries
  • Constructor Details

    • ForwardSensitivities

      public ForwardSensitivities()
  • Method Details

    • getHedgeRatiosProjected

      public static ForwardSensitivities.ProjectedHedgeRatioResult getHedgeRatiosProjected(Map<String,Long> parameterIDsByName, double evaluationTime, RandomVariable derivativeValue, RandomVariable[] hedgePortfolioValues, RandomVariable[] basisFunctions, double regularizationLambda) throws CalculationException
      Backwards-compatible projected stochastic hedge-ratio calculation. This solves the projected/Galerkin moment equations using the same basis for the solution and test spaces, <(A phi^r - b)_i, X_s>_N = 0.
      Throws:
      CalculationException
    • getHedgeRatiosProjected

      public static ForwardSensitivities.ProjectedHedgeRatioResult getHedgeRatiosProjected(Map<String,Long> parameterIDsByName, double evaluationTime, RandomVariable derivativeValue, RandomVariable[] hedgePortfolioValues, RandomVariable[] solutionBasisFunctions, RandomVariable[] testBasisFunctions, double regularizationLambda) throws CalculationException
      Projected stochastic hedge-ratio calculation with separate solution and test bases. The hedge ratios use the solution basis X_q, phi_j^r = sum_q xi_j^q X_q, while the residual is tested against Y_s, <(A phi^r - b)_i, Y_s>_N = 0. Taking Y_s = X_s gives the Galerkin case. Different Y_s give a Petrov-Galerkin projected moment system.
      Throws:
      CalculationException
    • getHedgeRatiosEmpiricalL2

      public static ForwardSensitivities.ProjectedHedgeRatioResult getHedgeRatiosEmpiricalL2(Map<String,Long> parameterIDsByName, double evaluationTime, RandomVariable derivativeValue, RandomVariable[] hedgePortfolioValues, RandomVariable[] basisFunctions, double regularizationLambda) throws CalculationException
      Reduced empirical L2 stochastic hedge-ratio calculation. This solves min_xi 1/N sum_l ||A_l phi_l^r - b_l||_2^2 + lambda ||xi||_2^2, without projecting the output residual onto the hedge-ratio basis.
      Throws:
      CalculationException
    • getHedgeRatiosReduced

      public static ForwardSensitivities.ProjectedHedgeRatioResult getHedgeRatiosReduced(Map<String,Long> parameterIDsByName, double evaluationTime, RandomVariable derivativeValue, RandomVariable[] hedgePortfolioValues, RandomVariable[] basisFunctions, double regularizationLambda, ForwardSensitivities.ReductionMethod reductionMethod) throws CalculationException
      General reduced stochastic hedge-ratio calculation supporting both coefficient criteria.
      Parameters:
      parameterIDsByName - Map of model-parameter names to AAD IDs.
      evaluationTime - The time t at which the hedge ratios are calculated.
      derivativeValue - The product value V.
      hedgePortfolioValues - The hedge-instrument values P_j.
      basisFunctions - Basis random variables X_q evaluated on the same paths. For PROJECTED_GALERKIN this basis is used both as solution and test basis.
      regularizationLambda - Lambda in the selected regularized criterion. Use 0.0 for unregularized.
      reductionMethod - The reduced coefficient criterion.
      Returns:
      stochastic hedge ratios and reduced-system diagnostics.
      Throws:
      CalculationException
    • getHedgeRatios

      public static ForwardSensitivities.ProjectedHedgeRatioResult getHedgeRatios(Map<String,Long> parameterIDsByName, double evaluationTime, RandomVariable derivativeValue, RandomVariable[] hedgePortfolioValues, RandomVariable[] solutionBasisFunctions, RandomVariable[] testBasisFunctions, double regularizationLambda, ForwardSensitivities.ReductionMethod reductionMethod) throws CalculationException
      General reduced stochastic hedge-ratio calculation supporting both coefficient criteria.
      Parameters:
      parameterIDsByName - Map of model-parameter names to AAD IDs.
      evaluationTime - The time t at which the hedge ratios are calculated.
      derivativeValue - The product value V.
      hedgePortfolioValues - The hedge-instrument values P_j.
      solutionBasisFunctions - Basis random variables X_q used for the hedge ratios.
      testBasisFunctions - Basis random variables Y_s used for PROJECTED_GALERKIN moments. May be null for L2. If null for PROJECTED_GALERKIN, the solution basis is used as the test basis.
      regularizationLambda - Lambda in the selected regularized criterion. Use 0.0 for unregularized.
      reductionMethod - The reduced coefficient criterion.
      Returns:
      stochastic hedge ratios and reduced-system diagnostics.
      Throws:
      CalculationException
    • getDifferentiableModelParameterIDs

      public static Map<String,Long> getDifferentiableModelParameterIDs(IndependentModelParameterProvider parameterProvider)
      Extract differentiable model parameters M_i and their AAD IDs.