Class DigitalOption

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

public class DigitalOption extends Object implements FiniteDifferenceEquityProduct
Digital option supporting cash-or-nothing and asset-or-nothing payoffs.

The class supports multiple exercise styles through the generic Exercise field. European exercise is the default when no explicit exercise object is provided.

For one-dimensional models, the terminal payoff is initialized using cell-averaged values in order to reduce grid bias caused by the payoff discontinuity at the strike.

For Bermudan and American exercise in one-dimensional models, the maturity layer remains cell-averaged, while exercise projection remains pointwise.

For the current two-dimensional models, the payoff is initialized pointwise on the first state variable, that is, on the asset dimension.

Author:
Alessandro Gnoatto
  • Constructor Details

    • DigitalOption

      public DigitalOption(String underlyingName, double maturity, double strike, CallOrPut callOrPutSign, DigitalPayoffType digitalPayoffType, double cashPayoff, Exercise exercise)
      Creates a digital option with explicit exercise specification.
      Parameters:
      underlyingName - Name of the underlying.
      maturity - Option maturity.
      strike - Option strike.
      callOrPutSign - Call or put flag.
      digitalPayoffType - Type of digital payoff.
      cashPayoff - Cash payoff for cash-or-nothing products.
      exercise - Exercise specification.
    • DigitalOption

      public DigitalOption(String underlyingName, double maturity, double strike, CallOrPut callOrPutSign, DigitalPayoffType digitalPayoffType, double cashPayoff)
      Creates a European digital option.
      Parameters:
      underlyingName - Name of the underlying.
      maturity - Option maturity.
      strike - Option strike.
      callOrPutSign - Call or put flag.
      digitalPayoffType - Type of digital payoff.
      cashPayoff - Cash payoff for cash-or-nothing products.
    • DigitalOption

      public DigitalOption(double maturity, double strike, CallOrPut callOrPutSign, DigitalPayoffType digitalPayoffType, double cashPayoff, Exercise exercise)
      Creates a digital option with explicit exercise specification.
      Parameters:
      maturity - Option maturity.
      strike - Option strike.
      callOrPutSign - Call or put flag.
      digitalPayoffType - Type of digital payoff.
      cashPayoff - Cash payoff for cash-or-nothing products.
      exercise - Exercise specification.
    • DigitalOption

      public DigitalOption(double maturity, double strike, CallOrPut callOrPutSign, DigitalPayoffType digitalPayoffType, double cashPayoff)
      Creates a European digital option.
      Parameters:
      maturity - Option maturity.
      strike - Option strike.
      callOrPutSign - Call or put flag.
      digitalPayoffType - Type of digital payoff.
      cashPayoff - Cash payoff for cash-or-nothing products.
    • DigitalOption

      public DigitalOption(String underlyingName, double maturity, double strike, double callOrPutSign, DigitalPayoffType digitalPayoffType, double cashPayoff, Exercise exercise)
      Creates a digital option with explicit exercise specification.
      Parameters:
      underlyingName - Name of the underlying.
      maturity - Option maturity.
      strike - Option strike.
      callOrPutSign - +1 for call, -1 for put.
      digitalPayoffType - Type of digital payoff.
      cashPayoff - Cash payoff for cash-or-nothing products.
      exercise - Exercise specification.
    • DigitalOption

      public DigitalOption(String underlyingName, double maturity, double strike, double callOrPutSign, DigitalPayoffType digitalPayoffType, double cashPayoff)
      Creates a European digital option.
      Parameters:
      underlyingName - Name of the underlying.
      maturity - Option maturity.
      strike - Option strike.
      callOrPutSign - +1 for call, -1 for put.
      digitalPayoffType - Type of digital payoff.
      cashPayoff - Cash payoff for cash-or-nothing products.
  • Method Details

    • 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.
    • getUnderlyingName

      public String getUnderlyingName()
      Returns the underlying name.
      Returns:
      The underlying name.
    • getMaturity

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

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

      public CallOrPut getCallOrPut()
      Returns call/put type.
      Returns:
      The option type.
    • getDigitalPayoffType

      public DigitalPayoffType getDigitalPayoffType()
      Returns the digital payoff type.
      Returns:
      The digital payoff type.
    • getCashPayoff

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

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