* No seasonal adjustment is done.
* @param pricingDate The data for which the curve is constructed.
* @return The market.
*/
public static InflationIssuerProviderDiscount createMarket1(final ZonedDateTime pricingDate) {
final InflationIssuerProviderDiscount market = new InflationIssuerProviderDiscount();
market.setCurve(Currency.USD, USD_DSC);
market.setCurve(Currency.EUR, EUR_DSC);
market.setCurve(Currency.GBP, CURVE_GBP_35);
market.setCurve(USDLIBOR3M, USD_FWD3);
market.setCurve(EURIBOR3M, EUR_FWD3);
market.setCurve(EURIBOR6M, EUR_FWD6);
market.setCurve(PRICE_INDEX_EUR, PRICE_INDEX_CURVE_EUR);
market.setCurve(PRICE_INDEX_GBP, PRICE_INDEX_CURVE_GBP);
market.setCurve(ISSUER_UK_GOVT, Currency.GBP, CURVE_GBP_30);
market.setCurve(ISSUER_US_GOVT, Currency.GBP, CURVE_USD_30);
final ZonedDateTime spotUs = ScheduleCalculator.getAdjustedDate(pricingDate, SPOT_LAG_US, CALENDAR_USD);
final ZonedDateTime referenceInterpolatedDate = spotUs.minusMonths(MONTH_LAG_US);
final ZonedDateTime[] referenceDate = new ZonedDateTime[2];
referenceDate[0] = referenceInterpolatedDate.minusMonths(1).with(TemporalAdjusters.lastDayOfMonth());
referenceDate[1] = referenceDate[0].plusMonths(1).with(TemporalAdjusters.lastDayOfMonth());
final int[] yearUs = new int[] {1, 5, 10, 20, 50 };
final double[] indexValueUs = new double[2 + 2 * yearUs.length];
final double[] timeValueUs = new double[2 + 2 * yearUs.length];
indexValueUs[0] = USCPI_TIME_SERIES.getValue(referenceDate[0]);
indexValueUs[1] = USCPI_TIME_SERIES.getValue(referenceDate[1]);
timeValueUs[0] = TimeCalculator.getTimeBetween(pricingDate, referenceDate[0]);
timeValueUs[1] = TimeCalculator.getTimeBetween(pricingDate, referenceDate[1]);
final ZonedDateTime[] maturityDateUs = new ZonedDateTime[2 * yearUs.length];
// double[] maturityTimeUs = new double[yearUs.length];
for (int loopus = 0; loopus < yearUs.length; loopus++) {
maturityDateUs[2 * loopus] = ScheduleCalculator.getAdjustedDate(referenceDate[0], Period.ofYears(yearUs[loopus]), BUSINESS_DAY_USD, CALENDAR_USD);
maturityDateUs[2 * loopus + 1] = ScheduleCalculator.getAdjustedDate(referenceDate[1], Period.ofYears(yearUs[loopus]), BUSINESS_DAY_USD, CALENDAR_USD);
timeValueUs[2 + 2 * loopus] = TimeCalculator.getTimeBetween(pricingDate, maturityDateUs[2 * loopus]);
timeValueUs[2 + 2 * loopus + 1] = TimeCalculator.getTimeBetween(pricingDate, maturityDateUs[2 * loopus + 1]);
indexValueUs[2 + 2 * loopus] = indexValueUs[0] * Math.pow(1 + 0.02, yearUs[loopus]); // 2% inflation a year.
indexValueUs[2 + 2 * loopus + 1] = indexValueUs[1] * Math.pow(1 + 0.02, yearUs[loopus]); // 2% inflation a year.
}
final InterpolatedDoublesCurve curveUs = InterpolatedDoublesCurve.from(timeValueUs, indexValueUs, new LinearInterpolator1D(), NAME_USD_PRICE_INDEX);
final PriceIndexCurve priceIndexCurveUs = new PriceIndexCurve(curveUs);
market.setCurve(PRICE_INDEX_USD, priceIndexCurveUs);
return market;
}