Class RecombiningTrinomialTreeData

  • All Implemented Interfaces:
    java.io.Serializable, Bean, ImmutableBean

    public final class RecombiningTrinomialTreeData
    extends java.lang.Object
    implements ImmutableBean, java.io.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
    • Method Detail

      • of

        public static RecombiningTrinomialTreeData of​(DoubleMatrix stateValue,
                                                      java.util.List<DoubleMatrix> transitionProbability,
                                                      DoubleArray discountFactor,
                                                      DoubleArray time)
        Creates an instance.
        Parameters:
        stateValue - the state value
        transitionProbability - the transition probability
        discountFactor - the discount factor
        time - 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 the i-th time layer.
        Parameters:
        i - the layer
        Returns:
        the state values
      • getProbabilityAtLayer

        public DoubleMatrix getProbabilityAtLayer​(int i)
        Obtains the transition probability values at the i-th time layer.
        Parameters:
        i - the layer
        Returns:
        the transition probability
      • getDiscountFactorAtLayer

        public double getDiscountFactorAtLayer​(int i)
        Obtains discount factor between the i-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 the i-th layer.

        The time is the year fraction between the 0-th layer and the i-th layer.

        Parameters:
        i - the layer
        Returns:
        the time
      • getStateValue

        public DoubleMatrix getStateValue()
        Gets the state value.

        The (i,j) component of this matrix represents the underlying asset price at the j-th lowest node at the i-th time layer.

        Returns:
        the value of the property
      • getTransitionProbability

        public com.google.common.collect.ImmutableList<DoubleMatrix> getTransitionProbability()
        Gets the transition probability.

        The i-th element of the list represents the transition probability values for the nodes at the i-th time layer. The matrix is (2*i+1) times 3, and its j-th row involves [0] down probability, [1] middle probability and [2] up probability for the j-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 the i-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 the 0-th time layer and the i-th layer.

        Returns:
        the value of the property
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object