Examples of SVDecompositionCommons


Examples of com.opengamma.analytics.math.linearalgebra.SVDecompositionCommons

            decmp = _decomposition.evaluate(alpha0);
          }
          return finish(alpha0, decmp, newChiSqr, jacobian, trialTheta, sigma);
        }

        final SVDecompositionCommons svd = (SVDecompositionCommons) DecompositionFactory.SV_COMMONS;

        //add the second derivative information to the Hessian matrix to check we are not at a local maximum or saddle point
        final VectorFieldSecondOrderDifferentiator diff = new VectorFieldSecondOrderDifferentiator();
        final Function1D<DoubleMatrix1D, DoubleMatrix2D[]> secDivFunc = diff.differentiate(func, constraints);
        final DoubleMatrix2D[] secDiv = secDivFunc.evaluate(trialTheta);
        final double[][] temp = new double[nParms][nParms];
        for (int i = 0; i < nObs; i++) {
          for (int j = 0; j < nParms; j++) {
            for (int k = 0; k < nParms; k++) {
              temp[j][k] -= newError.getEntry(i) * secDiv[i].getEntry(j, k) / sigma.getEntry(i);
            }
          }
        }
        final DoubleMatrix2D newAlpha = (DoubleMatrix2D) _algebra.add(alpha0, new DoubleMatrix2D(temp));

        final SVDecompositionResult svdRes = svd.evaluate(newAlpha);
        final double[] w = svdRes.getSingularValues();
        final DoubleMatrix2D u = svdRes.getU();
        final DoubleMatrix2D v = svdRes.getV();

        final double[] p = new double[nParms];
View Full Code Here

Examples of com.opengamma.analytics.math.linearalgebra.SVDecompositionCommons

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

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

  }
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.