public final class ConstantContinuousSingleBarrierKnockoutFunction extends Object implements org.joda.beans.ImmutableBean, Serializable
The barrier is continuous and the level is constant.
| Modifier and Type | Class and Description |
|---|---|
static class |
ConstantContinuousSingleBarrierKnockoutFunction.Meta
The meta-bean for
ConstantContinuousSingleBarrierKnockoutFunction. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
double |
getBarrierLevel()
Gets the constant barrier level.
|
double |
getBarrierLevel(int step)
Obtains the barrier level for the time layer specified by
step. |
BarrierType |
getBarrierType()
Gets the barrier type.
|
DoubleArray |
getNextOptionValues(double discountFactor,
DoubleMatrix transitionProbability,
DoubleArray stateValue,
DoubleArray values,
int i)
Computes the option values in the intermediate nodes.
|
int |
getNumberOfSteps()
Gets the number of time steps.
|
DoubleArray |
getPayoffAtExpiryTrinomial(DoubleArray stateValue)
Computes payoff at expiry for trinomial tree.
|
DoubleArray |
getRebate()
Gets the rebate.
|
double |
getRebate(int step)
Obtains the rebate for the time layer specified by
step. |
double |
getSign()
Gets the sign.
|
double |
getStrike()
Gets the strike value.
|
double |
getTimeToExpiry()
Gets the time to expiry.
|
int |
hashCode() |
static ConstantContinuousSingleBarrierKnockoutFunction.Meta |
meta()
The meta-bean for
ConstantContinuousSingleBarrierKnockoutFunction. |
ConstantContinuousSingleBarrierKnockoutFunction.Meta |
metaBean() |
static ConstantContinuousSingleBarrierKnockoutFunction |
of(double strike,
double timeToExpiry,
PutCall putCall,
int numberOfSteps,
BarrierType barrierType,
double barrierLevel,
DoubleArray rebate)
Obtains an instance.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetNextOptionValues, getPayoffAtExpiryTrinomialpublic static ConstantContinuousSingleBarrierKnockoutFunction of(double strike, double timeToExpiry, PutCall putCall, int numberOfSteps, BarrierType barrierType, double barrierLevel, DoubleArray rebate)
strike - the striketimeToExpiry - the time to expiryputCall - put or callnumberOfSteps - number of stepsbarrierType - the barrier typebarrierLevel - the barrier levelrebate - the rebatepublic double getBarrierLevel(int step)
step.step - the steppublic double getRebate(int step)
step.step - the steppublic static ConstantContinuousSingleBarrierKnockoutFunction.Meta meta()
ConstantContinuousSingleBarrierKnockoutFunction.public ConstantContinuousSingleBarrierKnockoutFunction.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic double getStrike()
public double getTimeToExpiry()
getTimeToExpiry in interface OptionFunctionpublic double getSign()
The sign is +1 for call and -1 for put.
public int getNumberOfSteps()
getNumberOfSteps in interface OptionFunctionpublic BarrierType getBarrierType()
public double getBarrierLevel()
public DoubleArray getRebate()
The rebate amounts for individual time layer.
The size must be equal to numberOfSteps + 1
public DoubleArray getPayoffAtExpiryTrinomial(DoubleArray stateValue)
OptionFunctionThe payoff values for individual nodes at expiry are computed from state values at the final layer. For example, the state values represent underlying prices of an option at respective nodes.
getPayoffAtExpiryTrinomial in interface OptionFunctionstateValue - the state valuespublic DoubleArray getNextOptionValues(double discountFactor, DoubleMatrix transitionProbability, DoubleArray stateValue, DoubleArray values, int i)
OptionFunction
Given a set of option values in the (i+1)-th layer, option values in the i-th layer are derived.
The down, middle and up probabilities of the j-th lowest node are stored in the {i,0}, {i,1}, {i,2} components of
transitionProbability, respectively.
For an option with path-dependence, this method should be overridden.
getNextOptionValues in interface OptionFunctiondiscountFactor - the discount factor between the two layerstransitionProbability - the transition probabilitystateValue - the state valuevalues - the option valuei - the step number for which the next option values are computedCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.