/src/main/java/net/finmath/montecarlo/assetderivativevaluation/models/MultiAssetBlackScholesModel.java
for( int factorIndex = 0; underlyingIndex<factorLoadings.length; underlyingIndex++) {
for ( int underlyingIndex = 0; underlyingIndex<factorLoadings.length; underlyingIndex++ ) {
riskFreeRate, getFactorLoadingsFromVolatilityAnCorrelation(volatilities, correlations) ); } private static double[][] getFactorLoadingsFromVolatilityAnCorrelation(double[] volatilities, double[][] correlations) { final double[][] factorLoadings = LinearAlgebra.getFactorMatrix(correlations, correlations.length); <extra_id_0> final double volatility = volatilities[underlyingIndex]; for(int factorIndex = 0; factorIndex<factorLoadings[underlyingIndex].length; factorIndex++) { factorLoadings[underlyingIndex][factorIndex] = factorLoadings[underlyingIndex][factorIndex] * volatility; } } return factorLoadings;