Examples of HullWhiteOneFactorProviderDiscount


Examples of com.opengamma.analytics.financial.provider.description.interestrate.HullWhiteOneFactorProviderDiscount

    public HullWhiteOneFactorProviderDiscount buildObject(final FudgeDeserializer deserializer, final FudgeMsg message) {
      final MulticurveProviderDiscount multicurves = deserializer.fieldValueToObject(MulticurveProviderDiscount.class, message.getByName(CURVE_PROVIDER_FIELD));
      final HullWhiteOneFactorPiecewiseConstantParameters parameters = deserializer.fieldValueToObject(HullWhiteOneFactorPiecewiseConstantParameters.class,
          message.getByName(HULL_WHITE_PARAMETERS_FIELD));
      final Currency currency = Currency.of(message.getString(CURRENCY_FIELD));
      return new HullWhiteOneFactorProviderDiscount(multicurves, parameters, currency);
    }
View Full Code Here

Examples of com.opengamma.analytics.financial.provider.description.interestrate.HullWhiteOneFactorProviderDiscount

    final Map<IndexON, YieldAndDiscountCurve> overnight = new LinkedHashMap<>();
    overnight.put(new IndexON("NAME1", Currency.USD, DayCountFactory.INSTANCE.getDayCount("Act/360"), 1), new YieldCurve("E", ConstantDoublesCurve.from(0.003, "e")));
    overnight.put(new IndexON("NAME2", Currency.EUR, DayCountFactory.INSTANCE.getDayCount("Act/360"), 0), new YieldCurve("F", ConstantDoublesCurve.from(0.006, "f")));
    final MulticurveProviderDiscount multicurve = new MulticurveProviderDiscount(discounting, ibor, overnight, matrix);
    final HullWhiteOneFactorPiecewiseConstantParameters parameters = new HullWhiteOneFactorPiecewiseConstantParameters(0.04, new double[] {0.1, 0.2, 0.3, 0.4, 0.5}, new double[] {1, 2, 3, 4, 5});
    final HullWhiteOneFactorProviderDiscount provider = new HullWhiteOneFactorProviderDiscount(multicurve, parameters, Currency.USD);
    assertEquals(provider, cycleObject(HullWhiteOneFactorProviderDiscount.class, provider));
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.provider.description.interestrate.HullWhiteOneFactorProviderDiscount

      }
      if (currency == null) {
        throw new OpenGammaRuntimeException("Could not get the currency for this set of Hull-White one factor parameters");
      }
      final FXMatrix fxMatrix = (FXMatrix) inputs.getValue(ValueRequirementNames.FX_MATRIX);
      HullWhiteOneFactorProviderDiscount knownData;
      if (getExogenousRequirements().isEmpty()) {
        knownData = new HullWhiteOneFactorProviderDiscount(new MulticurveProviderDiscount(fxMatrix), modelParameters, currency);
      } else {
        final Object curveBundle = inputs.getValue(ValueRequirementNames.CURVE_BUNDLE);
        if (curveBundle instanceof MulticurveProviderDiscount) {
          knownData = new HullWhiteOneFactorProviderDiscount((MulticurveProviderDiscount) curveBundle, modelParameters, currency);
        }
        knownData = (HullWhiteOneFactorProviderDiscount) inputs.getValue(ValueRequirementNames.CURVE_BUNDLE);
      }
      return knownData;
    }
View Full Code Here

Examples of com.opengamma.analytics.financial.provider.description.interestrate.HullWhiteOneFactorProviderDiscount

    @Override
    protected Set<ComputedValue> getResults(final ValueSpecification bundleSpec, final ValueSpecification jacobianSpec, final ValueProperties bundleProperties,
        final Pair<HullWhiteOneFactorProviderInterface, CurveBuildingBlockBundle> pair) {
      final Set<ComputedValue> result = new HashSet<>();
      final HullWhiteOneFactorProviderDiscount provider = (HullWhiteOneFactorProviderDiscount) pair.getFirst();
      result.add(new ComputedValue(bundleSpec, pair.getFirst()));
      result.add(new ComputedValue(jacobianSpec, pair.getSecond()));
      for (final String curveName : getCurveNames()) {
        final ValueProperties curveProperties = bundleProperties.copy()
            .with(CURVE, curveName)
            .get();
        final ValueSpecification curveSpec = new ValueSpecification(YIELD_CURVE, ComputationTargetSpecification.NULL, curveProperties);
        result.add(new ComputedValue(curveSpec, provider.getMulticurveProvider().getCurve(curveName)));
      }
      return result;
    }
View Full Code Here

Examples of com.opengamma.analytics.financial.provider.description.interestrate.HullWhiteOneFactorProviderDiscount

        final String valueName = input.getSpecification().getValueName();
        if (CURVE_BUNDLE.equals(valueName)) {
          providers.add((HullWhiteOneFactorProviderDiscount) input.getValue());
        }
      }
      final HullWhiteOneFactorProviderDiscount result = ProviderUtils.mergeHullWhiteProviders(providers);
      return ProviderUtils.mergeHullWhiteProviders(result, matrix);
    }
View Full Code Here

Examples of com.opengamma.analytics.financial.provider.description.interestrate.HullWhiteOneFactorProviderDiscount

        final String valueName = input.getSpecification().getValueName();
        if (CURVE_BUNDLE.equals(valueName)) {
          providers.add((HullWhiteOneFactorProviderDiscount) input.getValue());
        }
      }
      final HullWhiteOneFactorProviderDiscount result = ProviderUtils.mergeHullWhiteProviders(providers);
      final HullWhiteOneFactorProviderDiscount provider = ProviderUtils.mergeHullWhiteProviders(result, matrix);
      final G2ppPiecewiseConstantParameters parameters = (G2ppPiecewiseConstantParameters) inputs.getValue(G2PP_PARAMETERS);
      return new G2ppProviderDiscount(provider.getMulticurveProvider(), parameters, provider.getHullWhiteCurrency());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.