Class DigitalOption
java.lang.Object
net.finmath.finitedifference.assetderivativevaluation.products.DigitalOption
- All Implemented Interfaces:
FiniteDifferenceEquityProduct, FiniteDifferenceProduct<FiniteDifferenceEquityModel>, Product
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 Summary
ConstructorsConstructorDescriptionDigitalOption(double maturity, double strike, CallOrPut callOrPutSign, DigitalPayoffType digitalPayoffType, double cashPayoff) Creates a European digital option.DigitalOption(double maturity, double strike, CallOrPut callOrPutSign, DigitalPayoffType digitalPayoffType, double cashPayoff, Exercise exercise) Creates a digital option with explicit exercise specification.DigitalOption(String underlyingName, double maturity, double strike, double callOrPutSign, DigitalPayoffType digitalPayoffType, double cashPayoff) Creates a European digital option.DigitalOption(String underlyingName, double maturity, double strike, double callOrPutSign, DigitalPayoffType digitalPayoffType, double cashPayoff, Exercise exercise) Creates a digital option with explicit exercise specification.DigitalOption(String underlyingName, double maturity, double strike, CallOrPut callOrPutSign, DigitalPayoffType digitalPayoffType, double cashPayoff) Creates a European digital option.DigitalOption(String underlyingName, double maturity, double strike, CallOrPut callOrPutSign, DigitalPayoffType digitalPayoffType, double cashPayoff, Exercise exercise) Creates a digital option with explicit exercise specification. -
Method Summary
Modifier and TypeMethodDescriptionReturns call/put type.doubleReturns the cash payoff amount.Returns the digital payoff type.Returns the exercise specification.doubleReturns the maturity.doubleReturns the strike.Returns the underlying name.double[]getValue(double evaluationTime, FiniteDifferenceEquityModel model) Returns the value.double[][]Returns the value.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface FiniteDifferenceEquityProduct
getModelClassMethods inherited from interface FiniteDifferenceProduct
getValue
-
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
Description copied from interface:FiniteDifferenceProductReturns the value.- Specified by:
getValuein interfaceFiniteDifferenceProduct<FiniteDifferenceEquityModel>- Parameters:
evaluationTime- The value.model- The value.- Returns:
- The value.
-
getValues
Description copied from interface:FiniteDifferenceProductReturns the value.- Specified by:
getValuesin interfaceFiniteDifferenceProduct<FiniteDifferenceEquityModel>- Parameters:
model- The value.- Returns:
- The value.
-
getUnderlyingName
-
getMaturity
public double getMaturity()Returns the maturity.- Returns:
- The maturity.
-
getStrike
public double getStrike()Returns the strike.- Returns:
- The strike.
-
getCallOrPut
-
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
Returns the exercise specification.- Returns:
- The exercise specification.
-