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

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


   * Create a new sensitivity object containing the original sensitivity multiplied by a common factor.
   * @param factor The multiplicative factor.
   * @return The multiplied sensitivity.
   */
  public InflationSensitivity multipliedBy(final double factor) {
    final MulticurveSensitivity resultMulticurve = _multicurveSensitivity.multipliedBy(factor);
    final Map<String, List<DoublesPair>> resultPrice = MulticurveSensitivityUtils.multipliedBy(_sensitivityPriceCurve, factor);
    return new InflationSensitivity(resultMulticurve, resultPrice);
  }
View Full Code Here


  /**
   * Return a new sensitivity by sorting the times and adding the values at duplicated times.
   * @return The cleaned sensitivity.
   */
  public InflationSensitivity cleaned() {
    final MulticurveSensitivity resultMulticurve = _multicurveSensitivity.cleaned();
    final Map<String, List<DoublesPair>> resultPrice = MulticurveSensitivityUtils.cleaned(_sensitivityPriceCurve);
    return new InflationSensitivity(resultMulticurve, resultPrice);
  }
View Full Code Here

    ArgumentChecker.notNull(sabr, "SABR cap provider");
    final MulticurveProviderInterface multicurve = sabr.getMulticurveProvider();
    final EuropeanVanillaOption option = new EuropeanVanillaOption(cap.getStrike(), cap.getFixingTime(), cap.isCap());
    final double forward = multicurve.getForwardRate(cap.getIndex(), cap.getFixingPeriodStartTime(), cap.getFixingPeriodEndTime(), cap.getFixingAccrualFactor());
    final double df = multicurve.getDiscountFactor(cap.getCurrency(), cap.getPaymentTime());
    final MulticurveSensitivity forwardDr = MulticurveSensitivity.ofForward(multicurve.getName(cap.getIndex()),
        new ForwardSensitivity(cap.getFixingPeriodStartTime(), cap.getFixingPeriodEndTime(), cap.getFixingAccrualFactor(), 1.0));
    final double dfDr = -cap.getPaymentTime() * df;
    final double maturity = cap.getFixingPeriodEndTime() - cap.getFixingPeriodStartTime();
    final double[] volatilityAdjoint = sabr.getSABRParameter().getVolatilityAdjoint(cap.getFixingTime(), maturity, cap.getStrike(), forward);
    final BlackFunctionData dataBlack = new BlackFunctionData(forward, 1.0, volatilityAdjoint[0]);
    final double[] bsAdjoint = BLACK_FUNCTION.getPriceAdjoint(option, dataBlack);
    final List<DoublesPair> list = new ArrayList<>();
    list.add(new DoublesPair(cap.getPaymentTime(), dfDr));
    final Map<String, List<DoublesPair>> resultMap = new HashMap<>();
    resultMap.put(multicurve.getName(cap.getCurrency()), list);
    MulticurveSensitivity result = MulticurveSensitivity.ofYieldDiscounting(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 MultipleCurrencyMulticurveSensitivity.of(cap.getCurrency(), result);
  }
View Full Code Here

   * @param priceSensitivity The sensitivity of the futures price.
   * @return The present value rate sensitivity.
   */
  public MultipleCurrencyMulticurveSensitivity presentValueCurveSensitivity(final SwapFuturesPriceDeliverableTransaction futures, final MulticurveSensitivity priceSensitivity) {
    Validate.notNull(futures, "Future");
    MulticurveSensitivity result = priceSensitivity.multipliedBy(futures.getUnderlying().getNotional() * futures.getQuantity());
    return MultipleCurrencyMulticurveSensitivity.of(futures.getCurrency(), result);
  }
View Full Code Here

          * Math.abs(annuityFixed.getNthPayment(loopcpn).getNotional()));
      list.add(s);
    }
    final Map<String, List<DoublesPair>> mapDsc = new HashMap<>();
    mapDsc.put(multicurves.getName(annuityFixed.getCurrency()), list);
    final MulticurveSensitivity result = MulticurveSensitivity.ofYieldDiscounting(mapDsc);
    return result;
  }
View Full Code Here

          * Math.abs(annuityFixed.getNthPayment(loopcpn).getNotional()));
      list.add(s);
    }
    final Map<String, List<DoublesPair>> mapDsc = new HashMap<>();
    mapDsc.put(multicurves.getName(annuityFixed.getCurrency()), list);
    final MulticurveSensitivity result = MulticurveSensitivity.ofYieldDiscounting(mapDsc);
    return result;
  }
View Full Code Here

    // Backward sweep
    final double[] priceAdjoint = new double[3];
    NORMAL_FUNCTION.getPriceAdjoint(option, normalPoint, priceAdjoint);
    final double priceBar = 1.0;
    final double priceFutureBar = priceAdjoint[0] * priceBar;
    final MulticurveSensitivity priceFutureDerivative = METHOD_FUTURE.priceCurveSensitivity(security.getUnderlyingFuture(), normalData.getMulticurveProvider());
    return priceFutureDerivative.multipliedBy(priceFutureBar);
  }
View Full Code Here

          * Math.abs(annuityFixed.getNthPayment(loopcpn).getNotional()));
      list.add(s);
    }
    final Map<String, List<DoublesPair>> mapDsc = new HashMap<>();
    mapDsc.put(multicurves.getName(annuityFixed.getCurrency()), list);
    final MulticurveSensitivity result = MulticurveSensitivity.ofYieldDiscounting(mapDsc);
    return result;
  }
View Full Code Here

          * Math.abs(annuityFixed.getNthPayment(loopcpn).getNotional()));
      list.add(s);
    }
    final Map<String, List<DoublesPair>> mapDsc = new HashMap<>();
    mapDsc.put(multicurves.getName(annuityFixed.getCurrency()), list);
    final MulticurveSensitivity result = MulticurveSensitivity.ofYieldDiscounting(mapDsc);
    return result;
  }
View Full Code Here

          * Math.abs(annuityFixed.getNthPayment(loopcpn).getNotional()));
      list.add(s);
    }
    final Map<String, List<DoublesPair>> mapDsc = new HashMap<>();
    mapDsc.put(multicurves.getName(annuityFixed.getCurrency()), list);
    final MulticurveSensitivity result = MulticurveSensitivity.ofYieldDiscounting(mapDsc);
    return result;
  }
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.