Package com.opengamma.analytics.financial.interestrate.annuity.derivative

Examples of com.opengamma.analytics.financial.interestrate.annuity.derivative.AnnuityCouponFixed


        // Implementation note: Ex-dividend period: the next coupon is not received but its date is required for yield calculation
        couponExPeriodArray[0] = new CouponFixedDefinition(couponDefinition.getNthPayment(0), 0.0);
      }
    }
    final AnnuityCouponFixedDefinition couponDefinitionExPeriod = new AnnuityCouponFixedDefinition(couponExPeriodArray, getCalendar());
    final AnnuityCouponFixed couponStandard = couponDefinitionExPeriod.toDerivative(date, yieldCurveNames);
    final AnnuityPaymentFixed nominalStandard = nominal.trimBefore(settleTime);
    final double factorSpot = getDayCount().getAccruedInterest(couponDefinition.getNthPayment(0).getAccrualStartDate(), settlementDate,
        couponDefinition.getNthPayment(0).getAccrualEndDate(), 1.0, _couponPerYear);
    final double factorPeriod = getDayCount().getAccruedInterest(couponDefinition.getNthPayment(0).getAccrualStartDate(),
        couponDefinition.getNthPayment(0).getAccrualEndDate(), couponDefinition.getNthPayment(0).getAccrualEndDate(), 1.0, _couponPerYear);
View Full Code Here


        // Implementation note: Ex-dividend period: the next coupon is not received but its date is required for yield calculation
        couponExPeriodArray[0] = new CouponFixedDefinition(couponDefinition.getNthPayment(0), 0.0);
      }
    }
    final AnnuityCouponFixedDefinition couponDefinitionExPeriod = new AnnuityCouponFixedDefinition(couponExPeriodArray, getCalendar());
    final AnnuityCouponFixed couponStandard = couponDefinitionExPeriod.toDerivative(date);
    final AnnuityPaymentFixed nominalStandard = nominal.trimBefore(settleTime);
    final double factorSpot = getDayCount().getAccruedInterest(couponDefinition.getNthPayment(0).getAccrualStartDate(), settlementDate,
        couponDefinition.getNthPayment(0).getAccrualEndDate(), 1.0, _couponPerYear);
    final double factorPeriod = getDayCount().getAccruedInterest(couponDefinition.getNthPayment(0).getAccrualStartDate(),
        couponDefinition.getNthPayment(0).getAccrualEndDate(), couponDefinition.getNthPayment(0).getAccrualEndDate(), 1.0, _couponPerYear);
View Full Code Here

   * @param fixedCouponSwap The underlying swap.
   * @param discountingCurve The discount curve.
   * @return The physical annuity.
   */
  public double presentValueBasisPoint(final SwapFixedCoupon<? extends Payment> fixedCouponSwap, final YieldAndDiscountCurve discountingCurve) {
    final AnnuityCouponFixed annuityFixed = fixedCouponSwap.getFixedLeg();
    double pvbp = 0;
    for (int loopcpn = 0; loopcpn < annuityFixed.getPayments().length; loopcpn++) {
      pvbp += annuityFixed.getNthPayment(loopcpn).getPaymentYearFraction() * Math.abs(annuityFixed.getNthPayment(loopcpn).getNotional())
          * discountingCurve.getDiscountFactor(annuityFixed.getNthPayment(loopcpn).getPaymentTime());
    }
    return pvbp;
  }
View Full Code Here

   * @param fixedCouponSwap The underlying swap.
   * @param curves The yield curve bundle (containing the appropriate discounting curve).
   * @return The physical annuity.
   */
  public double presentValueBasisPoint(final SwapFixedCoupon<? extends Payment> fixedCouponSwap, final YieldCurveBundle curves) {
    final AnnuityCouponFixed annuityFixed = fixedCouponSwap.getFixedLeg();
    final YieldAndDiscountCurve discountingCurve = curves.getCurve(annuityFixed.getNthPayment(0).getFundingCurveName());
    return presentValueBasisPoint(fixedCouponSwap, discountingCurve);
  }
View Full Code Here

  public double presentValueBasisPoint(final SwapFixedCoupon<? extends Payment> fixedCouponSwap, final DayCount dayCount, final Calendar calendar,
      final YieldAndDiscountCurve discountingCurve) {
    ArgumentChecker.notNull(fixedCouponSwap, "swap");
    ArgumentChecker.notNull(dayCount, "day count");
    ArgumentChecker.notNull(discountingCurve, "discounting curve");
    final AnnuityCouponFixed annuityFixed = fixedCouponSwap.getFixedLeg();
    if (annuityFixed.getNumberOfPayments() == 0) {
      return 0;
    }
    double pvbp = 0;
    for (int loopcpn = 0; loopcpn < annuityFixed.getPayments().length; loopcpn++) {
      pvbp += dayCount.getDayCountFraction(annuityFixed.getNthPayment(loopcpn).getAccrualStartDate(), annuityFixed.getNthPayment(loopcpn).getAccrualEndDate(), calendar)
          * Math.abs(annuityFixed.getNthPayment(loopcpn).getNotional()) * discountingCurve.getDiscountFactor(annuityFixed.getNthPayment(loopcpn).getPaymentTime());
    }
    return pvbp;
  }
View Full Code Here

   */
  public double presentValueBasisPoint(final SwapFixedCoupon<? extends Payment> fixedCouponSwap, final DayCount dayCount, final YieldAndDiscountCurve discountingCurve) {
    ArgumentChecker.notNull(fixedCouponSwap, "swap");
    ArgumentChecker.notNull(dayCount, "day count");
    ArgumentChecker.notNull(discountingCurve, "discounting curve");
    final AnnuityCouponFixed annuityFixed = fixedCouponSwap.getFixedLeg();
    if (annuityFixed.getNumberOfPayments() == 0) {
      return 0;
    }
    double pvbp = 0;
    for (int loopcpn = 0; loopcpn < annuityFixed.getPayments().length; loopcpn++) {
      pvbp += dayCount.getDayCountFraction(annuityFixed.getNthPayment(loopcpn).getAccrualStartDate(), annuityFixed.getNthPayment(loopcpn).getAccrualEndDate())
          * Math.abs(annuityFixed.getNthPayment(loopcpn).getNotional()) * discountingCurve.getDiscountFactor(annuityFixed.getNthPayment(loopcpn).getPaymentTime());
    }
    return pvbp;
  }
View Full Code Here

   * @param curves The yield curve bundle (containing the appropriate discounting curve).
   * @return The physical annuity.
   */
  public double presentValueBasisPoint(final SwapFixedCoupon<? extends Payment> fixedCouponSwap, final DayCount dayCount, final Calendar calendar,
      final YieldCurveBundle curves) {
    final AnnuityCouponFixed annuityFixed = fixedCouponSwap.getFixedLeg();
    final YieldAndDiscountCurve discountingCurve = curves.getCurve(annuityFixed.getNthPayment(0).getFundingCurveName());
    return presentValueBasisPoint(fixedCouponSwap, dayCount, calendar, discountingCurve);
  }
View Full Code Here

   * @param dayCount Day count convention for the PVBP modification.
   * @param curves The yield curve bundle (containing the appropriate discounting curve).
   * @return The physical annuity.
   */
  public double presentValueBasisPoint(final SwapFixedCoupon<? extends Payment> fixedCouponSwap, final DayCount dayCount, final YieldCurveBundle curves) {
    final AnnuityCouponFixed annuityFixed = fixedCouponSwap.getFixedLeg();
    final YieldAndDiscountCurve discountingCurve = curves.getCurve(annuityFixed.getNthPayment(0).getFundingCurveName());
    return presentValueBasisPoint(fixedCouponSwap, dayCount, discountingCurve);
  }
View Full Code Here

   * @param fixedCouponSwap The swap.
   * @param discountingCurve The discounting curve.
   * @return The sensitivity.
   */
  public List<DoublesPair> presentValueBasisPointCurveSensitivity(final SwapFixedCoupon<? extends Payment> fixedCouponSwap, final YieldAndDiscountCurve discountingCurve) {
    final AnnuityCouponFixed annuityFixed = fixedCouponSwap.getFixedLeg();
    double time;
    final List<DoublesPair> list = new ArrayList<>();
    for (int loopcpn = 0; loopcpn < annuityFixed.getPayments().length; loopcpn++) {
      time = annuityFixed.getNthPayment(loopcpn).getPaymentTime();
      final DoublesPair s = new DoublesPair(time, -time * discountingCurve.getDiscountFactor(time) * annuityFixed.getNthPayment(loopcpn).getPaymentYearFraction()
          * Math.abs(annuityFixed.getNthPayment(loopcpn).getNotional()));
      list.add(s);
    }
    return list;
  }
View Full Code Here

   * @param curves The yield curve bundle (containing the appropriate discounting curve).
   * @return The sensitivity.
   */
  public InterestRateCurveSensitivity presentValueBasisPointCurveSensitivity(final SwapFixedCoupon<? extends Payment> fixedCouponSwap, final YieldCurveBundle curves) {
    final Map<String, List<DoublesPair>> result = new HashMap<>();
    final AnnuityCouponFixed annuityFixed = fixedCouponSwap.getFixedLeg();
    final YieldAndDiscountCurve discountingCurve = curves.getCurve(annuityFixed.getNthPayment(0).getFundingCurveName());
    result.put(annuityFixed.getNthPayment(0).getFundingCurveName(), presentValueBasisPointCurveSensitivity(fixedCouponSwap, discountingCurve));
    return new InterestRateCurveSensitivity(result);
  }
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.financial.interestrate.annuity.derivative.AnnuityCouponFixed

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.