Interface RandomVariableFactory

All Known Subinterfaces:
RandomVariableDifferentiableFactory
All Known Implementing Classes:
AbstractRandomVariableDifferentiableFactory, AbstractRandomVariableFactory, RandomVariableDifferentiableAADFactory, RandomVariableDifferentiableADFactory, RandomVariableFloatFactory, RandomVariableFromArrayFactory, RandomVariableLazyEvaluationFactory

public interface RandomVariableFactory
A factory for creating objects implementing net.finmath.stochastic.RandomVariable. Use this interface in your implementations to allow dependency injection, i.e. to allow the use of different implementations of net.finmath.stochastic.RandomVariable whenever random variables need to be constructed.
Version:
1.0
Author:
Christian Fries
See Also:
  • Method Details

    • 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.
    • createRandomVariable

      default RandomVariable createRandomVariable(double[] values)
    • 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.