-
- All Known Subinterfaces:
RandomVariableDifferentiableFactory
- All Known Implementing Classes:
AbstractRandomVariableDifferentiableFactory
,AbstractRandomVariableFactory
,RandomVariableDifferentiableAADFactory
,RandomVariableDifferentiableADFactory
,RandomVariableFloatFactory
,RandomVariableFromArrayFactory
,RandomVariableLazyEvaluationFactory
public interface RandomVariableFactory
A factory for creating objects implementingnet.finmath.stochastic.RandomVariable
. Use this interface in your implementations to allow dependency injection, i.e. to allow the use of different implementations ofnet.finmath.stochastic.RandomVariable
whenever random variables need to be constructed.- Version:
- 1.0
- Author:
- Christian Fries
- See Also:
RandomVariable
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description RandomVariable
createRandomVariable(double value)
Create a (deterministic) random variable from a constant.RandomVariable
createRandomVariable(double time, double value)
Create a (deterministic) random variable from a constant using a specific filtration time.RandomVariable
createRandomVariable(double time, double[] values)
Create a random variable from an array using a specific filtration time.RandomVariable[]
createRandomVariableArray(double[] values)
Create an array of (deterministic) random variables from an array of constants.RandomVariable[][]
createRandomVariableMatrix(double[][] values)
Create a matrix of (deterministic) random variables from an matrix of constants.static RandomVariable
getRandomVariableOrDefault(RandomVariableFactory randomVariableFactory, Object value, RandomVariable defaultValue)
Static method for creating random variables from Objects.
-
-
-
Method Detail
-
getRandomVariableOrDefault
static RandomVariable getRandomVariableOrDefault(RandomVariableFactory randomVariableFactory, Object value, RandomVariable defaultValue)
Static method for creating random variables from Objects.- Parameters:
randomVariableFactory
- The RandomVariableFactory used to construct the random variable, if needed.value
- The value used to construct the random variable, if needed.defaultValue
- The default value to be used if value is null.- Returns:
- A RandomVariable with the given value (or the defaultValue).
-
createRandomVariable
RandomVariable createRandomVariable(double value)
Create a (deterministic) random variable from a constant.- Parameters:
value
- A constant value.- Returns:
- The
RandomVariable
.
-
createRandomVariable
RandomVariable createRandomVariable(double time, double value)
Create a (deterministic) random variable from a constant using a specific filtration time.- Parameters:
time
- The filtration time of the random variable.value
- A constant value.- Returns:
- The
RandomVariable
.
-
createRandomVariable
RandomVariable createRandomVariable(double time, double[] values)
Create a random variable from an array using a specific filtration time.- Parameters:
time
- The filtration time of the random variable.values
- Array representing values of the random variable at the sample paths.- Returns:
- The
RandomVariable
.
-
createRandomVariableArray
RandomVariable[] createRandomVariableArray(double[] values)
Create an array of (deterministic) random variables from an array of constants.- Parameters:
values
- Array representing constants.- Returns:
- The
RandomVariable
.
-
createRandomVariableMatrix
RandomVariable[][] createRandomVariableMatrix(double[][] values)
Create a matrix of (deterministic) random variables from an matrix of constants.- Parameters:
values
- Matrix representing constants.- Returns:
- The
RandomVariable
.
-
-