Package com.opengamma.analytics.math.curve

Examples of com.opengamma.analytics.math.curve.DoublesCurve


    /** The name field */
    private static final String NAME_FIELD_NAME = "name";

    @Override
    public YieldCurve buildObject(final FudgeDeserializer deserializer, final FudgeMsg message) {
      final DoublesCurve curve = deserializer.fieldValueToObject(DoublesCurve.class, message.getByName(CURVE_FIELD_NAME));
      final String name;
      if (message.hasField(NAME_FIELD_NAME)) {
        name = message.getString(NAME_FIELD_NAME);
      } else {
        name = curve.getName();
      }
      return new YieldCurve(name, curve);
    }
View Full Code Here


    /** The name field */
    private static final String NAME_FIELD_NAME = "name";

    @Override
    public DiscountCurve buildObject(final FudgeDeserializer deserializer, final FudgeMsg message) {
      final DoublesCurve curve = deserializer.fieldValueToObject(DoublesCurve.class, message.getByName(CURVE_FIELD_NAME));
      final String name;
      if (message.hasField(NAME_FIELD_NAME)) {
        name = message.getString(NAME_FIELD_NAME);
      } else {
        name = curve.getName();
      }
      return new DiscountCurve(name, curve);
    }
View Full Code Here

    /** The curve field */
    private static final String CURVE_FIELD = "curve";

    @Override
    public PriceIndexCurve buildObject(final FudgeDeserializer deserializer, final FudgeMsg message) {
      final DoublesCurve curve = deserializer.fieldValueToObject(DoublesCurve.class, message.getByName(CURVE_FIELD));
      return new PriceIndexCurve(curve);
    }
View Full Code Here

  public static class BlackForexTermStructureParametersBuilder extends AbstractFudgeBuilder<BlackForexTermStructureParameters> {
    private static final String VOLATILITY_DATA_FIELD_NAME = "Volatility data";

    @Override
    public BlackForexTermStructureParameters buildObject(final FudgeDeserializer deserializer, final FudgeMsg message) {
      final DoublesCurve volatility = deserializer.fieldValueToObject(DoublesCurve.class, message.getByName(VOLATILITY_DATA_FIELD_NAME));
      return new BlackForexTermStructureParameters(volatility);
    }
View Full Code Here

    assertEquals(smiles, cycleObject(SmileDeltaTermStructureParameters.class, smiles));
  }

  @Test
  public void test3() {
    final DoublesCurve volatility = InterpolatedDoublesCurve.fromSorted(new double[] {1, 2, 3, 4, 5}, new double[] {0.3, 0.4, 0.5, 0.6, 0.7}, Interpolator1DFactory.LINEAR_INSTANCE);
    final BlackForexTermStructureParameters termStructure = new BlackForexTermStructureParameters(volatility);
    assertEquals(termStructure, cycleObject(BlackForexTermStructureParameters.class, termStructure));
  }
View Full Code Here

    // ----------------------------------------------------------------------------------------------------------------------------------------

    final double[] times = PREMIUM_LEG_SCHEDULE_CALCULATOR.convertTenorsToDoubles(calibrationTenors, valuationDate, ACT_365);

    final DoublesCurve spreadCurve = InterpolatedDoublesCurve.fromSorted(times, marketSpreads, INTERPOLATOR);

    final NormalDistribution normal = new NormalDistribution(0.0, 1.0);

    double presentValue = 0.0;
    double frontendProtection = 0.0;
View Full Code Here

          final Forex forex, final FXMatrix fxMatrix, final ZonedDateTime now) {
        final MulticurveProviderInterface data = getMergedProviders(inputs, fxMatrix);
        final ValueRequirement desiredValue = Iterables.getOnlyElement(desiredValues);
        final ValueProperties properties = desiredValue.getConstraints().copy().get();
        final String fxForwardCurveName = desiredValue.getConstraint(FORWARD_CURVE_NAME);
        final DoublesCurve forwardPoints = getForwardPoints(inputs, fxForwardCurveName, now);
        final CurrencyPairs pairs = (CurrencyPairs) inputs.getValue(CURRENCY_PAIRS);
        final Pair<Currency, Currency> ccyPair;
        final Currency currency1 = forex.getCurrency1();
        final Currency currency2 = forex.getCurrency2();
        if (currency1.equals(pairs.getCurrencyPair(currency1, currency2).getBase())) {
View Full Code Here

      protected Set<ComputedValue> getValues(final FunctionInputs inputs, final ComputationTarget target, final Set<ValueRequirement> desiredValues,
          final Forex forex, final FXMatrix fxMatrix, final ZonedDateTime now) {
        final MulticurveProviderInterface data = getMergedProviders(inputs, fxMatrix);
        final ValueRequirement desiredValue = Iterables.getOnlyElement(desiredValues);
        final String fxForwardCurveName = desiredValue.getConstraint(FORWARD_CURVE_NAME);
        final DoublesCurve forwardPoints = getForwardPoints(inputs, fxForwardCurveName, now);
        final CurrencyPairs pairs = (CurrencyPairs) inputs.getValue(CURRENCY_PAIRS);
        final Pair<Currency, Currency> ccyPair;
        final Currency currency1 = forex.getCurrency1();
        final Currency currency2 = forex.getCurrency2();
        if (currency1.equals(pairs.getCurrencyPair(currency1, currency2).getBase())) {
View Full Code Here

        .with(InterpolatedDataProperties.RIGHT_X_EXTRAPOLATOR_NAME, rightExtrapolatorName);
    if (shifts != null) {
      resultProperties.with(VolatilitySurfaceShiftFunction.SHIFT, shifts);
    }
    final Interpolator1D interpolator = CombinedInterpolatorExtrapolatorFactory.getInterpolator(interpolatorName, leftExtrapolatorName, rightExtrapolatorName);
    final DoublesCurve volatility = InterpolatedDoublesCurve.fromSorted(timesList.toDoubleArray(), volsList.toDoubleArray(), interpolator);
    final BlackForexTermStructureParameters termStructure = new BlackForexTermStructureParameters(volatility);
    return Collections.singleton(new ComputedValue(new ValueSpecification(ValueRequirementNames.STANDARD_VOLATILITY_SURFACE_DATA, target.toSpecification(),
        resultProperties.get()), termStructure));
  }
View Full Code Here

    if (forwardCurveSpecification == null) {
      throw new OpenGammaRuntimeException("Couldn't find FX forward curve specification called " + forwardCurveName + " for target " + currencyPair);
    }
    final YieldAndDiscountCurve payCurve = getPayCurve(inputs, payCurrency, payCurveName, payCurveConfig);
    final YieldAndDiscountCurve receiveCurve = getReceiveCurve(inputs, receiveCurrency, receiveCurveName, receiveCurveConfig);
    final DoublesCurve fxForwardCurve = getFXForwardCurve(inputs, forwardCurveDefinition, forwardCurveSpecification, now.toLocalDate());
    final Map<String, Currency> curveCurrency = new HashMap<>();
    curveCurrency.put(fullPayCurveName, payCurrency);
    curveCurrency.put(fullReceiveCurveName, receiveCurrency);
    final Object baseQuotePairsObject = inputs.getValue(ValueRequirementNames.CURRENCY_PAIRS);
    if (baseQuotePairsObject == null) {
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.math.curve.DoublesCurve

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.