Package com.opengamma.financial.analytics

Examples of com.opengamma.financial.analytics.TenorLabelledMatrix1D


      final Tenor[] keysArray = new Tenor[matrixSize];
      keys.toArray(keysArray);
      final Object[] labelsArray = new Object[matrixSize];
      labels.toArray(labelsArray);
      final double[] valuesArray = Doubles.toArray(values);
      return new TenorLabelledMatrix1D(keysArray, labelsArray, labelsTitle, valuesArray, valuesTitle);
    }
View Full Code Here


  @Test
  public void testTenor() {
    final Tenor[] tenors = new Tenor[] {Tenor.ONE_DAY, Tenor.ONE_WEEK, Tenor.ONE_MONTH, Tenor.ONE_YEAR};
    final Object[] labels = new Object[] {"P1D", "P7D", "P1M", "P1Y"};
    final double[] values = new double[] {1, 2, 3, 4};
    TenorLabelledMatrix1D matrix = new TenorLabelledMatrix1D(tenors, labels, values);
    assertEquals(matrix, cycleObject(TenorLabelledMatrix1D.class, matrix));
    matrix = new TenorLabelledMatrix1D(tenors, values);
    assertEquals(matrix, cycleObject(TenorLabelledMatrix1D.class, matrix));
  }
View Full Code Here

    final int accruedDays = analytic.getAccuredDays();
    final double quotedSpread = getQuotedSpread(quote, puf, buySellProtection, yieldCurve, analytic).getQuotedSpread();
    final double upfrontAmount = getUpfrontAmount(analytic, puf, notional, buySellProtection);
    final double cleanPV = puf.getPointsUpFront() * notional;
    final double cleanPrice = getCleanPrice(puf);
    final TenorLabelledMatrix1D bucketedCS01 = getBucketedCS01(analytic, bucketCDSs, spreadObject.getXData(), quote, notional, yieldCurve, creditCurve);
    final double parallelCS01 = getParallelCS01(quote, analytic, yieldCurve, notional, pillarCDSs, ArrayUtils.toPrimitive(pillarObject.getYData()));

    final Set<ComputedValue> results = Sets.newHashSetWithExpectedSize(_valueRequirements.length);
    results.add(new ComputedValue(new ValueSpecification(ValueRequirementNames.ACCRUED_PREMIUM, target.toSpecification(), properties), accruedPremium));
    results.add(new ComputedValue(new ValueSpecification(ValueRequirementNames.ACCRUED_DAYS, target.toSpecification(), properties), accruedDays));
View Full Code Here

      cs01Values = CALCULATOR.bucketedCS01FromCreditCurve(analytic, quote.getCoupon()/*coupon * ONE_BPS*/, buckets, yieldCurve, creditCurve, ONE_BPS);
    }
    for (int i = 0; i < cs01Values.length; i++) {
      cs01Values[i] *= notional * ONE_BPS;
    }
    return new TenorLabelledMatrix1D(tenors, cs01Values);
  }
View Full Code Here

TOP

Related Classes of com.opengamma.financial.analytics.TenorLabelledMatrix1D

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.