Package com.opengamma.analytics.math.rootfinding.newton

Examples of com.opengamma.analytics.math.rootfinding.newton.BroydenVectorRootFinder


   */
  public CurveBuildingFunction(final double toleranceAbs, final double toleranceRel, final int stepMaximum) {
    _toleranceAbs = toleranceAbs;
    _toleranceRel = toleranceRel;
    _stepMaximum = stepMaximum;
    _rootFinder = new BroydenVectorRootFinder(_toleranceAbs, _toleranceRel, _stepMaximum, DecompositionFactory.getDecomposition(DecompositionFactory.SV_COLT_NAME));
    // TODO: make the root finder flexible.
  }
View Full Code Here


    final LinkedHashMap mapCurveInterpolation = new LinkedHashMap();
    final LinkedHashMap mapSensInterpolation = new LinkedHashMap();

    final MultipleYieldCurveFinderDataBundle curveFinderDataBundle;

    final BroydenVectorRootFinder rootFinder = new BroydenVectorRootFinder();

    final double[] guessArray = new double[nMats];
    for (int i = 0; i < nMats; i++) {
      guessArray[i] = 0.01;
    }
View Full Code Here

   */
  public MulticurveProviderForwardBuildingRepository(final double toleranceAbs, final double toleranceRel, final int stepMaximum) {
    _toleranceAbs = toleranceAbs;
    _toleranceRel = toleranceRel;
    _stepMaximum = stepMaximum;
    _rootFinder = new BroydenVectorRootFinder(_toleranceAbs, _toleranceRel, _stepMaximum, DecompositionFactory.getDecomposition(DecompositionFactory.SV_COLT_NAME));
    // TODO: make the root finder flexible.
  }
View Full Code Here

   */
  public MulticurveDiscountBuildingRepository(final double toleranceAbs, final double toleranceRel, final int stepMaximum) {
    _toleranceAbs = toleranceAbs;
    _toleranceRel = toleranceRel;
    _stepMaximum = stepMaximum;
    _rootFinder = new BroydenVectorRootFinder(_toleranceAbs, _toleranceRel, _stepMaximum, DecompositionFactory.getDecomposition(DecompositionFactory.SV_COLT_NAME));
    // TODO: make the root finder flexible.
    // TODO: create a way to select the SensitivityMatrixMulticurve calculator (with underlying curve or not)
  }
View Full Code Here

    } else {
      //impose a global beta on the remaining 3 point fits
      final double[] gFitParms = gRes.getModelParameters().getData();
      final double beta = gFitParms[1];
      start = new DoubleMatrix1D(gFitParms[0], gFitParms[2], gFitParms[3]);
      final BroydenVectorRootFinder rootFinder = new BroydenVectorRootFinder();

      double[] tStrikes = new double[3];
      double[] tVols = new double[3];

      for (int i = 0; i < n - 2; i++) {
        tStrikes = Arrays.copyOfRange(strikes, i, i + 3);
        tVols = Arrays.copyOfRange(impliedVols, i, i + 3);
        final Function1D<DoubleMatrix1D, DoubleMatrix1D> func = getVolDiffFunc(forward, tStrikes, expiry, tVols);
        final Function1D<DoubleMatrix1D, DoubleMatrix2D> jac = getVolJacFunc(forward, tStrikes, expiry, beta);
        final NonLinearTransformFunction tf = new NonLinearTransformFunction(func, jac, TRANSFORM);
        final DoubleMatrix1D res = rootFinder.getRoot(tf.getFittingFunction(), tf.getFittingJacobian(), start);
        final double[] root = TRANSFORM.inverseTransform(res).getData();
        modelParams[i] = new SABRFormulaData(new double[] {root[0], beta, root[1], root[2] });
      }
    }
View Full Code Here

   */
  public HullWhiteProviderDiscountBuildingRepository(final double toleranceAbs, final double toleranceRel, final int stepMaximum) {
    _toleranceAbs = toleranceAbs;
    _toleranceRel = toleranceRel;
    _stepMaximum = stepMaximum;
    _rootFinder = new BroydenVectorRootFinder(_toleranceAbs, _toleranceRel, _stepMaximum, DecompositionFactory.getDecomposition(DecompositionFactory.SV_COLT_NAME));
    // TODO: make the root finder flexible.
  }
View Full Code Here

   */
  public InflationDiscountBuildingRepository(final double toleranceAbs, final double toleranceRel, final int stepMaximum) {
    _toleranceAbs = toleranceAbs;
    _toleranceRel = toleranceRel;
    _stepMaximum = stepMaximum;
    _rootFinder = new BroydenVectorRootFinder(_toleranceAbs, _toleranceRel, _stepMaximum, DecompositionFactory.getDecomposition(DecompositionFactory.SV_COLT_NAME));
    // TODO: make the root finder flexible.
    // TODO: create a way to select the SensitivityMatrixMulticurve calculator (with underlying curve or not)
  }
View Full Code Here

   */
  public IssuerDiscountBuildingRepository(final double toleranceAbs, final double toleranceRel, final int stepMaximum) {
    _toleranceAbs = toleranceAbs;
    _toleranceRel = toleranceRel;
    _stepMaximum = stepMaximum;
    _rootFinder = new BroydenVectorRootFinder(_toleranceAbs, _toleranceRel, _stepMaximum, DecompositionFactory.getDecomposition(DecompositionFactory.SV_COLT_NAME));
    // TODO: make the root finder flexible.
    // TODO: create a way to select the SensitivityMatrixMulticurve calculator (with underlying curve or not)
  }
View Full Code Here

  }

  @Test
  public void testOnSmileySurface() {
    final double forward = FORWARD_CURVE.getForward(expiry5);
    final VectorRootFinder testSolver = new BroydenVectorRootFinder(1.0e-6, 1.0e-6, 50000);
    final double vol1 = STRIKE_VOLSURFACE.getVolatility(expiry5, 40);
    final double vol2 = STRIKE_VOLSURFACE.getVolatility(expiry5, 41);
    final DisplacedDiffusionModel logBlack = new DisplacedDiffusionModel(forward, expiry5, 40, vol1, 41, vol2, 0.26, 0.01, testSolver);

    //TODO really - more magic numbers
View Full Code Here

        continue;
      }
      try {
        final MultipleYieldCurveFinderDataBundle data = new MultipleYieldCurveFinderDataBundle(derivatives, marketValues.toDoubleArray(), knownCurves, curveNodes, interpolators, useFiniteDifference,
            new FXMatrix(currency));
        final NewtonVectorRootFinder rootFinder = new BroydenVectorRootFinder(absoluteTolerance, relativeTolerance, iterations, decomposition);
        final Function1D<DoubleMatrix1D, DoubleMatrix1D> curveCalculator = new MultipleYieldCurveFinderFunction(data, PAR_SPREAD_RATE_CALCULATOR);
        final Function1D<DoubleMatrix1D, DoubleMatrix2D> jacobianCalculator = new MultipleYieldCurveFinderIRSJacobian(data, PAR_SPREAD_RATE_SENSITIVITY_CALCULATOR);
        final double[] fittedYields = rootFinder.getRoot(curveCalculator, jacobianCalculator, new DoubleMatrix1D(initialRatesGuess.toDoubleArray())).getData();
        final DoubleMatrix2D jacobianMatrix = jacobianCalculator.evaluate(new DoubleMatrix1D(fittedYields));
        int i = 0;
        for (final String curveName : curveNames) {
          final Integer offset = nodesPerCurve.get(curveName);
          if (offset == null) {
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.math.rootfinding.newton.BroydenVectorRootFinder

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.