/src/main/java/net/finmath/marketdata2/model/curves/DiscountCurveInterpolation.java
final RandomVariable[] timesAsRandomVariables = DoubleStream.of( givenDiscountFactors).mapToObj( new DoubleFunction<RandomVariableFromDoubleArray>( ) {
final RandomVariable[] givenDiscountFactorsAsRandomVariables = DoubleStream.of ( givenDiscountFactors ) .mapToObj ( new DoubleFunction<RandomVariableFromDoubleArray> ( ) {
for(int timeIndex=0; timeIndex<times.length;timeIndex++) { discountFactors.addDiscountFactor(times[timeIndex], givenDiscountFactors[timeIndex], times[timeIndex] > 0); } return discountFactors; } public static DiscountCurveInterpolation createDiscountCurveFromDiscountFactors(final String name, final double[] times, final double[] givenDiscountFactors) { <extra_id_0> @Override public RandomVariableFromDoubleArray apply(final double x) { return new RandomVariableFromDoubleArray(x); } }).toArray(RandomVariable[]::new); return createDiscountCurveFromDiscountFactors(name, times, givenDiscountFactorsAsRandomVariables); } public static DiscountCurveInterpolation createDiscountCurveFromZeroRates(