Examples of solve()


Examples of com.opengamma.analytics.financial.model.volatility.smile.fitting.MixedLogNormalModelFitter.solve()

    if (n == 3 || !_globalBetaSearch) {
      fixed.set(1); //fixed beta
    }

    //do a global fit first
    final LeastSquareResultsWithTransform gRes = globalFitter.solve(start, fixed);

    if (n == 3) {
      if (gRes.getChiSq() / n > 1.0) {
        s_logger.warn("chi^2 on SABR fit to ", +n + " points is " + gRes.getChiSq());
      }
View Full Code Here

Examples of com.opengamma.analytics.financial.model.volatility.smile.fitting.SABRModelFitter.solve()

    if (n == 3 || !_globalBetaSearch) {
      fixed.set(1); //fixed beta
    }

    //do a global fit first
    final LeastSquareResultsWithTransform gRes = globalFitter.solve(start, fixed);

    if (n == 3) {
      if (gRes.getChiSq() / n > 1.0) {
        s_logger.warn("chi^2 on SABR fit to ", +n + " points is " + gRes.getChiSq());
      }
View Full Code Here

Examples of com.opengamma.analytics.math.interpolation.PSplineFitter.solve()

      x.add(k[i]);
      y.add(vols[i]);
      sigma.add(1e-5);
    }
    final PSplineFitter pfitter = new PSplineFitter();
    final GeneralizedLeastSquareResults<Double> temp = pfitter.solve(x, y, sigma, 0.5, 1.7, 50, 3, 100000000, 2);
    final Function1D<Double, Double> func3 = temp.getFunction();

    for (int i = 0; i < 101; i++) {
      final double strike = 0.5 + 1.0 * i / 100.;
      System.out.println(strike + "\t" + func.evaluate(strike) + "\t" + func2.evaluate(strike) + "\t" + func3.evaluate(strike));
View Full Code Here

Examples of com.opengamma.analytics.math.linearalgebra.DecompositionResult.solve()

      alpha = getModifiedCurvatureMatrix(jacobian, lambda, penalty);

      DoubleMatrix1D deltaTheta;
      try {
        decmp = _decomposition.evaluate(alpha);
        deltaTheta = decmp.solve(beta);
      } catch (final Exception e) {
        throw new MathException(e);
      }

      DoubleMatrix1D trialTheta = (DoubleMatrix1D) _algebra.add(theta, deltaTheta);
View Full Code Here

Examples of com.opengamma.analytics.math.linearalgebra.LUDecompositionResult.solve()

      }
    }
    final DoubleMatrix1D vLambda = new DoubleMatrix1D(temp);
    final DoubleMatrix2D jacT = new DoubleMatrix2D(res);
    final LUDecompositionResult luRes = decomp.evaluate(jacT);
    final DoubleMatrix1D vS = luRes.solve(vLambda);
    return vS.getData();
  }

  public double[][] analyticCS01FromCreditCurve(final CDSAnalytic[] cds, final double[] cdsCoupon, final CDSAnalytic[] bucketCDSs, final ISDACompliantYieldCurve yieldCurve,
      final ISDACompliantCreditCurve creditCurve) {
View Full Code Here

Examples of com.opengamma.analytics.math.linearalgebra.SVDecompositionResult.solve()

    final DoubleMatrix2D wtW = (DoubleMatrix2D) MATRIX.multiply(MATRIX.getTranspose(w), w);
    final DoubleMatrix2D rWtW = (DoubleMatrix2D) MATRIX.multiply(r, wtW);
    final DoubleMatrix2D rWtWRt = (DoubleMatrix2D) MATRIX.multiply(rWtW, MATRIX.getTranspose(r));
    final DoubleMatrix1D rWtWP = ((DoubleMatrix2D) MATRIX.scale(MATRIX.multiply(rWtW, p), -1.0)).getColumnVector(0);
    final SVDecompositionResult dec = DECOMPOSITION.evaluate(rWtWRt);
    final DoubleMatrix1D q = dec.solve(rWtWP);
    return q.getData();
  }

  /**
   * Convert the parameter sensitivity into a matrix (DoubleMatrix1D). All the sensitivities should be in the same currency.
View Full Code Here

Examples of com.opengamma.analytics.math.statistics.leastsquare.NonLinearLeastSquare.solve()

      objective.setEndIndex(_instrumentIndex.get((loopblock + 1) * _nbInstrumentsBlock) - 1);
      // Implementation note: the index start is from the first instrument of the block and the index end is from the last instrument of the block.
      final DoubleMatrix1D observedValues = new DoubleMatrix1D(_nbInstrumentsBlock, 0.0);
      @SuppressWarnings("unused")
      final
      LeastSquareResults result = ls.solve(observedValues, getCalibrationObjective(), new DoubleMatrix1D(1.0, 0.0));
      // Implementation note: the start value is a multiplicative factor of one and an additive term of 0 (parameters unchanged).
      //   The observed values are 0 as the function returns the difference between the calculated prices and the targets.
    }
  }

View Full Code Here

Examples of csp.backends.MinionSolver.solve()

    MinionCSPProblem mProb = imconv.convertCSPToMinion(ficonv.convertToCSPProblem());
    MinionSolver solv = new MinionSolver("/home/jeroen/programming/minion-0.10/bin/minion");
    System.out.println("Reading file...");
    solv.read(mProb);
    System.out.println("Ok, read file. Now solving ...");
    CSPSolution solution = solv.solve();
    System.out.println("Solving ended!");
    if (solution != null) {
      Map<String, Double> fsol = ficonv.convertCSPSolutionToFuzzyModel(solution);
      solution.getSolution().putAll(trivialAssignments);
      checkModel(clauses, fsol);
View Full Code Here

Examples of csp.backends.TailorSolver.solve()

    solv.read(ficonv.convertToCSPProblem());
   
    System.out.println("Ok, read file. Now solving ...");
    solv.PPLEVELNUMBER = TailorSolver.PPLEVELNUMBER.SAC;
    solv.VARORDERNUMBER = TailorSolver.VARORDERNUMBER.LDF;
    CSPSolution solution = solv.solve();
    System.out.println("Solving ended!");
    if (solution != null) {
      solution.getSolution().putAll(trivialAssignments);
      Map<String, Double> fsol = ficonv.convertCSPSolutionToFuzzyModel(solution);
      for (String key : fsol.keySet()) {
View Full Code Here

Examples of edu.cmu.relativelayout.matrix.RelativeMatrix.solve()

    RelativeMatrix myBackend = this.getBackend();

    initializeMatrixForContainer(theParent, myBackend);

    // Generate solutions:
    Map<Variable, Double> solutions = myBackend.solve();
    // System.out.println(solutions);

    setComponentBoundsFromVariables(theParent, solutions);
  }
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.