Class BarrierOption
java.lang.Object
net.finmath.finitedifference.assetderivativevaluation.products.BarrierOption
- All Implemented Interfaces:
FiniteDifferenceEquityEventProduct, FiniteDifferenceEquityProduct, FiniteDifferenceInternalStateConstraint, FiniteDifferenceOneDimensionalKnockInProduct, FiniteDifferenceProduct<FiniteDifferenceEquityModel>, Product
public class BarrierOption
extends Object
implements FiniteDifferenceEquityEventProduct, FiniteDifferenceInternalStateConstraint, FiniteDifferenceOneDimensionalKnockInProduct
Finite-difference valuation of a standard single-barrier option on one asset.
The barrier acts on the first state variable of the model, which is assumed to represent the underlying level.
Current implementation policy:
- continuously monitored knock-out options are priced directly by the finite-difference solver,
- discretely monitored knock-out options are implemented for 1D models and for 2D Heston/SABR models via internal constraints active only on monitoring dates,
- continuously monitored 1D knock-in options are priced directly through a coupled two-state PDE on an auxiliary spatial grid where the barrier is placed on an interior node,
- discretely monitored 1D knock-in options are implemented via event-time replacement by the activated vanilla continuation surface,
- continuously monitored 2D Heston / SABR knock-in options are priced directly through an activated-vanilla + pre-hit PDE / interface formulation,
- discretely monitored 2D Heston / SABR knock-in options are implemented on the full 2D grid via event-time replacement by the activated vanilla continuation surface,
- for discrete monitored knock-ins with Bermudan/American exercise, only the activated state carries exercise rights; the pre-hit state is always solved as a European continuation problem,
- other 2D knock-in options fall back to in-out parity.
- Author:
- Alessandro Gnoatto
-
Constructor Summary
ConstructorsConstructorDescriptionBarrierOption(double maturity, double strike, double barrierValue, double rebate, double callOrPutSign, BarrierType barrierType) Performs the operation.BarrierOption(double maturity, double strike, double barrierValue, double rebate, double callOrPutSign, BarrierType barrierType, Exercise exercise) Performs the operation.BarrierOption(double maturity, double strike, double barrierValue, double callOrPutSign, BarrierType barrierType) Performs the operation.BarrierOption(double maturity, double strike, double barrierValue, double callOrPutSign, BarrierType barrierType, Exercise exercise) Performs the operation.BarrierOption(double maturity, double strike, double barrierValue, double rebate, CallOrPut callOrPutSign, BarrierType barrierType) Performs the operation.BarrierOption(double maturity, double strike, double barrierValue, double rebate, CallOrPut callOrPutSign, BarrierType barrierType, Exercise exercise) Performs the operation.BarrierOption(double maturity, double strike, double barrierValue, double rebate, CallOrPut callOrPutSign, BarrierType barrierType, Exercise exercise, MonitoringType monitoringType, double[] monitoringTimes) Performs the operation.BarrierOption(String underlyingName, double maturity, double strike, double barrierValue, double rebate, double callOrPutSign, BarrierType barrierType) Performs the operation.BarrierOption(String underlyingName, double maturity, double strike, double barrierValue, double rebate, double callOrPutSign, BarrierType barrierType, Exercise exercise) Performs the operation.BarrierOption(String underlyingName, double maturity, double strike, double barrierValue, double rebate, double callOrPutSign, BarrierType barrierType, Exercise exercise, MonitoringType monitoringType, double[] monitoringTimes) Performs the operation.BarrierOption(String underlyingName, double maturity, double strike, double barrierValue, double rebate, CallOrPut callOrPutSign, BarrierType barrierType) Performs the operation.BarrierOption(String underlyingName, double maturity, double strike, double barrierValue, double rebate, CallOrPut callOrPutSign, BarrierType barrierType, Exercise exercise) Performs the operation.BarrierOption(String underlyingName, double maturity, double strike, double barrierValue, double rebate, CallOrPut callOrPutSign, BarrierType barrierType, Exercise exercise, MonitoringType monitoringType, double[] monitoringTimes) Performs the operation.BarrierOption(String underlyingName, double maturity, double strike, double barrierValue, CallOrPut callOrPutSign, BarrierType barrierType) Performs the operation.BarrierOption(String underlyingName, double maturity, double strike, double barrierValue, CallOrPut callOrPutSign, BarrierType barrierType, Exercise exercise) Performs the operation. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]applyEventCondition(double time, double[] valuesAfterEvent, FiniteDifferenceEquityModel model) Performs the operation.Returns the value.doubleReturns the value.Returns the value.doublegetConstrainedValue(double time, double... stateVariables) Returns the value to impose at a constrained node.double[]Returns the value.Returns the value.doubleReturns the value prescribed in the inactive regime at maturity.doubleReturns the value.double[]Returns the value.Returns the value.doubleReturns the value.doubleReturns the value.Returns the value.double[]getValue(double evaluationTime, FiniteDifferenceEquityModel model) Returns the value.double[][]Returns the value.booleanisConstraintActive(double time, double... stateVariables) Returns true if the internal constraint is active at the given node and time.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
-
BarrierOption
public BarrierOption(String underlyingName, double maturity, double strike, double barrierValue, double rebate, double callOrPutSign, BarrierType barrierType) Performs the operation.- Parameters:
underlyingName- The value.maturity- The value.strike- The value.barrierValue- The value.rebate- The value.callOrPutSign- The value.barrierType- The value.
-
BarrierOption
public BarrierOption(String underlyingName, double maturity, double strike, double barrierValue, double rebate, CallOrPut callOrPutSign, BarrierType barrierType) Performs the operation.- Parameters:
underlyingName- The value.maturity- The value.strike- The value.barrierValue- The value.rebate- The value.callOrPutSign- The value.barrierType- The value.
-
BarrierOption
public BarrierOption(String underlyingName, double maturity, double strike, double barrierValue, double rebate, double callOrPutSign, BarrierType barrierType, Exercise exercise) Performs the operation.- Parameters:
underlyingName- The value.maturity- The value.strike- The value.barrierValue- The value.rebate- The value.callOrPutSign- The value.barrierType- The value.exercise- The value.
-
BarrierOption
public BarrierOption(String underlyingName, double maturity, double strike, double barrierValue, double rebate, CallOrPut callOrPutSign, BarrierType barrierType, Exercise exercise) Performs the operation.- Parameters:
underlyingName- The value.maturity- The value.strike- The value.barrierValue- The value.rebate- The value.callOrPutSign- The value.barrierType- The value.exercise- The value.
-
BarrierOption
public BarrierOption(String underlyingName, double maturity, double strike, double barrierValue, double rebate, double callOrPutSign, BarrierType barrierType, Exercise exercise, MonitoringType monitoringType, double[] monitoringTimes) Performs the operation.- Parameters:
underlyingName- The value.maturity- The value.strike- The value.barrierValue- The value.rebate- The value.callOrPutSign- The value.barrierType- The value.exercise- The value.monitoringType- The value.monitoringTimes- The value.
-
BarrierOption
public BarrierOption(String underlyingName, double maturity, double strike, double barrierValue, double rebate, CallOrPut callOrPutSign, BarrierType barrierType, Exercise exercise, MonitoringType monitoringType, double[] monitoringTimes) Performs the operation.- Parameters:
underlyingName- The value.maturity- The value.strike- The value.barrierValue- The value.rebate- The value.callOrPutSign- The value.barrierType- The value.exercise- The value.monitoringType- The value.monitoringTimes- The value.
-
BarrierOption
public BarrierOption(double maturity, double strike, double barrierValue, double rebate, double callOrPutSign, BarrierType barrierType) Performs the operation.- Parameters:
maturity- The value.strike- The value.barrierValue- The value.rebate- The value.callOrPutSign- The value.barrierType- The value.
-
BarrierOption
public BarrierOption(double maturity, double strike, double barrierValue, double rebate, CallOrPut callOrPutSign, BarrierType barrierType) Performs the operation.- Parameters:
maturity- The value.strike- The value.barrierValue- The value.rebate- The value.callOrPutSign- The value.barrierType- The value.
-
BarrierOption
public BarrierOption(double maturity, double strike, double barrierValue, double rebate, double callOrPutSign, BarrierType barrierType, Exercise exercise) Performs the operation.- Parameters:
maturity- The value.strike- The value.barrierValue- The value.rebate- The value.callOrPutSign- The value.barrierType- The value.exercise- The value.
-
BarrierOption
public BarrierOption(double maturity, double strike, double barrierValue, double rebate, CallOrPut callOrPutSign, BarrierType barrierType, Exercise exercise) Performs the operation.- Parameters:
maturity- The value.strike- The value.barrierValue- The value.rebate- The value.callOrPutSign- The value.barrierType- The value.exercise- The value.
-
BarrierOption
public BarrierOption(double maturity, double strike, double barrierValue, double rebate, CallOrPut callOrPutSign, BarrierType barrierType, Exercise exercise, MonitoringType monitoringType, double[] monitoringTimes) Performs the operation.- Parameters:
maturity- The value.strike- The value.barrierValue- The value.rebate- The value.callOrPutSign- The value.barrierType- The value.exercise- The value.monitoringType- The value.monitoringTimes- The value.
-
BarrierOption
public BarrierOption(String underlyingName, double maturity, double strike, double barrierValue, CallOrPut callOrPutSign, BarrierType barrierType) Performs the operation.- Parameters:
underlyingName- The value.maturity- The value.strike- The value.barrierValue- The value.callOrPutSign- The value.barrierType- The value.
-
BarrierOption
public BarrierOption(String underlyingName, double maturity, double strike, double barrierValue, CallOrPut callOrPutSign, BarrierType barrierType, Exercise exercise) Performs the operation.- Parameters:
underlyingName- The value.maturity- The value.strike- The value.barrierValue- The value.callOrPutSign- The value.barrierType- The value.exercise- The value.
-
BarrierOption
public BarrierOption(double maturity, double strike, double barrierValue, double callOrPutSign, BarrierType barrierType) Performs the operation.- Parameters:
maturity- The value.strike- The value.barrierValue- The value.callOrPutSign- The value.barrierType- The value.
-
BarrierOption
public BarrierOption(double maturity, double strike, double barrierValue, double callOrPutSign, BarrierType barrierType, Exercise exercise) Performs the operation.- Parameters:
maturity- The value.strike- The value.barrierValue- The value.callOrPutSign- The value.barrierType- The value.exercise- The value.
-
-
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.
-
getEventTimes
public double[] getEventTimes()Description copied from interface:FiniteDifferenceEquityEventProductReturns the value.- Specified by:
getEventTimesin interfaceFiniteDifferenceEquityEventProduct- Returns:
- The value.
-
applyEventCondition
public double[] applyEventCondition(double time, double[] valuesAfterEvent, FiniteDifferenceEquityModel model) Description copied from interface:FiniteDifferenceEquityEventProductPerforms the operation.- Specified by:
applyEventConditionin interfaceFiniteDifferenceEquityEventProduct- Parameters:
time- The value.valuesAfterEvent- The value.model- The value.- Returns:
- The value.
-
isConstraintActive
public boolean isConstraintActive(double time, double... stateVariables) Description copied from interface:FiniteDifferenceInternalStateConstraintReturns true if the internal constraint is active at the given node and time.- Specified by:
isConstraintActivein interfaceFiniteDifferenceInternalStateConstraint- Parameters:
time- Running time.stateVariables- State variables at the grid node.- Returns:
- True if the node is constrained.
-
getConstrainedValue
public double getConstrainedValue(double time, double... stateVariables) Description copied from interface:FiniteDifferenceInternalStateConstraintReturns the value to impose at a constrained node.This method is called only if
FiniteDifferenceInternalStateConstraint.isConstraintActive(double, double...)returns true.- Specified by:
getConstrainedValuein interfaceFiniteDifferenceInternalStateConstraint- Parameters:
time- Running time.stateVariables- State variables at the grid node.- Returns:
- The constrained value.
-
getUnderlyingName
-
getMaturity
public double getMaturity()Returns the value.- Specified by:
getMaturityin interfaceFiniteDifferenceOneDimensionalKnockInProduct- Returns:
- The value.
-
getStrike
public double getStrike()Returns the value.- Returns:
- The value.
-
getBarrierValue
public double getBarrierValue()Returns the value.- Specified by:
getBarrierValuein interfaceFiniteDifferenceOneDimensionalKnockInProduct- Returns:
- The value.
-
getRebate
public double getRebate()Returns the value.- Returns:
- The value.
-
getCallOrPut
-
getBarrierType
Returns the value.- Specified by:
getBarrierTypein interfaceFiniteDifferenceOneDimensionalKnockInProduct- Returns:
- The value.
-
getExercise
-
getMonitoringType
-
getMonitoringTimes
public double[] getMonitoringTimes()Returns the value.- Returns:
- The value.
-
getInactiveValueAtMaturity
public double getInactiveValueAtMaturity()Description copied from interface:FiniteDifferenceOneDimensionalKnockInProductReturns the value prescribed in the inactive regime at maturity.This is the terminal value in the no-hit region. For vanilla barrier options this is typically the rebate. For digital barrier options it is typically
0.0.- Specified by:
getInactiveValueAtMaturityin interfaceFiniteDifferenceOneDimensionalKnockInProduct- Returns:
- The inactive value at maturity.
-