-
- All Superinterfaces:
RandomVariable
,Serializable
- All Known Implementing Classes:
RandomVariableArrayImplementation
public interface RandomVariableArray extends RandomVariable
An array ofRandomVariable
objects, implementing theRandomVariable
interface. The array features a methodgetLevel()
which indicates if the object is an array where elements are themselves arrays. SeegetLevel()
. All methods inherited fromRandomVariable
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, seesumProduct(RandomVariableArray)
.- Author:
- Christian Fries
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default RandomVariableArray
getConditionalExpectation(ConditionalExpectationEstimator conditionalExpectationOperator)
Returns the conditional expectation using a given conditional expectation estimator.RandomVariable
getElement(int index)
default int
getLevel()
Returns the level of the array The level of the array is given by 1 if the elements are of typeRandomVariable
but not of typeRandomVariableArray
.int
getNumberOfElements()
RandomVariableArray
map(RandomOperator operator)
Component wise operationRandomVariable
sumProduct(RandomVariableArray array)
Components wise product followed by sum of all elements.default Object
toDoubleArray()
-
Methods inherited from interface net.finmath.stochastic.RandomVariable
abs, accrue, add, add, addProduct, addProduct, addRatio, addSumProduct, addSumProduct, apply, apply, apply, appy, average, bus, bus, cache, cap, cap, choose, cos, covariance, discount, div, div, doubleValue, equals, exp, expectation, expm1, floor, floor, get, getAverage, getAverage, getFiltrationTime, getHistogram, getHistogram, getMax, getMin, getOperator, getQuantile, getQuantile, getQuantileExpectation, getRealizations, getRealizationsStream, getSampleVariance, getStandardDeviation, getStandardDeviation, getStandardError, getStandardError, getTypePriority, getValues, getVariance, getVariance, invert, isDeterministic, isNaN, log, mult, mult, pow, sin, size, sqrt, squared, sub, sub, subRatio, variance, vid, vid
-
-
-
-
Method Detail
-
getNumberOfElements
int getNumberOfElements()
-
getElement
RandomVariable getElement(int index)
-
getLevel
default int getLevel()
Returns the level of the array The level of the array is given by 1 if the elements are of typeRandomVariable
but not of typeRandomVariableArray
. If the elements are of typeRandomVariableArray
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 instanceofRandomVariable
but may be instanceofRandomVariableArray
.- Parameters:
array
- GivenRandomVariableArray
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 interfaceRandomVariable
- Parameters:
conditionalExpectationOperator
- A given conditional expectation estimator.- Returns:
- The conditional expectation of this random variable (as a random variable)
-
-