Interface RandomVariableArray

  • All Superinterfaces:
    RandomVariable, Serializable
    All Known Implementing Classes:
    RandomVariableArrayImplementation

    public interface RandomVariableArray
    extends RandomVariable
    An array of RandomVariable objects, implementing the RandomVariable interface. The array features a method getLevel() which indicates if the object is an array where elements are themselves arrays. See getLevel(). All methods inherited from RandomVariable act element wise on the vector elements getElement(int) and return corresponding RandomVariableArray having the same level. In addition methods are provided that reduce the level by one, like the scalar product, see sumProduct(RandomVariableArray).
    Author:
    Christian Fries
    • Method Detail

      • getNumberOfElements

        int getNumberOfElements()
      • getLevel

        default int getLevel()
        Returns the level of the array The level of the array is given by 1 if the elements are of type RandomVariable but not of type RandomVariableArray. If the elements are of type RandomVariableArray the level of this array is 1 plus the level of its elements. Note: the elements are required to be of the the same level.
        Returns:
        The level of the array.
      • toDoubleArray

        default Object toDoubleArray()
      • map

        RandomVariableArray map​(RandomOperator operator)
        Component wise operation
        Parameters:
        operator - A function operator mapping random variables x → operator(x).
        Returns:
        An array where operator has been applied to eeach element.
      • sumProduct

        RandomVariable sumProduct​(RandomVariableArray array)
        Components wise product followed by sum of all elements. Reduction of getLevel by 1. Note: The return value is for sure instanceof RandomVariable but may be instanceof RandomVariableArray.
        Parameters:
        array - Given RandomVariableArray of the same size()
        Returns:
        The scalar product of this array and the given array.
      • getConditionalExpectation

        default RandomVariableArray getConditionalExpectation​(ConditionalExpectationEstimator conditionalExpectationOperator)
        Description copied from interface: RandomVariable
        Returns the conditional expectation using a given conditional expectation estimator.
        Specified by:
        getConditionalExpectation in interface RandomVariable
        Parameters:
        conditionalExpectationOperator - A given conditional expectation estimator.
        Returns:
        The conditional expectation of this random variable (as a random variable)