public interface OptionFunction
| Modifier and Type | Method and Description |
|---|---|
default DoubleArray |
getNextOptionValues(double discountFactor,
double upProbability,
double middleProbability,
double downProbability,
DoubleArray value,
double spot,
double downFactor,
double middleFactor,
int i)
Computes the option values in the intermediate nodes.
|
default DoubleArray |
getNextOptionValues(double discountFactor,
DoubleMatrix transitionProbability,
DoubleArray stateValue,
DoubleArray value,
int i)
Computes the option values in the intermediate nodes.
|
int |
getNumberOfSteps()
Obtains number of time steps.
|
DoubleArray |
getPayoffAtExpiryTrinomial(DoubleArray stateValue)
Computes payoff at expiry for trinomial tree.
|
default DoubleArray |
getPayoffAtExpiryTrinomial(double spot,
double downFactor,
double middleFactor)
Computes payoff at expiry for trinomial tree.
|
double |
getTimeToExpiry()
Obtains time to expiry.
|
double getTimeToExpiry()
int getNumberOfSteps()
default DoubleArray getPayoffAtExpiryTrinomial(double spot, double downFactor, double middleFactor)
The payoff values for individual nodes at expiry are computed.
If trinomial tree has n steps, the returned DoubleArray has the size 2 * n + 1.
spot - the spotdownFactor - the down factormiddleFactor - the middle factorDoubleArray getPayoffAtExpiryTrinomial(DoubleArray stateValue)
The 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.
stateValue - the state valuesdefault DoubleArray getNextOptionValues(double discountFactor, double upProbability, double middleProbability, double downProbability, DoubleArray value, double spot, double downFactor, double middleFactor, int i)
Given a set of option values in the (i+1)-th layer, option values in the i-th layer are derived.
For an option with path-dependence, getNextOptionValues(double, DoubleMatrix, DoubleArray, DoubleArray, int)
should be overridden rather than this method.
The size of values must be (2*i+3). However, this is not checked because of its repeated usage.
discountFactor - the discount factor between the two layersupProbability - the up probabilitymiddleProbability - the middle probabilitydownProbability - the down probabilityvalue - the option values in the (i+1)-th layerspot - the spotdownFactor - the down factormiddleFactor - the middle factori - the step number for which the next option values are computeddefault DoubleArray getNextOptionValues(double discountFactor, DoubleMatrix transitionProbability, DoubleArray stateValue, DoubleArray value, int i)
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.
discountFactor - the discount factor between the two layerstransitionProbability - the transition probabilitystateValue - the state valuevalue - 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.