-
- All Superinterfaces:
RandomVariable,Serializable
- All Known Implementing Classes:
RandomVariableArrayImplementation
public interface RandomVariableArray extends RandomVariable
An array ofRandomVariableobjects, implementing theRandomVariableinterface. The array features a methodgetLevel()which indicates if the object is an array where elements are themselves arrays. SeegetLevel(). All methods inherited fromRandomVariableact 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 RandomVariableArraygetConditionalExpectation(ConditionalExpectationEstimator conditionalExpectationOperator)Returns the conditional expectation using a given conditional expectation estimator.RandomVariablegetElement(int index)default intgetLevel()Returns the level of the array The level of the array is given by 1 if the elements are of typeRandomVariablebut not of typeRandomVariableArray.intgetNumberOfElements()RandomVariableArraymap(RandomOperator operator)Component wise operationRandomVariablesumProduct(RandomVariableArray array)Components wise product followed by sum of all elements.default ObjecttoDoubleArray()-
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 typeRandomVariablebut not of typeRandomVariableArray. If the elements are of typeRandomVariableArraythe 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 instanceofRandomVariablebut may be instanceofRandomVariableArray.- Parameters:
array- GivenRandomVariableArrayof the same size()- Returns:
- The scalar product of this array and the given array.
-
getConditionalExpectation
default RandomVariableArray getConditionalExpectation(ConditionalExpectationEstimator conditionalExpectationOperator)
Description copied from interface:RandomVariableReturns the conditional expectation using a given conditional expectation estimator.- Specified by:
getConditionalExpectationin interfaceRandomVariable- Parameters:
conditionalExpectationOperator- A given conditional expectation estimator.- Returns:
- The conditional expectation of this random variable (as a random variable)
-
-