Package com.opengamma.analytics.math.matrix

Examples of com.opengamma.analytics.math.matrix.ColtMatrixAlgebra


  private final Decomposition<?> _decomposition;
  private final MatrixAlgebra _algebra;

  public GeneralizedLeastSquare() {
    _decomposition = new SVDecompositionCommons();
    _algebra = new ColtMatrixAlgebra();

  }
View Full Code Here


    out.println(matrix_2d);
  }

  // @export "matrixAlgebraDemo"
  public static void matrixAlgebraDemo(PrintStream out) {
    ColtMatrixAlgebra colt = new ColtMatrixAlgebra();
    DoubleMatrix1D v = new DoubleMatrix1D(ARRAY_1D);
    DoubleMatrix2D m = new DoubleMatrix2D(ARRAY_2D);

    out.println(colt.getTranspose(m));
    out.println(colt.multiply(m, v));
  }
View Full Code Here

    final DoubleMatrix2D m = new DoubleMatrix2D(matrix_4);

    final double[] data_1d = {1.0, 2.0, 3.0, 4.0 };
    final DoubleMatrix1D v = new DoubleMatrix1D(data_1d);

    final ColtMatrixAlgebra colt = new ColtMatrixAlgebra();
    out.println(colt.multiply(m, v));
  }
View Full Code Here

    fD[2][0] = fpp;
    fD[2][1] = (fpp + fD[0][2] * (2 * (_mu + 1) + 2 * _parameter[1] / _cutOffStrike + 4 * _parameter[2] / (_cutOffStrike * _cutOffStrike))) / _cutOffStrike;
    fD[2][2] = (fpp + fD[0][2] * (2 * (2 * _mu + 3) + 4 * _parameter[1] / _cutOffStrike + 8 * _parameter[2] / (_cutOffStrike * _cutOffStrike))) / (_cutOffStrike * _cutOffStrike);
    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();
  }
View Full Code Here

    fD[2][0] = fpp;
    fD[2][1] = (fpp + fD[0][2] * (2 * (_mu + 1) + 2 * _parameter[1] / _cutOffStrike + 4 * _parameter[2] / (_cutOffStrike * _cutOffStrike))) / _cutOffStrike;
    fD[2][2] = (fpp + fD[0][2] * (2 * (2 * _mu + 3) + 4 * _parameter[1] / _cutOffStrike + 8 * _parameter[2] / (_cutOffStrike * _cutOffStrike))) / (_cutOffStrike * _cutOffStrike);
    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();
    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();
View Full Code Here

  }

  @Test
  public void testEqualsAndHashCode() {
    final DeltaGammaCovarianceMatrixMeanCalculator f1 = new DeltaGammaCovarianceMatrixMeanCalculator(ALGEBRA);
    final DeltaGammaCovarianceMatrixMeanCalculator f2 = new DeltaGammaCovarianceMatrixMeanCalculator(new ColtMatrixAlgebra());
    assertEquals(f1, F);
    assertEquals(f1.hashCode(), F.hashCode());
    assertFalse(f1.equals(f2));
  }
View Full Code Here

  }

  @Test
  public void testEqualsAndHashCode() {
    final DeltaGammaCovarianceMatrixStandardDeviationCalculator f1 = new DeltaGammaCovarianceMatrixStandardDeviationCalculator(ALGEBRA);
    final DeltaGammaCovarianceMatrixStandardDeviationCalculator f2 = new DeltaGammaCovarianceMatrixStandardDeviationCalculator(new ColtMatrixAlgebra());
    assertEquals(f1, F);
    assertEquals(f1.hashCode(), F.hashCode());
    assertFalse(f1.equals(f2));
  }
View Full Code Here

  }

  @Test
  public void testEqualsAndHashCode() {
    final DeltaGammaCovarianceMatrixFisherKurtosisCalculator f1 = new DeltaGammaCovarianceMatrixFisherKurtosisCalculator(ALGEBRA);
    final DeltaGammaCovarianceMatrixFisherKurtosisCalculator f2 = new DeltaGammaCovarianceMatrixFisherKurtosisCalculator(new ColtMatrixAlgebra());
    assertEquals(F, f1);
    assertEquals(F.hashCode(), f1.hashCode());
    assertFalse(f1.equals(f2));
  }
View Full Code Here

  }

  @Test
  public void testEqualsAndHashCode() {
    final DeltaMeanCalculator f1 = new DeltaMeanCalculator(ALGEBRA);
    final DeltaMeanCalculator f2 = new DeltaMeanCalculator(new ColtMatrixAlgebra());
    assertEquals(f1, F);
    assertEquals(f1.hashCode(), F.hashCode());
    assertFalse(f1.equals(f2));
  }
View Full Code Here

  }

  @Test
  public void testEqualsAndHashCode() {
    final DeltaCovarianceMatrixStandardDeviationCalculator f1 = new DeltaCovarianceMatrixStandardDeviationCalculator(ALGEBRA);
    final DeltaCovarianceMatrixStandardDeviationCalculator f2 = new DeltaCovarianceMatrixStandardDeviationCalculator(new ColtMatrixAlgebra());
    assertEquals(f1, F);
    assertEquals(f1.hashCode(), F.hashCode());
    assertFalse(f1.equals(f2));
  }
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.math.matrix.ColtMatrixAlgebra

Copyright © 2018 www.massapicom. 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.