public class RandomVariableFromFloatArray extends Object implements RandomVariable
RandomVariable is thread safe (and does not mutate the class).
This implementation uses floats for the realizations (consuming less memory compared to using doubles). However,
the calculation of the average is performed using double precision.| Constructor and Description |
|---|
RandomVariableFromFloatArray(double value)
Create a non stochastic random variable, i.e.
|
RandomVariableFromFloatArray(double time,
double value)
Create a non stochastic random variable, i.e.
|
RandomVariableFromFloatArray(double time,
double[] realisations)
Create a stochastic random variable.
|
RandomVariableFromFloatArray(double time,
double value,
int typePriority)
Create a non stochastic random variable, i.e.
|
RandomVariableFromFloatArray(double time,
float[] newRealizations)
Create a non stochastic random variable, i.e.
|
RandomVariableFromFloatArray(double time,
float[] realisations,
int typePriority)
Create a stochastic random variable.
|
RandomVariableFromFloatArray(double time,
int numberOfPath,
double value)
Deprecated.
|
RandomVariableFromFloatArray(double time,
IntToDoubleFunction realizations,
int size)
Create a stochastic random variable.
|
RandomVariableFromFloatArray(double time,
IntToDoubleFunction realizations,
int size,
int typePriority)
Create a stochastic random variable.
|
RandomVariableFromFloatArray(RandomVariable value)
Create a random variable from a given other implementation of
RandomVariable. |
RandomVariableFromFloatArray(RandomVariable value,
DoubleUnaryOperator function)
Create a random variable by applying a function to a given other implementation of
RandomVariable. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddSumProduct, getValuespublic RandomVariableFromFloatArray(RandomVariable value)
RandomVariable.value - Object implementing RandomVariable.public RandomVariableFromFloatArray(double value)
value - the value, a constant.public RandomVariableFromFloatArray(RandomVariable value, DoubleUnaryOperator function)
RandomVariable.value - Object implementing RandomVariable.function - A function mapping double to double.public RandomVariableFromFloatArray(double time,
double value,
int typePriority)
time - the filtration time, set to 0.0 if not used.value - the value, a constant.typePriority - The priority of this type in construction of result types. See "operator type priority" for details.public RandomVariableFromFloatArray(double time,
double value)
time - the filtration time, set to 0.0 if not used.value - the value, a constant.public RandomVariableFromFloatArray(double time,
float[] newRealizations)
time - the filtration time, set to 0.0 if not used.newRealizations - the value, a constant.@Deprecated public RandomVariableFromFloatArray(double time, int numberOfPath, double value)
time - the filtration time, set to 0.0 if not used.numberOfPath - The number of paths.value - the value, a constant.public RandomVariableFromFloatArray(double time,
float[] realisations,
int typePriority)
time - the filtration time, set to 0.0 if not used.realisations - the vector of realizations.typePriority - The priority of this type in construction of result types. See "operator type priority" for details.public RandomVariableFromFloatArray(double time,
double[] realisations)
time - the filtration time, set to 0.0 if not used.realisations - the vector of realizations.public RandomVariableFromFloatArray(double time,
IntToDoubleFunction realizations,
int size,
int typePriority)
time - the filtration time, set to 0.0 if not used.realizations - A map mapping integer (path or state) to double, representing this random variable.size - The size, i.e., number of paths.typePriority - The priority of this type in construction of result types. See "operator type priority" for details.public RandomVariableFromFloatArray(double time,
IntToDoubleFunction realizations,
int size)
time - the filtration time, set to 0.0 if not used.realizations - A map mapping integer (path or state) to double, representing this random variable.size - The size, i.e., number of paths.public boolean equals(RandomVariable randomVariable)
equals in interface RandomVariablepublic double getFiltrationTime()
getFiltrationTime in interface RandomVariablepublic int getTypePriority()
getTypePriority in interface RandomVariablepublic double get(int pathOrState)
get in interface RandomVariablepublic int size()
size in interface RandomVariablepublic double getMin()
getMin in interface RandomVariablepublic double getMax()
getMax in interface RandomVariablepublic double getAverage()
getAverage in interface RandomVariablepublic double getAverage(RandomVariable probabilities)
getAverage in interface RandomVariablepublic double getVariance()
getVariance in interface RandomVariablepublic double getVariance(RandomVariable probabilities)
getVariance in interface RandomVariablepublic double getSampleVariance()
getSampleVariance in interface RandomVariablepublic double getStandardDeviation()
getStandardDeviation in interface RandomVariablepublic double getStandardDeviation(RandomVariable probabilities)
getStandardDeviation in interface RandomVariablepublic double getStandardError()
getStandardError in interface RandomVariablepublic double getStandardError(RandomVariable probabilities)
getStandardError in interface RandomVariablepublic double getQuantile(double quantile)
getQuantile in interface RandomVariablepublic double getQuantile(double quantile,
RandomVariable probabilities)
getQuantile in interface RandomVariablepublic double getQuantileExpectation(double quantileStart,
double quantileEnd)
getQuantileExpectation in interface RandomVariablepublic double[] getHistogram(double[] intervalPoints)
getHistogram in interface RandomVariablepublic double[][] getHistogram(int numberOfPoints,
double standardDeviations)
getHistogram in interface RandomVariablepublic boolean isDeterministic()
isDeterministic in interface RandomVariablepublic RandomVariable cache()
cache in interface RandomVariablepublic DoubleStream getRealizationsStream()
getRealizationsStream in interface RandomVariablepublic double[] getRealizations()
getRealizations in interface RandomVariablepublic Double doubleValue()
doubleValue in interface RandomVariablepublic IntToDoubleFunction getOperator()
getOperator in interface RandomVariablepublic RandomVariable apply(DoubleUnaryOperator operator)
apply in interface RandomVariablepublic RandomVariable apply(DoubleBinaryOperator operator, RandomVariable argument)
apply in interface RandomVariablepublic RandomVariable apply(DoubleTernaryOperator operator, RandomVariable argument1, RandomVariable argument2)
apply in interface RandomVariablepublic RandomVariable cap(double cap)
cap in interface RandomVariablepublic RandomVariable floor(double floor)
floor in interface RandomVariablepublic RandomVariable add(double value)
add in interface RandomVariablepublic RandomVariable sub(double value)
sub in interface RandomVariablepublic RandomVariable mult(double value)
mult in interface RandomVariablepublic RandomVariable div(double value)
div in interface RandomVariablepublic RandomVariable pow(double exponent)
pow in interface RandomVariablepublic RandomVariable average()
average in interface RandomVariablepublic RandomVariable getConditionalExpectation(ConditionalExpectationEstimator conditionalExpectationOperator)
getConditionalExpectation in interface RandomVariablepublic RandomVariable squared()
squared in interface RandomVariablepublic RandomVariable sqrt()
sqrt in interface RandomVariablepublic RandomVariableFromFloatArray exp()
exp in interface RandomVariablepublic RandomVariableFromFloatArray log()
log in interface RandomVariablepublic RandomVariable sin()
sin in interface RandomVariablepublic RandomVariable cos()
cos in interface RandomVariablepublic RandomVariable add(RandomVariable randomVariable)
add in interface RandomVariablepublic RandomVariable sub(RandomVariable randomVariable)
sub in interface RandomVariablepublic RandomVariable bus(RandomVariable randomVariable)
bus in interface RandomVariablepublic RandomVariable mult(RandomVariable randomVariable)
mult in interface RandomVariablepublic RandomVariable div(RandomVariable randomVariable)
div in interface RandomVariablepublic RandomVariable vid(RandomVariable randomVariable)
vid in interface RandomVariablepublic RandomVariable cap(RandomVariable randomVariable)
cap in interface RandomVariablepublic RandomVariable floor(RandomVariable randomVariable)
floor in interface RandomVariablepublic RandomVariable accrue(RandomVariable rate, double periodLength)
accrue in interface RandomVariablepublic RandomVariable discount(RandomVariable rate, double periodLength)
discount in interface RandomVariablepublic RandomVariable choose(RandomVariable valueIfTriggerNonNegative, RandomVariable valueIfTriggerNegative)
choose in interface RandomVariablepublic RandomVariable invert()
invert in interface RandomVariablepublic RandomVariable abs()
abs in interface RandomVariablepublic RandomVariable addProduct(RandomVariable factor1, double factor2)
addProduct in interface RandomVariablepublic RandomVariable addProduct(RandomVariable factor1, RandomVariable factor2)
addProduct in interface RandomVariablepublic RandomVariable addSumProduct(List<RandomVariable> factor1, List<RandomVariable> factor2)
addSumProduct in interface RandomVariablepublic RandomVariable addRatio(RandomVariable numerator, RandomVariable denominator)
addRatio in interface RandomVariablepublic RandomVariable subRatio(RandomVariable numerator, RandomVariable denominator)
subRatio in interface RandomVariablepublic RandomVariable isNaN()
isNaN in interface RandomVariableCopyright © 2019. All rights reserved.