Package com.opengamma.analytics.financial.provider.sensitivity.multicurve

Examples of com.opengamma.analytics.financial.provider.sensitivity.multicurve.MulticurveSensitivity


   */
  public DoubleMatrix1D calculateSensitivity(final InstrumentDerivative instrument, final HullWhiteOneFactorProviderInterface multicurves, final Set<String> curvesSet) {
    Validate.notNull(instrument, "null InterestRateDerivative");
    Validate.notNull(multicurves, "null multicurve");
    Validate.notNull(curvesSet, "null curves set");
    MulticurveSensitivity sensitivity = instrument.accept(_curveSensitivityCalculator, multicurves);
    sensitivity = sensitivity.cleaned();
    // TODO: for testing purposes mainly. Could be removed after the tests.
    return pointToParameterSensitivity(sensitivity, multicurves, curvesSet);
  }
View Full Code Here


   */
  public DoubleMatrix1D calculateSensitivity(final InstrumentDerivative instrument, final IssuerProviderInterface multicurves, final Set<String> curvesSet) {
    Validate.notNull(instrument, "null InterestRateDerivative");
    Validate.notNull(multicurves, "null multicurve");
    Validate.notNull(curvesSet, "null curves set");
    MulticurveSensitivity sensitivity = instrument.accept(_curveSensitivityCalculator, multicurves);
    sensitivity = sensitivity.cleaned();
    // TODO: for testing purposes mainly. Could be removed after the tests.
    return pointToParameterSensitivity(sensitivity, multicurves, curvesSet);
  }
View Full Code Here

   */
  public MultipleCurrencyMulticurveSensitivity presentValueCurveSensitivity(final BondFutureOptionPremiumTransaction transaction, final BlackBondFuturesSmileProviderInterface black) {
    ArgumentChecker.notNull(transaction, "transaction");
    ArgumentChecker.notNull(black, "Black parameters");
    final MultipleCurrencyMulticurveSensitivity premiumSensitivity = METHOD_PAY_FIXED.presentValueCurveSensitivity(transaction.getPremium(), black.getMulticurveProvider());
    final MulticurveSensitivity securitySensitivity = METHOD_SECURITY.priceCurveSensitivity(transaction.getUnderlyingOption(), black);
    return premiumSensitivity.plus(MultipleCurrencyMulticurveSensitivity.of(transaction.getCurrency(),
        securitySensitivity.multipliedBy(transaction.getQuantity() * transaction.getUnderlyingOption().getUnderlyingFuture().getNotional())));
  }
View Full Code Here

    final double df = multicurves.getDiscountFactor(ccy, bond.getSettlementTime());
    final Map<String, List<DoublesPair>> resultMap = new HashMap<>();
    final List<DoublesPair> listDf = new ArrayList<>();
    listDf.add(new DoublesPair(bond.getSettlementTime(), bond.getSettlementTime() / df));
    resultMap.put(multicurves.getName(ccy), listDf);
    MulticurveSensitivity result = MulticurveSensitivity.ofYieldDiscounting(resultMap);
    result = result.multipliedBy(pv.getAmount(ccy) / notional);
    result = result.plus(sensiPv.getSensitivity(ccy).multipliedBy(1 / (df * notional)));
    return result;
  }
View Full Code Here

   * @param data The curve and Hull-White parameters.
   * @return The present value rate sensitivity.
   */
  public MultipleCurrencyMulticurveSensitivity presentValueCurveSensitivity(final BondFuture future, final HullWhiteIssuerProviderInterface data) {
    Validate.notNull(future, "Future");
    final MulticurveSensitivity priceSensitivity = priceCurveSensitivity(future, data);
    final MultipleCurrencyMulticurveSensitivity transactionSensitivity = MultipleCurrencyMulticurveSensitivity.of(future.getCurrency(), priceSensitivity.multipliedBy(future.getNotional()));
    return transactionSensitivity;
  }
View Full Code Here

    final double dfDscSettleBar = bill.getSettlementAmount() * pvBar;
    final Map<String, List<DoublesPair>> resultMapCredit = new HashMap<>();
    final List<DoublesPair> listCredit = new ArrayList<>();
    listCredit.add(new DoublesPair(bill.getBillPurchased().getEndTime(), -bill.getBillPurchased().getEndTime() * dfCreditEnd * dfCreditEndBar));
    resultMapCredit.put(issuer.getName(issuerCcy), listCredit);
    final MulticurveSensitivity result = MulticurveSensitivity.ofYieldDiscounting(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(issuer.getMulticurveProvider().getName(ccy), listDsc);
    return MultipleCurrencyMulticurveSensitivity.of(ccy, result.plus(MulticurveSensitivity.ofYieldDiscounting(resultMapDsc)));
  }
View Full Code Here

    final double dfCreditEndBar = priceParBar / dfDscSettle;
    final Map<String, List<DoublesPair>> resultMapCredit = new HashMap<>();
    final List<DoublesPair> listCredit = new ArrayList<>();
    listCredit.add(new DoublesPair(bill.getBillPurchased().getEndTime(), -bill.getBillPurchased().getEndTime() * dfCreditEnd * dfCreditEndBar));
    resultMapCredit.put(issuer.getName(issuerCcy), listCredit);
    final MulticurveSensitivity result = MulticurveSensitivity.ofYieldDiscounting(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(issuer.getMulticurveProvider().getName(ccy), listDsc);
    return result.plus(MulticurveSensitivity.ofYieldDiscounting(resultMapDsc));
  }
View Full Code Here

   * @param issuerMulticurves The issuer and multi-curves provider.
   * @return The present value rate sensitivity.
   */
  public MultipleCurrencyMulticurveSensitivity presentValueCurveSensitivity(final BondFuturesTransaction futures, final IssuerProviderInterface issuerMulticurves) {
    Currency ccy = futures.getUnderlyingFuture().getCurrency();
    final MulticurveSensitivity priceSensitivity = METHOD_FUTURES_SEC.priceCurveSensitivity(futures.getUnderlyingFuture(), issuerMulticurves);
    final MultipleCurrencyMulticurveSensitivity transactionSensitivity = MultipleCurrencyMulticurveSensitivity.of(ccy,
        priceSensitivity.multipliedBy(futures.getUnderlyingFuture().getNotional() * futures.getQuantity()));
    return transactionSensitivity;
  }
View Full Code Here

    final Currency ccy = bond.getBondTransaction().getCurrency();
    final PaymentFixed nominalAtSettlement = new PaymentFixed(bond.getBondTransaction().getCurrency(), bond.getBondTransaction().getSettlementTime(), bond.getBondTransaction().getCoupon()
        .getNthPayment(0).getNotional() *
        bond.getQuantity());
    final double pvNominalAtSettlement = nominalAtSettlement.accept(PVDC, issuerMulticurves.getMulticurveProvider()).getAmount(ccy);
    final MulticurveSensitivity pvcsNominalAtSettlement = nominalAtSettlement.accept(PVSDC, issuerMulticurves.getMulticurveProvider()).getSensitivity(ccy);
    final MulticurveSensitivity pvcsBond = presentValueSensitivity(bond, issuerMulticurves).getSensitivity(ccy);
    final double pvBond = presentValue(bond, issuerMulticurves).getAmount(ccy);
    return pvcsBond.multipliedBy(-1 / pvNominalAtSettlement).plus(pvcsNominalAtSettlement.multipliedBy(pvBond / (pvNominalAtSettlement * pvNominalAtSettlement)));
  }
View Full Code Here

    final Currency ccy = bond.getBondTransaction().getCurrency();
    final PaymentFixed nominalAtSettlement = new PaymentFixed(bond.getBondTransaction().getCurrency(), bond.getBondTransaction().getSettlementTime(), bond.getBondTransaction().getCoupon()
        .getNthPayment(0).getNotional() *
        bond.getQuantity());
    final double pvNominalAtSettlement = nominalAtSettlement.accept(PVDC, issuerMulticurves.getMulticurveProvider()).getAmount(ccy);
    final MulticurveSensitivity pvcsNominalAtSettlement = nominalAtSettlement.accept(PVSDC, issuerMulticurves.getMulticurveProvider()).getSensitivity(ccy);
    final MulticurveSensitivity pvcsBond = presentValueSensitivity(bond, issuerMulticurves).getSensitivity(ccy);
    final double pvBond = presentValue(bond, issuerMulticurves).getAmount(ccy);
    return pvcsBond.multipliedBy(-1 / pvNominalAtSettlement).plus(pvcsNominalAtSettlement.multipliedBy(pvBond / (pvNominalAtSettlement * pvNominalAtSettlement)));
  }
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.financial.provider.sensitivity.multicurve.MulticurveSensitivity

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.