Package com.opengamma.analytics.financial.credit

Examples of com.opengamma.analytics.financial.credit.PriceType


    ArgumentChecker.notNull(yieldCurve, "yieldCurve");
    ArgumentChecker.notNull(bumpType, "bumpType");
    ArgumentChecker.isTrue(Math.abs(fracBumpAmount) > 1e-10, "bump amount too small");
    final int n = marketCDSs.length;
    ArgumentChecker.isTrue(n == marketParSpreads.length, "speads length does not match curvePoints");
    final PriceType priceType = PriceType.DIRTY;

    final ISDACompliantCreditCurve baseCurve = _curveBuilder.calibrateCreditCurve(marketCDSs, marketParSpreads, yieldCurve);
    final double basePrice = _pricer.pv(cds, yieldCurve, baseCurve, cdsCoupon, priceType);

    final double[] res = new double[n];
View Full Code Here


    ArgumentChecker.notNull(yieldCurve, "yieldCurve");
    ArgumentChecker.notNull(bumpType, "bumpType");
    ArgumentChecker.isTrue(Math.abs(fracBumpAmount) > 1e-10, "bump amount too small");
    final int n = marketCDSs.length;
    ArgumentChecker.isTrue(n == quotedSpreads.length, "speads length does not match curvePoints");
    final PriceType priceType = PriceType.DIRTY;
    final double[] premiums = new double[n];
    Arrays.fill(premiums, dealSpread); // assume the premiums of all CDS are equal

    final double[] puf = _pufConverter.quotedSpreadsToPUF(marketCDSs, premiums, yieldCurve, quotedSpreads);
    final ISDACompliantCreditCurve baseCurve = _curveBuilder.calibrateCreditCurve(marketCDSs, premiums, yieldCurve, puf);
View Full Code Here

    ArgumentChecker.notNull(yieldCurve, "yieldCurve");
    ArgumentChecker.notNull(bumpType, "bumpType");
    ArgumentChecker.isTrue(Math.abs(fracBumpAmount) > 1e-10, "bump amount too small");
    final int nMarketCDSs = marketCDSs.length;
    ArgumentChecker.isTrue(nMarketCDSs == quotedSpreads.length, "speads length does not match curvePoints");
    final PriceType priceType = PriceType.DIRTY;
    final double[] premiums = new double[nMarketCDSs];
    Arrays.fill(premiums, dealSpread); // assume the premiums of all CDS are equal

    final int nTradeCDSs = cds.length;
View Full Code Here

  }

  @Test
  public void testCDSTypes() {
    final CreditDefaultSwapDefinition cds = getLegacyVanillaDefinition();
    final PriceType priceType = PriceType.DIRTY;
    final double pv = CALCULATOR.getPresentValue(cds, CURVE_PROVIDER, VALUATION_DATE, priceType);
    assertEquals(pv, CALCULATOR.getPresentValue(getStandardVanillaDefinition(), CURVE_PROVIDER, VALUATION_DATE, priceType));
    assertEquals(pv, CALCULATOR.getPresentValue(getStandardFixedRecoveryDefinition(), CURVE_PROVIDER, VALUATION_DATE, priceType));
    assertEquals(pv, CALCULATOR.getPresentValue(getStandardForwardStartingDefinition(), CURVE_PROVIDER, VALUATION_DATE, priceType));
    assertEquals(pv, CALCULATOR.getPresentValue(getStandardMuniDefinition(), CURVE_PROVIDER, VALUATION_DATE, priceType));
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.financial.credit.PriceType

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.