dfdPhi[loopp1][loopp2] += 2 * dPvCaldPhi[loopcal][loopp1] * dPvCaldPhi[loopcal][loopp2];
}
}
}
final DoubleMatrix2D dfdThetaMat = new DoubleMatrix2D(dfdTheta);
final DoubleMatrix2D dfdPhiMat = new DoubleMatrix2D(dfdPhi);
final DoubleMatrix2D dfdPhiInvMat = ALGEBRA.getInverse(dfdPhiMat);
final DoubleMatrix2D dPhidThetaMat = (DoubleMatrix2D) ALGEBRA.scale(ALGEBRA.multiply(dfdPhiInvMat, dfdThetaMat), -1.0);
final DoubleMatrix1D dPvdPhiMat = new DoubleMatrix1D(dPvdPhi);
final DoubleMatrix2D dPvdThetaMat = ALGEBRA.getTranspose(ALGEBRA.multiply(ALGEBRA.getTranspose(dPhidThetaMat), dPvdPhiMat));
final double[] dPvdTheta = dPvdThetaMat.getData()[0];
// Storage in PresentValueSABRSensitivityDataBundle
final PresentValueSABRSensitivityDataBundle sensiSABR = new PresentValueSABRSensitivityDataBundle();
for (int loopp = 0; loopp < nbPeriods; loopp++) {
final DoublesPair expiryMaturity = new DoublesPair(swaptionCalibration[loopp * nbStrikes].getTimeToExpiry(), swaptionCalibration[loopp * nbStrikes].getMaturityTime());