- All Superinterfaces:
RandomVariable
,Serializable
- All Known Implementing Classes:
RandomVariableArrayImplementation
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 Summary
Modifier and TypeMethodDescriptiondefault RandomVariableArray
getConditionalExpectation(ConditionalExpectationEstimator conditionalExpectationOperator)
Returns the conditional expectation using a given conditional expectation estimator.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
map(RandomOperator operator)
Component wise operationsumProduct(RandomVariableArray array)
Components wise product followed by sum of all elements.default Object
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 Details
-
getNumberOfElements
int getNumberOfElements() -
getElement
-
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
-
map
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
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)
-