Examples of SABRTermStructureParameters


Examples of com.opengamma.analytics.financial.model.volatility.SABRTermStructureParameters

   * @return a VolatilityModel1D (SABRTermStructureParameters)
   */
  @Override
  public VolatilityModel1D evaluate(final DoubleMatrix1D x) {
    final LinkedHashMap<String, InterpolatedDoublesCurve> curves = getCurves(x);
    return new SABRTermStructureParameters(curves.get(ALPHA), curves.get(BETA), curves.get(RHO), curves.get(NU));
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.model.volatility.SABRTermStructureParameters

    //TODO make this general - not SABR specific
    final Curve<Double, Double> cAlpha = curves.get(ALPHA);
    final Curve<Double, Double> cBeta = curves.get(BETA);
    final Curve<Double, Double> cRho = curves.get(RHO);
    final Curve<Double, Double> cNu = curves.get(NU);
    final VolatilityModel1D volModel = new SABRTermStructureParameters(cAlpha, cBeta, cRho, cNu);

    final int nCaps = _capPricers.size();
    final int m = x.getNumberOfElements();
    final double[][] jac = new double[nCaps][m];
    double f, k, t;
View Full Code Here

Examples of com.opengamma.analytics.financial.model.volatility.SABRTermStructureParameters

    final LeastSquareResults lsRes = ls.solve(new DoubleMatrix1D(MARKET_VOLS), new DoubleMatrix1D(SIGMA), func, jac, vStart);

    System.out.println("CapletStrippingMarketDataTest");
    System.out.println("chi2: " + lsRes.getChiSq() + "\n");

    final SABRTermStructureParameters sabrTS = (SABRTermStructureParameters) VOL_MODEL_PROVIDER.evaluate(lsRes.getFitParameters());
    // print the SABR curves
    final int nPoints = 101;
    System.out.println("t\talpha\tbeta\trho\tnu");
    for (int i = 0; i < nPoints; i++) {
      final double t = i * 10.0 / (nPoints - 1);
      System.out.println(t + "\t" + sabrTS.getAlpha(t) + "\t" + sabrTS.getBeta(t) + "\t" + sabrTS.getRho(t) + "\t" + sabrTS.getNu(t));
    }
    System.out.print("\n");

    // print the smile
    final int nStrikes = 21;
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.