Class BasketOption
java.lang.Object
net.finmath.finitedifference.assetderivativevaluation.products.BasketOption
- All Implemented Interfaces:
FiniteDifferenceEquityProduct, FiniteDifferenceProduct<FiniteDifferenceEquityModel>, Product
Finite-difference valuation of a European linear basket option on two assets.
Let S1 and S2 denote the two underlying assets, let
q1 and q2 be the signed asset quantities, let K be
the strike, and let \omega \in \{+1,-1\} denote the call/put sign.
The payoff is
\left( \omega \left( q_1 S_1(T) + q_2 S_2(T) - K \right) \right)^{+}.
This single class covers a number of important special cases:
- arithmetic basket options, when both quantities are positive,
- spread options, for example with quantities
(1,-1), - exchange options, for example with quantities
(1,-1)and strike0.
The class is written in a dimension-agnostic style through the quantity vector, but the current finite-difference implementation supports only the two-asset case, that is, exactly two quantities and a two-dimensional model state.
The current implementation supports only European exercise.
- Author:
- Alessandro Gnoatto
-
Constructor Summary
ConstructorsConstructorDescriptionBasketOption(double maturity, double[] quantities, double strike, double callOrPutSign) Creates a European linear basket option.BasketOption(double maturity, double[] quantities, double strike, CallOrPut callOrPut) Creates a European linear basket option.BasketOption(String[] underlyingNames, double maturity, double[] quantities, double strike, double callOrPutSign) Creates a European linear basket option.BasketOption(String[] underlyingNames, double maturity, double[] quantities, double strike, CallOrPut callOrPut) Creates a European linear basket option. -
Method Summary
Modifier and TypeMethodDescriptionReturns the option type.Returns the exercise specification.doubleReturns the maturity.double[]Returns the signed asset quantities.doubleReturns the strike.String[]Returns the underlying names.double[]getValue(double evaluationTime, FiniteDifferenceEquityModel model) Returns the value.double[][]Returns the value.toString()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
-
BasketOption
public BasketOption(String[] underlyingNames, double maturity, double[] quantities, double strike, CallOrPut callOrPut) Creates a European linear basket option.- Parameters:
underlyingNames- Names of the underlyings. May benull. If provided, the array length must match the basket dimension.maturity- MaturityT.quantities- Signed asset quantities.strike- Real strikeK.callOrPut- Option type.
-
BasketOption
Creates a European linear basket option.- Parameters:
maturity- MaturityT.quantities- Signed asset quantities.strike- Real strikeK.callOrPut- Option type.
-
BasketOption
public BasketOption(String[] underlyingNames, double maturity, double[] quantities, double strike, double callOrPutSign) Creates a European linear basket option.- Parameters:
underlyingNames- Names of the underlyings. May benull. If provided, the array length must match the basket dimension.maturity- MaturityT.quantities- Signed asset quantities.strike- Real strikeK.callOrPutSign- Payoff sign, where1.0corresponds to a call and-1.0corresponds to a put.
-
BasketOption
public BasketOption(double maturity, double[] quantities, double strike, double callOrPutSign) Creates a European linear basket option.- Parameters:
maturity- MaturityT.quantities- Signed asset quantities.strike- Real strikeK.callOrPutSign- Payoff sign, where1.0corresponds to a call and-1.0corresponds to a put.
-
-
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.
-
getUnderlyingNames
Returns the underlying names.- Returns:
- The underlying names, or
nullif unspecified.
-
getMaturity
public double getMaturity()Returns the maturity.- Returns:
- The maturity.
-
getQuantities
public double[] getQuantities()Returns the signed asset quantities.- Returns:
- The signed asset quantities.
-
getStrike
public double getStrike()Returns the strike.- Returns:
- The strike.
-
getCallOrPut
-
getExercise
Returns the exercise specification.- Returns:
- The exercise specification.
-
toString
-