Class RecombiningTrinomialTreeData
- java.lang.Object
-
- com.opengamma.strata.pricer.fxopt.RecombiningTrinomialTreeData
-
- All Implemented Interfaces:
Serializable,org.joda.beans.Bean,org.joda.beans.ImmutableBean
public final class RecombiningTrinomialTreeData extends Object implements org.joda.beans.ImmutableBean, Serializable
Recombining trinomial tree data.This includes state values and transition probabilities for all of the nodes, as well as discount factors and time (time from valuation date) for individual time steps.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRecombiningTrinomialTreeData.MetaThe meta-bean forRecombiningTrinomialTreeData.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)DoubleArraygetDiscountFactor()Gets the discount factor.doublegetDiscountFactorAtLayer(int i)Obtains discount factor between thei-th layer to the(i+1)-th layer.intgetNumberOfSteps()Obtains the number of time steps.DoubleMatrixgetProbabilityAtLayer(int i)Obtains the transition probability values at thei-th time layer.doublegetSpot()Obtains the spot.DoubleMatrixgetStateValue()Gets the state value.DoubleArraygetStateValueAtLayer(int i)Obtains the state values at thei-th time layer.DoubleArraygetTime()Gets the time.doublegetTime(int i)Obtains the time for thei-th layer.ImmutableList<DoubleMatrix>getTransitionProbability()Gets the transition probability.inthashCode()static RecombiningTrinomialTreeData.Metameta()The meta-bean forRecombiningTrinomialTreeData.RecombiningTrinomialTreeData.MetametaBean()static RecombiningTrinomialTreeDataof(DoubleMatrix stateValue, List<DoubleMatrix> transitionProbability, DoubleArray discountFactor, DoubleArray time)Creates an instance.StringtoString()
-
-
-
Method Detail
-
of
public static RecombiningTrinomialTreeData of(DoubleMatrix stateValue, List<DoubleMatrix> transitionProbability, DoubleArray discountFactor, DoubleArray time)
Creates an instance.- Parameters:
stateValue- the state valuetransitionProbability- the transition probabilitydiscountFactor- the discount factortime- the time- Returns:
- the instance
-
getNumberOfSteps
public int getNumberOfSteps()
Obtains the number of time steps.- Returns:
- the number of time steps
-
getStateValueAtLayer
public DoubleArray getStateValueAtLayer(int i)
Obtains the state values at thei-th time layer.- Parameters:
i- the layer- Returns:
- the state values
-
getProbabilityAtLayer
public DoubleMatrix getProbabilityAtLayer(int i)
Obtains the transition probability values at thei-th time layer.- Parameters:
i- the layer- Returns:
- the transition probability
-
getDiscountFactorAtLayer
public double getDiscountFactorAtLayer(int i)
Obtains discount factor between thei-th layer to the(i+1)-th layer.- Parameters:
i- the layer- Returns:
- the discount factor
-
getSpot
public double getSpot()
Obtains the spot.- Returns:
- the spot
-
getTime
public double getTime(int i)
Obtains the time for thei-th layer.The time is the year fraction between the
0-th layer and thei-th layer.- Parameters:
i- the layer- Returns:
- the time
-
meta
public static RecombiningTrinomialTreeData.Meta meta()
The meta-bean forRecombiningTrinomialTreeData.- Returns:
- the meta-bean, not null
-
metaBean
public RecombiningTrinomialTreeData.Meta metaBean()
- Specified by:
metaBeanin interfaceorg.joda.beans.Bean
-
getStateValue
public DoubleMatrix getStateValue()
Gets the state value.The
(i,j)component of this matrix represents the underlying asset price at thej-th lowest node at thei-th time layer.- Returns:
- the value of the property
-
getTransitionProbability
public ImmutableList<DoubleMatrix> getTransitionProbability()
Gets the transition probability.The
i-th element of the list represents the transition probability values for the nodes at thei-th time layer. The matrix is(2*i+1)times3, and itsj-th row involves [0] down probability, [1] middle probability and [2] up probability for thej-th lowest node.- Returns:
- the value of the property
-
getDiscountFactor
public DoubleArray getDiscountFactor()
Gets the discount factor.The
i-th element is the discount factor between thei-th layer and the(i+1)-th layer.- Returns:
- the value of the property
-
getTime
public DoubleArray getTime()
Gets the time.The
i-th element is the year fraction between the0-th time layer and thei-th layer.- Returns:
- the value of the property
-
-