Class BestOfOption
java.lang.Object
net.finmath.finitedifference.assetderivativevaluation.products.BestOfOption
- All Implemented Interfaces:
FiniteDifferenceEquityProduct, FiniteDifferenceProduct<FiniteDifferenceEquityModel>, Product
Finite-difference valuation of a European option on the best of two assets.
Let S1 and S2 denote the two underlying assets and let
T be the maturity. The best-of underlying is
B(T) = max(S_1(T), S_2(T)).
The payoff is
\left( \omega \left( B(T) - K \right) \right)^{+},
where \omega = +1 for a call and \omega = -1 for a put.
Hence
\left( max(S_1(T), S_2(T)) - K \right)^{+}
for a call, and
\left( K - max(S_1(T), S_2(T)) \right)^{+}
for a put.
This product is genuinely non-linear in the two assets and cannot be reduced to the linear-combination basket class. The current implementation requires a two-dimensional model state and supports European exercise only.
- Author:
- Alessandro Gnoatto
-
Constructor Summary
ConstructorsConstructorDescriptionBestOfOption(double maturity, double strike, double callOrPutSign) Creates a European best-of option with unnamed underlyings.BestOfOption(double maturity, double strike, CallOrPut callOrPut) Creates a European best-of option with unnamed underlyings.BestOfOption(String firstUnderlyingName, String secondUnderlyingName, double maturity, double strike, double callOrPutSign) Creates a European best-of option for two named underlyings.BestOfOption(String firstUnderlyingName, String secondUnderlyingName, double maturity, double strike, CallOrPut callOrPut) Creates a European best-of option for two named underlyings. -
Method Summary
Modifier and TypeMethodDescriptionReturns the option type.Returns the exercise specification.Returns the name of the first underlying.doubleReturns the maturity.Returns the name of the second underlying.doubleReturns the strike.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
-
BestOfOption
public BestOfOption(String firstUnderlyingName, String secondUnderlyingName, double maturity, double strike, CallOrPut callOrPut) Creates a European best-of option for two named underlyings.- Parameters:
firstUnderlyingName- Name of the first underlying.secondUnderlyingName- Name of the second underlying.maturity- MaturityT.strike- StrikeK.callOrPut- Option type.
-
BestOfOption
public BestOfOption(String firstUnderlyingName, String secondUnderlyingName, double maturity, double strike, double callOrPutSign) Creates a European best-of option for two named underlyings.- Parameters:
firstUnderlyingName- Name of the first underlying.secondUnderlyingName- Name of the second underlying.maturity- MaturityT.strike- StrikeK.callOrPutSign- Payoff sign, where1.0corresponds to a call and-1.0corresponds to a put.
-
BestOfOption
Creates a European best-of option with unnamed underlyings.- Parameters:
maturity- MaturityT.strike- StrikeK.callOrPut- Option type.
-
BestOfOption
public BestOfOption(double maturity, double strike, double callOrPutSign) Creates a European best-of option with unnamed underlyings.- Parameters:
maturity- MaturityT.strike- 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.
-
getFirstUnderlyingName
Returns the name of the first underlying.- Returns:
- The name of the first underlying, or
nullif unspecified.
-
getSecondUnderlyingName
Returns the name of the second underlying.- Returns:
- The name of the second underlying, or
nullif unspecified.
-
getMaturity
public double getMaturity()Returns the maturity.- Returns:
- The maturity.
-
getStrike
public double getStrike()Returns the strike.- Returns:
- The strike.
-
getCallOrPut
-
getExercise
Returns the exercise specification.- Returns:
- The exercise specification.
-