Package com.opengamma.analytics.math.matrix

Examples of com.opengamma.analytics.math.matrix.OGMatrixAlgebra.multiply()


    final DoubleMatrix2D fDmatrix = new DoubleMatrix2D(fD);
    // Derivative of abc with respect to forward
    final ColtMatrixAlgebra algebra = new ColtMatrixAlgebra();
    final DoubleMatrix2D fDInverse = algebra.getInverse(fDmatrix);
    final OGMatrixAlgebra algebraOG = new OGMatrixAlgebra();
    final DoubleMatrix1D derivativeF = (DoubleMatrix1D) algebraOG.multiply(fDInverse, pDFvector);
    return derivativeF.getData();
  }

  /**
   * Computes the derivative of the three fitting parameters with respect to the SABR parameters.
View Full Code Here


    final ColtMatrixAlgebra algebra = new ColtMatrixAlgebra();
    final DoubleMatrix2D fDInverse = algebra.getInverse(fDmatrix);
    final OGMatrixAlgebra algebraOG = new OGMatrixAlgebra();
    for (int loopparam = 0; loopparam < 4; loopparam++) {
      final DoubleMatrix1D pDSABRvector = new DoubleMatrix1D(pDSABR[loopparam]);
      final DoubleMatrix1D derivativeSABR = (DoubleMatrix1D) algebraOG.multiply(fDInverse, pDSABRvector);
      result[loopparam] = derivativeSABR.getData();
    }
    return result;
  }
View Full Code Here

    final LUDecompositionCommons decmp = new LUDecompositionCommons();
    final LUDecompositionResult decmpRes = decmp.evaluate(res.getCovariance());
    final DoubleMatrix2D invCovariance = decmpRes.solve(DoubleMatrixUtils.getIdentityMatrix2D(4));

    double z = ma.getInnerProduct(delta, ma.multiply(invCovariance, delta));
    z = Math.sqrt(z);

    assertTrue(z < 3.0);

    //     System.out.println("chiSqr: " + res.getChiSq());
View Full Code Here

    final DoubleMatrix1D solution = new DoubleMatrix1D(new double[] {1.0, 1.0, 0.0, 0.0 });
    final NonLinearLeastSquare ls = new NonLinearLeastSquare();
    final DoubleMatrix2D res = ls.calInverseJacobian(SIGMA, FUNCTION, GRAD, solution);
    //  System.out.println("invese Jac: " + res);

    final DoubleMatrix1D deltaParms = (DoubleMatrix1D) ma.multiply(res, deltaY);
    // System.out.println("delta parms: " + deltaParms);

    final DoubleMatrix1D y = (DoubleMatrix1D) ma.add(Y, deltaY);

    final LeastSquareResults lsRes = ls.solve(X, y, SIGMA, PARAM_FUNCTION, PARAM_GRAD, solution);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.