Package com.opengamma.analytics.financial.model.volatility

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


    final boolean print = false;
    if (print) {
      System.out.println("CapletStripingTest");
    }

    final VolatilityModel1D volModel = VOL_MODEL_PROVIDER.evaluate(lsRes.getFitParameters());
    final Iterator<CapFloor> iter = CAPS.iterator();

    CapFloor cap;
    int i = 0;
    while (iter.hasNext()) {
View Full Code Here


  }

  @Override
  public VolatilityModel1D evaluate(DoubleMatrix1D x) {
    final InterpolatedDoublesCurve curve = InterpolatedDoublesCurve.from(_knots, x.getData(), _interpolator);
    return new VolatilityModel1D() {

      @Override
      public Double getVolatility(double[] fwdKT) {
        return curve.getYValue(fwdKT[2]);
      }
View Full Code Here

  }

  @Override
  public DoubleMatrix1D evaluate(final DoubleMatrix1D x) {

    final VolatilityModel1D volModel = _volModelProvider.evaluate(x);

    final double[] res = new double[_capPricers.size()];
    for (int i = 0; i < _capPricers.size(); i++) {
      res[i] = _capPricers.get(i).impliedVol(volModel);
    }
View Full Code Here

    //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

    final int start = 1; // miss out first (known) libor rate
    final int end = 5 * 4;

    // VolatilityModel1D volModel = new SABRTermStructureParameters(ConstantDoublesCurve.from(0.3), ConstantDoublesCurve.from(1.0), ConstantDoublesCurve.from(-0.5), ConstantDoublesCurve.from(0.5));
    final double vol = 0.688;
    final VolatilityModel1D volModel = new FlatVolatility(vol);

    CapFloor cap = SimpleCapFloorMaker.makeCap(CUR, INDEX, start, end, "3m Libor", "3m Libor", 0.00928, true);
    CapFloorPricer pricer = new CapFloorPricer(cap, YIELD_CURVES);
    double fwd = pricer.getCapForward();
    final double price = pricer.price(volModel);
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.financial.model.volatility.VolatilityModel1D

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.