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

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


    @Override
    public ForwardCurveAffineDividends buildObject(FudgeDeserializer deserializer, FudgeMsg message) {
      final double spot = message.getDouble(SPOT_FIELD_NAME);
      final YieldAndDiscountCurve riskFreeCurve = deserializer.fieldValueToObject(YieldAndDiscountCurve.class, message.getByName(RISK_FREE_FIELD_NAME));
      final AffineDividends dividends = deserializer.fieldValueToObject(AffineDividends.class, message.getByName(DIVIDENDS_FIELD_NAME));
      return new ForwardCurveAffineDividends(spot, riskFreeCurve, dividends);
    }
View Full Code Here


    final YieldAndDiscountCurve riskFreeCurve = YieldCurve.from(ConstantDoublesCurve.from(0.0));
    final double[] tau = new double[] {0.25, 0.5, 0.75, 1, 2, 3, 4};
    final double[] alpha = new double[] {0.23, 0.24, 0.25, 0.26, 0, 0, 0};
    final double[] beta = new double[] {0, 0, 0, 0, 0.15, 0.2, 0.3};
    final AffineDividends dividends = new AffineDividends(tau, alpha, beta);
    final ForwardCurveAffineDividends curve1 = new ForwardCurveAffineDividends(spot, riskFreeCurve, dividends);
    final ForwardCurveAffineDividends curve2 = cycleObject(ForwardCurveAffineDividends.class, curve1);
    assertEquals(curve1.getSpot(), curve2.getSpot(), EPS);
    assertTrue(curve2.getForwardCurve() instanceof FunctionalDoublesCurve);
    assertTrue(curve2.getDriftCurve() instanceof FunctionalDoublesCurve);
    assertCurveEquals(curve1.getForwardCurve(), curve2.getForwardCurve());
    assertCurveEquals(curve1.getDriftCurve(), curve2.getDriftCurve());
    assertTrue(curve1.equals(curve2));
    assertTrue(curve1.getRiskFreeCurve().equals(curve2.getRiskFreeCurve()));
    assertTrue(curve1.getDividends().equals(curve2.getDividends()));
   
  }
View Full Code Here

      forwardCurve = new ForwardCurveYieldImplied(spot, fundingCurve, costOfCarryCurve);     
    } else {
      Object discreteDividendsInput = inputs.getValue(ValueRequirementNames.AFFINE_DIVIDENDS);
      if ((discreteDividendsInput != null) && (discreteDividendsInput instanceof AffineDividends)) {
        final AffineDividends discreteDividends = (AffineDividends) discreteDividendsInput;
        forwardCurve = new ForwardCurveAffineDividends(spot, fundingCurve, discreteDividends);
      } else {
        forwardCurve = new ForwardCurveYieldImplied(spot, fundingCurve, YieldCurve.from(ConstantDoublesCurve.from(0.0, "CostOfCarry")));
      }
    }
   
View Full Code Here

TOP

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

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.