Examples of NewtonRaphsonSingleRootFinder


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

          final double delta = black.computeForwardDelta();
          return delta - fwdDelta * (forCall ? 1.0 : -1.0); // TODO Case : confirm this is sufficient for calls and puts
        }
      };

      final NewtonRaphsonSingleRootFinder rootFinder = new NewtonRaphsonSingleRootFinder();
      if ((forCall && fwdDelta >= 0.5) || (!forCall && fwdDelta <= 0.5)) {
        // Strike is bounded below by 0 and above by the atmDelta
        final double atmDelta = _forward * Math.exp(0.5 * _lognormalVol * _lognormalVol * _expiry);
        return rootFinder.getRoot(difference, 0.0, atmDelta);
      } // Give it a guess, and estimate finite-difference derivative
      return rootFinder.getRoot(difference, _strike);

    } catch (final com.opengamma.analytics.math.MathException e) {
      System.err.println(e);
      System.err.println("Failed to compute ImpliedVolatility");
      return null;
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.