Package com.opengamma.analytics.financial.interestrate

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


    final InterestRateCurveSensitivity result = new InterestRateCurveSensitivity(resultMapCredit);
    final Map<String, List<DoublesPair>> resultMapDsc = new HashMap<>();
    final List<DoublesPair> listDsc = new ArrayList<>();
    listDsc.add(new DoublesPair(bill.getBillPurchased().getSettlementTime(), -bill.getBillPurchased().getSettlementTime() * dfDscSettle * dfDscSettleBar));
    resultMapDsc.put(bill.getBillPurchased().getDiscountingCurveName(), listDsc);
    return result.plus(new InterestRateCurveSensitivity(resultMapDsc));
  }

  /**
   * The par spread for which the present value of the bill transaction is 0. If that spread was added to the transaction yield, the new transaction would have a present value of 0.
   * @param bill The bill transaction.
View Full Code Here


    final InterestRateCurveSensitivity result = new InterestRateCurveSensitivity(resultMapCredit);
    final Map<String, List<DoublesPair>> resultMapDsc = new HashMap<>();
    final List<DoublesPair> listDsc = new ArrayList<>();
    listDsc.add(new DoublesPair(bill.getBillPurchased().getSettlementTime(), -bill.getBillPurchased().getSettlementTime() * dfDscSettle * dfDscSettleBar));
    resultMapDsc.put(bill.getBillPurchased().getDiscountingCurveName(), listDsc);
    return result.plus(new InterestRateCurveSensitivity(resultMapDsc));
  }

}
View Full Code Here

      final SABRExtrapolationRightFunction sabrExtrapolation = new SABRExtrapolationRightFunction(forward, sabrParam, _cutOffStrike, cap.getFixingTime(), _mu);
      bsPrice = sabrExtrapolation.price(option);
      bsDforward = sabrExtrapolation.priceDerivativeForward(option);
    }
    result = result.multipliedBy(bsPrice);
    result = result.plus(forwardDr.multipliedBy(bsDforward));
    result = result.multipliedBy(cap.getNotional() * cap.getPaymentYearFraction());
    return result;
  }

  /**
 
View Full Code Here

    final double paymentDiscountFactor = fundingCurve.getDiscountFactor(paymentTime);
    final ParRateCurveSensitivityCalculator parRateSensCal = ParRateCurveSensitivityCalculator.getInstance();
    final InterestRateCurveSensitivity swapRateSens = new InterestRateCurveSensitivity(cmsCoupon.getUnderlyingSwap().accept(parRateSensCal, curves));
    final InterestRateCurveSensitivity payDFSens = new InterestRateCurveSensitivity(PresentValueCurveSensitivityCalculator.discountFactorSensitivity(fundingCurveName, fundingCurve, paymentTime));
    InterestRateCurveSensitivity result = swapRateSens.multipliedBy(paymentDiscountFactor);
    result = result.plus(payDFSens.multipliedBy(swapRate));
    result = result.multipliedBy(cmsCoupon.getNotional() * cmsCoupon.getPaymentYearFraction());
    return result;
  }
}
View Full Code Here

    InterestRateCurveSensitivity result = new InterestRateCurveSensitivity(resultForeignMap);
    final List<DoublesPair> listDomestic = new ArrayList<>();
    listDomestic.add(new DoublesPair(payTime, rDomesticBar));
    final Map<String, List<DoublesPair>> resultDomesticMap = new HashMap<>();
    resultDomesticMap.put(domesticCurveName, listDomestic);
    result = result.plus(new InterestRateCurveSensitivity(resultDomesticMap));
    return MultipleCurrencyInterestRateCurveSensitivity.of(optionForex.getUnderlyingOption().getUnderlyingForex().getCurrency2(), result);
  }

  /**
   * Present value curve sensitivity with a generic instrument as argument.
View Full Code Here

    list.add(new DoublesPair(cap.getPaymentTime(), dfDr));
    final Map<String, List<DoublesPair>> resultMap = new HashMap<>();
    resultMap.put(cap.getFundingCurveName(), list);
    InterestRateCurveSensitivity result = new InterestRateCurveSensitivity(resultMap);
    result = result.multipliedBy(bsAdjoint[0]);
    result = result.plus(forwardDr.multipliedBy(df * (bsAdjoint[1] + bsAdjoint[2] * volatilityAdjoint[1])));
    result = result.multipliedBy(cap.getNotional() * cap.getPaymentYearFraction());
    return result;
  }

  /**
 
View Full Code Here

    InterestRateCurveSensitivity result = new InterestRateCurveSensitivity(resultForeignMap);
    final List<DoublesPair> listDomestic = new ArrayList<>();
    listDomestic.add(new DoublesPair(payTime, rDomesticBar));
    final Map<String, List<DoublesPair>> resultDomesticMap = new HashMap<>();
    resultDomesticMap.put(domesticCurveName, listDomestic);
    result = result.plus(new InterestRateCurveSensitivity(resultDomesticMap));
    return MultipleCurrencyInterestRateCurveSensitivity.of(domesticCcy, result);
  }

  /**
   * Present value curve sensitivity with a generic instrument as argument.
View Full Code Here

    final Map<String, List<DoublesPair>> resultMapForward = new HashMap<>();
    final List<DoublesPair> listForward = new ArrayList<>();
    listForward.add(new DoublesPair(fra.getFixingPeriodStartTime(), -fra.getFixingPeriodStartTime() * dfForwardStart * dfForwardStartBar));
    listForward.add(new DoublesPair(fra.getFixingPeriodEndTime(), -fra.getFixingPeriodEndTime() * dfForwardEnd * dfForwardEndBar));
    resultMapForward.put(fra.getForwardCurveName(), listForward);
    return result.plus(new InterestRateCurveSensitivity(resultMapForward));
  }

  /**
   * Compute the par rate or forward rate of the FRA.
   * @param fra The FRA.
View Full Code Here

    final double dfForwardT0Bar = deltaP / deltaF * dfPay * omega / dfForwardT1 * n0 * cap.getNotional() * pvBar;
    final double dfPayBar = deltaP / deltaF * omega * (dfForwardT0 / dfForwardT1 * n0 - (1.0 + deltaF * k) * n1) * cap.getNotional() * pvBar;
    InterestRateCurveSensitivity result = new InterestRateCurveSensitivity();
    final List<DoublesPair> listDiscounting = new ArrayList<>();
    listDiscounting.add(new DoublesPair(cap.getPaymentTime(), -cap.getPaymentTime() * dfPay * dfPayBar));
    result = result.plus(cap.getFundingCurveName(), listDiscounting);
    final List<DoublesPair> listForward = new ArrayList<>();
    listForward.add(new DoublesPair(cap.getFixingPeriodStartTime(), -cap.getFixingPeriodStartTime() * dfForwardT0 * dfForwardT0Bar));
    listForward.add(new DoublesPair(cap.getFixingPeriodEndTime(), -cap.getFixingPeriodEndTime() * dfForwardT1 * dfForwardT1Bar));
    result = result.plus(cap.getForwardCurveName(), listForward);
    return result;
View Full Code Here

    listDiscounting.add(new DoublesPair(cap.getPaymentTime(), -cap.getPaymentTime() * dfPay * dfPayBar));
    result = result.plus(cap.getFundingCurveName(), listDiscounting);
    final List<DoublesPair> listForward = new ArrayList<>();
    listForward.add(new DoublesPair(cap.getFixingPeriodStartTime(), -cap.getFixingPeriodStartTime() * dfForwardT0 * dfForwardT0Bar));
    listForward.add(new DoublesPair(cap.getFixingPeriodEndTime(), -cap.getFixingPeriodEndTime() * dfForwardT1 * dfForwardT1Bar));
    result = result.plus(cap.getForwardCurveName(), listForward);
    return result;
  }

  /**
   * Computes the present value Hull-White parameters sensitivity of a cap/floor in the Hull-White one factor model.
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.