Package com.opengamma.analytics.financial.model.interestrate.curve

Examples of com.opengamma.analytics.financial.model.interestrate.curve.PriceIndexCurve


  }

  @Override
  public PriceIndexCurve generateCurve(String name, double[] parameters) {
    ArgumentChecker.isTrue(parameters.length == 1, "Constant curve should have one parameter");
    return new PriceIndexCurve(new ConstantDoublesCurve(parameters[0], name));
  }
View Full Code Here


  }

  @Override
  public PriceIndexCurve generateCurve(String name, InflationProviderInterface inflation, double[] parameters) {
    if (inflation instanceof InflationProviderDiscount) { // TODO: improve the way the curves are generated
      PriceIndexCurve existingCurve = ((InflationProviderDiscount) inflation).getCurve(_existingCurveName);
      PriceIndexCurve newCurve = _generator.generateCurve(name + "-0", inflation, parameters);
      return new PriceIndexCurveAddPriceIndexSpreadCurve(name, _substract, existingCurve, newCurve);

    }
    throw new UnsupportedOperationException("Cannot generate curves for a GeneratorCurveAddYieldExisiting");
  }
View Full Code Here

    return _generator.getNumberOfParameter();
  }

  @Override
  public PriceIndexCurve generateCurve(final String name, final double[] parameters) {
    final PriceIndexCurve newCurve = _generator.generateCurve(name, parameters);
    return new PriceIndexCurve(SpreadDoublesCurve.from(new AddCurveSpreadFunction(), name, newCurve.getCurve(), _seasonalCurve));
  }
View Full Code Here

    return new PriceIndexCurve(SpreadDoublesCurve.from(new AddCurveSpreadFunction(), name, newCurve.getCurve(), _seasonalCurve));
  }

  @Override
  public PriceIndexCurve generateCurve(final String name, final InflationProviderInterface inflation, final double[] parameters) {
    final PriceIndexCurve newCurve = _generator.generateCurve(name, inflation, parameters);
    return new PriceIndexCurveAddSeasonalCurve(name, newCurve, _seasonalCurve);
  }
View Full Code Here

  }

  @Override
  public PriceIndexCurve generateCurve(String name, double[] parameters) {
    ArgumentChecker.isTrue(parameters.length == _nbPoints, "Incorrect dimension for the price indices");
    return new PriceIndexCurve(new InterpolatedDoublesCurve(_nodePoints, parameters, _interpolator, true, name));
  }
View Full Code Here

    }

    // Inflation
    final Set<IndexPrice> indexPrice = multicurve.getPriceIndexes();
    for (final IndexPrice index : indexPrice) {
      final PriceIndexCurve curve = multicurve.getCurve(index);
      final PriceIndexCurve curveIndex = curve;
      ArgumentChecker.isTrue(curveIndex.getCurve() instanceof InterpolatedDoublesCurve, "Yield curve should be based on InterpolatedDoublesCurve");
      final InterpolatedDoublesCurve curveInt = (InterpolatedDoublesCurve) curveIndex.getCurve();
      final int nbNodePoint = curveInt.getXDataAsPrimitive().length;
      final double[][] sensitivity = new double[nbCcy][nbNodePoint];
      for (int loopnode = 0; loopnode < nbNodePoint; loopnode++) {
        final double[] yieldBumped = curveInt.getYDataAsPrimitive().clone();
        yieldBumped[loopnode] += _shift;
        final PriceIndexCurve dscBumped = new PriceIndexCurve(new InterpolatedDoublesCurve(curveInt.getXDataAsPrimitive(), yieldBumped, curveInt.getInterpolator(), true));
        final InflationProviderDiscount marketDscBumped = multicurve.withPriceIndex(index, dscBumped);
        final MultipleCurrencyAmount pvBumped = instrument.accept(_valueCalculator, marketDscBumped);
        final MultipleCurrencyAmount pvDiff = pvBumped.plus(pvInitMinus);
        for (int loopccypv = 0; loopccypv < nbCcy; loopccypv++) {
          sensitivity[loopccypv][loopnode] = pvDiff.getAmount(ccyList.get(loopccypv)) / _shift;
View Full Code Here

    _priceIndexCurves.put(index, curve);
  }

  @Override
  public Integer getNumberOfParameters(final String name) {
    final PriceIndexCurve inflationCurve = _allCurves.get(name);
    final YieldAndDiscountCurve curve = _multicurveProvider.getCurve(name);
    if (inflationCurve != null) {
      return inflationCurve.getNumberOfParameters();
    } else if (curve != null) {
      return curve.getNumberOfParameters();
    }
    throw new UnsupportedOperationException("Cannot return the number of parameter for a null curve");
  }
View Full Code Here

    return new InflationProviderDiscount(decoratedMulticurve, _priceIndexCurves);
  }

  @Override
  public double[] parameterInflationSensitivity(final String name, final List<DoublesPair> pointSensitivity) {
    final PriceIndexCurve curve = _allCurves.get(name);
    final int nbParameters = curve.getNumberOfParameters();
    final double[] result = new double[nbParameters];
    if (pointSensitivity != null && pointSensitivity.size() > 0) {
      for (final DoublesPair timeAndS : pointSensitivity) {
        final double[] sensi1Point = curve.getPriceIndexParameterSensitivity(timeAndS.getFirst());
        for (int loopparam = 0; loopparam < nbParameters; loopparam++) {
          result[loopparam] += timeAndS.getSecond() * sensi1Point[loopparam];
        }
      }
    }
View Full Code Here

    }

    // Inflation
    final Set<IndexPrice> indexPrice = black.getInflationProvider().getPriceIndexes();
    for (final IndexPrice index : indexPrice) {
      final PriceIndexCurve curveIndex = black.getInflationProvider().getCurve(index);

      ArgumentChecker.isTrue(curveIndex.getCurve() instanceof InterpolatedDoublesCurve, "Yield curve should be based on InterpolatedDoublesCurve");
      final InterpolatedDoublesCurve curveInt = (InterpolatedDoublesCurve) curveIndex.getCurve();
      final int nbNodePoint = curveInt.getXDataAsPrimitive().length;
      final double[][] sensitivity = new double[nbCcy][nbNodePoint];
      for (int loopnode = 0; loopnode < nbNodePoint; loopnode++) {
        final double[] yieldBumped = curveInt.getYDataAsPrimitive().clone();
        yieldBumped[loopnode] += _shift;
        final PriceIndexCurve dscBumped = new PriceIndexCurve(new InterpolatedDoublesCurve(curveInt.getXDataAsPrimitive(), yieldBumped, curveInt.getInterpolator(), true));
        final BlackSmileCapInflationZeroCouponProviderDiscount marketDscBumped = new BlackSmileCapInflationZeroCouponProviderDiscount(black.getInflationProvider().withPriceIndex(index, dscBumped),
            black.getBlackParameters());
        final MultipleCurrencyAmount pvBumped = instrument.accept(_valueCalculator, marketDscBumped);
        final MultipleCurrencyAmount pvDiff = pvBumped.plus(pvInitMinus);
        for (int loopccypv = 0; loopccypv < nbCcy; loopccypv++) {
View Full Code Here

    }

    // Inflation
    final Set<IndexPrice> indexPrice = black.getInflationProvider().getPriceIndexes();
    for (final IndexPrice index : indexPrice) {
      final PriceIndexCurve curveIndex = black.getInflationProvider().getCurve(index);

      ArgumentChecker.isTrue(curveIndex.getCurve() instanceof InterpolatedDoublesCurve, "Yield curve should be based on InterpolatedDoublesCurve");
      final InterpolatedDoublesCurve curveInt = (InterpolatedDoublesCurve) curveIndex.getCurve();
      final int nbNodePoint = curveInt.getXDataAsPrimitive().length;
      final double[][] sensitivity = new double[nbCcy][nbNodePoint];
      for (int loopnode = 0; loopnode < nbNodePoint; loopnode++) {
        final double[] yieldBumped = curveInt.getYDataAsPrimitive().clone();
        yieldBumped[loopnode] += _shift;
        final PriceIndexCurve dscBumped = new PriceIndexCurve(new InterpolatedDoublesCurve(curveInt.getXDataAsPrimitive(), yieldBumped, curveInt.getInterpolator(), true));
        final BlackSmileCapInflationYearOnYearProviderDiscount marketDscBumped = new BlackSmileCapInflationYearOnYearProviderDiscount(black.getInflationProvider().withPriceIndex(index, dscBumped),
            black.getBlackParameters());
        final MultipleCurrencyAmount pvBumped = instrument.accept(_valueCalculator, marketDscBumped);
        final MultipleCurrencyAmount pvDiff = pvBumped.plus(pvInitMinus);
        for (int loopccypv = 0; loopccypv < nbCcy; loopccypv++) {
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.financial.model.interestrate.curve.PriceIndexCurve

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.