Class DigitalBasketOption

java.lang.Object
net.finmath.finitedifference.assetderivativevaluation.products.DigitalBasketOption
All Implemented Interfaces:
FiniteDifferenceEquityProduct, FiniteDifferenceProduct<FiniteDifferenceEquityModel>, Product

public class DigitalBasketOption extends Object implements FiniteDifferenceEquityProduct
Finite-difference valuation of a European cash-or-nothing digital option on two assets.

The class unifies three practically relevant two-asset digital payoffs:

  • linear-combination digital,
  • best-of digital,
  • worst-of digital.

Let S1 and S2 denote the two asset values at maturity T, let K be the strike, let C &gt;= 0 be the cash payoff, and let \omega \in \{+1,-1\} denote the call/put sign.

In DigitalBasketOption.BasketDigitalType.LINEAR_COMBINATION mode, with signed quantities q1 and q2, the payoff is

C \mathbf{1}_{\{\omega (q_1 S_1(T) + q_2 S_2(T) - K) > 0\}}.

In DigitalBasketOption.BasketDigitalType.BEST_OF mode, the payoff is

C \mathbf{1}_{\{\omega (\max(S_1(T),S_2(T)) - K) > 0\}}.

In DigitalBasketOption.BasketDigitalType.WORST_OF mode, the payoff is

C \mathbf{1}_{\{\omega (\min(S_1(T),S_2(T)) - K) > 0\}}.

The current implementation supports only European exercise and requires a two-dimensional model state.

Author:
Alessandro Gnoatto
  • Constructor Details

    • DigitalBasketOption

      public DigitalBasketOption(String[] underlyingNames, double maturity, DigitalBasketOption.BasketDigitalType basketDigitalType, double[] quantities, double strike, double cashPayoff, CallOrPut callOrPut)
      Creates a digital basket option.
      Parameters:
      underlyingNames - Names of the underlyings. May be null. If provided, the array length must be 2.
      maturity - Maturity.
      basketDigitalType - Payoff type.
      quantities - Signed quantities for DigitalBasketOption.BasketDigitalType.LINEAR_COMBINATION. Ignored otherwise and may be null.
      strike - Strike.
      cashPayoff - Cash payoff.
      callOrPut - Option type.
    • DigitalBasketOption

      public DigitalBasketOption(double maturity, DigitalBasketOption.BasketDigitalType basketDigitalType, double[] quantities, double strike, double cashPayoff, CallOrPut callOrPut)
      Creates a digital basket option.
      Parameters:
      maturity - Maturity.
      basketDigitalType - Payoff type.
      quantities - Signed quantities for DigitalBasketOption.BasketDigitalType.LINEAR_COMBINATION. Ignored otherwise and may be null.
      strike - Strike.
      cashPayoff - Cash payoff.
      callOrPut - Option type.
  • Method Details

    • linearCombination

      public static DigitalBasketOption linearCombination(String[] underlyingNames, double maturity, double[] quantities, double strike, double cashPayoff, CallOrPut callOrPut)
      Creates a linear-combination digital option.
      Parameters:
      underlyingNames - Names of the underlyings.
      maturity - Maturity.
      quantities - Signed quantities.
      strike - Strike.
      cashPayoff - Cash payoff.
      callOrPut - Option type.
      Returns:
      The product.
    • bestOf

      public static DigitalBasketOption bestOf(String[] underlyingNames, double maturity, double strike, double cashPayoff, CallOrPut callOrPut)
      Creates a best-of digital option.
      Parameters:
      underlyingNames - Names of the underlyings.
      maturity - Maturity.
      strike - Strike.
      cashPayoff - Cash payoff.
      callOrPut - Option type.
      Returns:
      The product.
    • worstOf

      public static DigitalBasketOption worstOf(String[] underlyingNames, double maturity, double strike, double cashPayoff, CallOrPut callOrPut)
      Creates a worst-of digital option.
      Parameters:
      underlyingNames - Names of the underlyings.
      maturity - Maturity.
      strike - Strike.
      cashPayoff - Cash payoff.
      callOrPut - Option type.
      Returns:
      The product.
    • getValue

      public double[] getValue(double evaluationTime, FiniteDifferenceEquityModel model)
      Description copied from interface: FiniteDifferenceProduct
      Returns the value.
      Specified by:
      getValue in interface FiniteDifferenceProduct<FiniteDifferenceEquityModel>
      Parameters:
      evaluationTime - The value.
      model - The value.
      Returns:
      The value.
    • getValues

      public double[][] getValues(FiniteDifferenceEquityModel model)
      Description copied from interface: FiniteDifferenceProduct
      Returns the value.
      Specified by:
      getValues in interface FiniteDifferenceProduct<FiniteDifferenceEquityModel>
      Parameters:
      model - The value.
      Returns:
      The value.
    • getUnderlyingNames

      public String[] getUnderlyingNames()
      Returns the names of the underlyings.
      Returns:
      The names of the underlyings, or null if unspecified.
    • getMaturity

      public double getMaturity()
      Returns the maturity.
      Returns:
      The maturity.
    • getBasketDigitalType

      public DigitalBasketOption.BasketDigitalType getBasketDigitalType()
      Returns the payoff type.
      Returns:
      The payoff type.
    • getQuantities

      public double[] getQuantities()
      Returns the signed quantities.
      Returns:
      The signed quantities, or null if not applicable.
    • getStrike

      public double getStrike()
      Returns the strike.
      Returns:
      The strike.
    • getCashPayoff

      public double getCashPayoff()
      Returns the cash payoff.
      Returns:
      The cash payoff.
    • getCallOrPut

      public CallOrPut getCallOrPut()
      Returns the option type.
      Returns:
      The option type.
    • getExercise

      public Exercise getExercise()
      Returns the exercise specification.
      Returns:
      The exercise specification.
    • toString

      public String toString()
      Overrides:
      toString in class Object