Package com.opengamma.analytics.math.rootfinding

Examples of com.opengamma.analytics.math.rootfinding.BrentSingleRootFinder


  private final double _tolerance;
  private final BrentSingleRootFinder _brentRootFinder;
 
  public ISDARootFinder() {
    _tolerance = DEFAULT_TOLERANCE;
    _brentRootFinder = new BrentSingleRootFinder(DEFAULT_TOLERANCE);
  }
View Full Code Here


    _brentRootFinder = new BrentSingleRootFinder(DEFAULT_TOLERANCE);
  }
 
  public ISDARootFinder(final double tolerance) {
    _tolerance = tolerance;
    _brentRootFinder = new BrentSingleRootFinder(tolerance);
  }
View Full Code Here

  }

  // @export "brentSingleRootFinderDemo"
  public static void brentSingleRootFinderDemo(PrintStream out) {
    RealPolynomialFunction1D f = getFunction();
    BrentSingleRootFinder brent = new BrentSingleRootFinder();
    java.lang.Double root = brent.getRoot(f, -10.0, 10.0);
    out.println(root);
  }
View Full Code Here

  }

  // @export "brentSingleRootFinderNotBracketingDemo"
  public static void brentSingleRootFinderNotBracketingDemo(PrintStream out) {
    RealPolynomialFunction1D f = getFunction();
    BrentSingleRootFinder brent = new BrentSingleRootFinder();
    try {
      out.println("Trying to call getRoot with arguments that don't bracket the root...");
      brent.getRoot(f, -1.0, 1.0);
    } catch (java.lang.IllegalArgumentException e) {
      out.println("IllegalArgumentException called");
    }
  }
View Full Code Here

    final CubicRealRootFinder cubic = new CubicRealRootFinder();
    final java.lang.Double[] roots = cubic.getRoots(f);
    out.println(Arrays.toString(roots));

    final BrentSingleRootFinder brent = new BrentSingleRootFinder();
    final java.lang.Double root = brent.getRoot(f, -10.0, 10.0);
    out.println(root);

    try {
      out.println("Trying to call getRoot with arguments that don't bracket the root...");
      brent.getRoot(f, -1.0, 1.0);
    } catch (final java.lang.IllegalArgumentException e) {
      out.println("IllegalArgumentException called");
    }
  }
View Full Code Here

   * @param price The CMS spread price.
   * @return The implied correlation.
   */
  public double impliedCorrelation(final CapFloorCMSSpread cmsSpread, final SABRInterestRateDataBundle sabrData, final double price) {
    final SolveCorrelation function = new SolveCorrelation(cmsSpread, sabrData, price);
    final BrentSingleRootFinder finder = new BrentSingleRootFinder();
    final double correlation = finder.getRoot(function, -0.999, 0.999);
    return correlation;
  }
View Full Code Here

   * @param price The CMS spread price.
   * @return The implied correlation.
   */
  public double impliedCorrelation(final CapFloorCMSSpread cmsSpread, final SABRSwaptionProviderInterface sabrData, final double price) {
    final SolveCorrelation function = new SolveCorrelation(cmsSpread, sabrData, price);
    final BrentSingleRootFinder finder = new BrentSingleRootFinder();
    final double correlation = finder.getRoot(function, -0.999, 0.999);
    return correlation;
  }
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.math.rootfinding.BrentSingleRootFinder

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.