Class DigitalBasketOption
- All Implemented Interfaces:
FiniteDifferenceEquityProduct, FiniteDifferenceProduct<FiniteDifferenceEquityModel>, Product
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 >= 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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumType of two-asset digital payoff. -
Constructor Summary
ConstructorsConstructorDescriptionDigitalBasketOption(double maturity, DigitalBasketOption.BasketDigitalType basketDigitalType, double[] quantities, double strike, double cashPayoff, CallOrPut callOrPut) Creates a digital basket option.DigitalBasketOption(String[] underlyingNames, double maturity, DigitalBasketOption.BasketDigitalType basketDigitalType, double[] quantities, double strike, double cashPayoff, CallOrPut callOrPut) Creates a digital basket option. -
Method Summary
Modifier and TypeMethodDescriptionstatic DigitalBasketOptionbestOf(String[] underlyingNames, double maturity, double strike, double cashPayoff, CallOrPut callOrPut) Creates a best-of digital option.Returns the payoff type.Returns the option type.doubleReturns the cash payoff.Returns the exercise specification.doubleReturns the maturity.double[]Returns the signed quantities.doubleReturns the strike.String[]Returns the names of the underlyings.double[]getValue(double evaluationTime, FiniteDifferenceEquityModel model) Returns the value.double[][]Returns the value.static DigitalBasketOptionlinearCombination(String[] underlyingNames, double maturity, double[] quantities, double strike, double cashPayoff, CallOrPut callOrPut) Creates a linear-combination digital option.toString()static DigitalBasketOptionworstOf(String[] underlyingNames, double maturity, double strike, double cashPayoff, CallOrPut callOrPut) Creates a worst-of digital option.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface FiniteDifferenceEquityProduct
getModelClassMethods inherited from interface FiniteDifferenceProduct
getValue
-
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 benull. If provided, the array length must be 2.maturity- Maturity.basketDigitalType- Payoff type.quantities- Signed quantities forDigitalBasketOption.BasketDigitalType.LINEAR_COMBINATION. Ignored otherwise and may benull.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 forDigitalBasketOption.BasketDigitalType.LINEAR_COMBINATION. Ignored otherwise and may benull.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
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.
-
getUnderlyingNames
Returns the names of the underlyings.- Returns:
- The names of the underlyings, or
nullif unspecified.
-
getMaturity
public double getMaturity()Returns the maturity.- Returns:
- The maturity.
-
getBasketDigitalType
Returns the payoff type.- Returns:
- The payoff type.
-
getQuantities
public double[] getQuantities()Returns the signed quantities.- Returns:
- The signed quantities, or
nullif 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
-
getExercise
Returns the exercise specification.- Returns:
- The exercise specification.
-
toString
-