Package com.opengamma.analytics.financial.interestrate

Examples of com.opengamma.analytics.financial.interestrate.InterestRateCurveSensitivity.multipliedBy()


    final double priceBar = 1.0;
    final double volatilityBar = priceAdjoint[2] * priceBar;
    final double forwardBar = priceAdjoint[1] * priceBar + volatilityAdjoint[1] * volatilityBar;
    final double priceFutureBar = -forwardBar;
    final InterestRateCurveSensitivity priceFutureDerivative = METHOD_FUTURE.priceCurveSensitivity(security.getUnderlyingFuture(), sabrData);
    return priceFutureDerivative.multipliedBy(priceFutureBar);
  }

  @Override
  public InterestRateCurveSensitivity priceCurveSensitivity(final InterestRateFutureOptionMarginSecurity security, final YieldCurveBundle curves) {
    ArgumentChecker.isTrue(curves instanceof SABRInterestRateDataBundle, "Yield curve bundle should contain SABR parameters");
View Full Code Here


   */
  public InterestRateCurveSensitivity deltaWrtCurve(final InterestRateFutureOptionMarginTransaction transaction, final YieldCurveWithBlackCubeBundle blackData) {
    final InterestRateCurveSensitivity securityDelta = SECURITY_METHOD.priceCurveSensitivity(transaction.getUnderlyingOption(), blackData);
    final double scaleFactor = transaction.getQuantity() * transaction.getUnderlyingOption().getUnderlyingFuture().getNotional()
        * transaction.getUnderlyingOption().getUnderlyingFuture().getPaymentAccrualFactor();
    return securityDelta.multipliedBy(scaleFactor);
  }

  /**
   * Computes the present value gamma of a transaction.
   * This is with respect to eithe futures price, or rate=1-price
View Full Code Here

    final SABRExtrapolationRightFunction sabrExtrapolation = new SABRExtrapolationRightFunction(forwardModified, sabrParam, _cutOffStrike, swaption.getTimeToExpiry(), _mu);
    InterestRateCurveSensitivity result = pvbpModifiedDr.multipliedBy(sabrExtrapolation.price(option));
    final double priceDF = sabrExtrapolation.priceDerivativeForward(option);
    result = result.plus(forwardModifiedDr.multipliedBy(pvbpModified * priceDF));
    if (!swaption.isLong()) {
      result = result.multipliedBy(-1);
    }
    return result;
  }

  /**
 
View Full Code Here

    final BlackFunctionData dataBlack = new BlackFunctionData(forwardModified, 1.0, volatilityAdjoint[0]);
    final double[] bsAdjoint = blackFunction.getPriceAdjoint(option, dataBlack);
    InterestRateCurveSensitivity result = pvbpModifiedDr.multipliedBy(bsAdjoint[0]);
    result = result.plus(forwardModifiedDr.multipliedBy(pvbpModified * (bsAdjoint[1] + bsAdjoint[2] * volatilityAdjoint[1])));
    if (!swaption.isLong()) {
      result = result.multipliedBy(-1);
    }
    return result;
  }

  /**
 
View Full Code Here

    InterestRateCurveSensitivity sensitivity = new InterestRateCurveSensitivity(pvsDF);
    final Map<Double, InterestRateCurveSensitivity> cfeCurveSensi = swaption.getUnderlyingSwap().accept(CFECSC, lmmBundle);
    for (int loopcf = 0; loopcf < cfe.getNumberOfPayments(); loopcf++) {
      final InterestRateCurveSensitivity sensiCfe = cfeCurveSensi.get(cfe.getNthPayment(loopcf).getPaymentTime());
      if (!(sensiCfe == null)) { // There is some sensitivity to that cfe.
        sensitivity = sensitivity.plus(sensiCfe.multipliedBy(-multFact * cfaInitBar[loopcf]));
      }
    }
    return sensitivity;
  }

View Full Code Here

    InterestRateCurveSensitivity sensitivity = new InterestRateCurveSensitivity(pvsDF);
    final Map<Double, InterestRateCurveSensitivity> cfeCurveSensi = futures.getUnderlyingSwap().accept(CFECSC, curves);
    for (int loopcf = 0; loopcf < cfe.getNumberOfPayments(); loopcf++) {
      final InterestRateCurveSensitivity sensiCfe = cfeCurveSensi.get(cfe.getNthPayment(loopcf).getPaymentTime());
      if (!(sensiCfe == null)) { // There is some sensitivity to that cfe.
        sensitivity = sensitivity.plus(sensiCfe.multipliedBy(cfeAmountBar[loopcf]));
      }
    }
    return sensitivity;
  }
View Full Code Here

    final BlackFunctionData dataBlack = new BlackFunctionData(forwardModified, 1.0, volatility);
    final double[] bsAdjoint = blackFunction.getPriceAdjoint(option, dataBlack);
    InterestRateCurveSensitivity result = pvbpModifiedDr.multipliedBy(bsAdjoint[0]);
    result = result.plus(forwardModifiedDr.multipliedBy(pvbpModified * bsAdjoint[1]));
    if (!swaption.isLong()) {
      result = result.multipliedBy(-1);
    }
    return result;
  }

  /**
 
View Full Code Here

    InterestRateCurveSensitivity sensitivity = new InterestRateCurveSensitivity(pvsDF);
    final Map<Double, InterestRateCurveSensitivity> cfeIborCurveSensi = swaption.getUnderlyingSwap().getSecondLeg().accept(CFECSC, hwData);
    for (int loopcf = 0; loopcf < cfeIbor.getNumberOfPayments(); loopcf++) {
      final InterestRateCurveSensitivity sensiCfe = cfeIborCurveSensi.get(cfeIbor.getNthPayment(loopcf).getPaymentTime());
      if (!(sensiCfe == null)) { // There is some sensitivity to that cfe.
        sensitivity = sensitivity.plus(sensiCfe.multipliedBy(cfeAmountIborBar[loopcf]));
      }
    }
    return sensitivity;
  }
View Full Code Here

    final Map<String, List<DoublesPair>> resultMap = new HashMap<>();
    resultMap.put(annuityFixed.getNthPayment(0).getFundingCurveName(), list);
    InterestRateCurveSensitivity result = new InterestRateCurveSensitivity(resultMap);
    result = result.plus(forwardDr.multipliedBy(discountFactorSettle * (pvbpDf * bsAdjoint[0] + pvbp * (bsAdjoint[1] + bsAdjoint[2] * volatilityAdjoint[1]))));
    if (!swaption.isLong()) {
      result = result.multipliedBy(-1);
    }
    return result;
  }

  /**
 
View Full Code Here

    InterestRateCurveSensitivity sensitivity = new InterestRateCurveSensitivity(pvsDF);
    final Map<Double, InterestRateCurveSensitivity> cfeCurveSensi = swaption.getUnderlyingSwap().accept(CFECSC, hwData);
    for (int loopcf = 0; loopcf < cfe.getNumberOfPayments(); loopcf++) {
      final InterestRateCurveSensitivity sensiCfe = cfeCurveSensi.get(cfe.getNthPayment(loopcf).getPaymentTime());
      if (!(sensiCfe == null)) { // There is some sensitivity to that cfe.
        sensitivity = sensitivity.plus(sensiCfe.multipliedBy(cfeAmountBar[loopcf]));
      }
    }
    return sensitivity;
  }
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.