@Override public org.drip.analytics.date.JulianDate getMaturityDate() { org.drip.analytics.date.JulianDate dtFloatReferenceMaturity = _floatReference.getMaturityDate(); org.drip.analytics.date.JulianDate dtFloatDerivedMaturity = _floatDerived.getMaturityDate(); if (null == dtFloatReferenceMaturity || null == dtFloatDerivedMaturity) return null; return dtFloatReferenceMaturity.getJulian() > dtFloatDerivedMaturity.getJulian() ? dtFloatReferenceMaturity : dtFloatDerivedMaturity; }
@Override public org.drip.analytics.date.JulianDate getEffectiveDate() { org.drip.analytics.date.JulianDate dtFloatReferenceEffective = _floatReference.getEffectiveDate(); org.drip.analytics.date.JulianDate dtFloatDerivedEffective = _floatDerived.getEffectiveDate(); if (null == dtFloatReferenceEffective || null == dtFloatDerivedEffective) return null; return dtFloatReferenceEffective.getJulian() < dtFloatDerivedEffective.getJulian() ? dtFloatReferenceEffective : dtFloatDerivedEffective; }
@Override public org.drip.analytics.date.JulianDate getFirstCouponDate() { org.drip.analytics.date.JulianDate dtFloatReferenceFirstCoupon = _floatReference.getFirstCouponDate(); org.drip.analytics.date.JulianDate dtFloatDerivedFirstCoupon = _floatDerived.getFirstCouponDate(); if (null == dtFloatReferenceFirstCoupon || null == dtFloatDerivedFirstCoupon) return null; return dtFloatReferenceFirstCoupon.getJulian() < dtFloatDerivedFirstCoupon.getJulian() ? dtFloatReferenceFirstCoupon : dtFloatDerivedFirstCoupon; }
@Override public byte[] serialize() { java.lang.StringBuffer sb = new java.lang.StringBuffer(); sb.append(org.drip.service.stream.Serializer.VERSION + getFieldDelimiter()); if (null == _floatReference) sb.append(org.drip.service.stream.Serializer.NULL_SER_STRING + getFieldDelimiter()); else sb.append(new java.lang.String(_floatReference.serialize()) + getFieldDelimiter()); if (null == _floatDerived) sb.append(org.drip.service.stream.Serializer.NULL_SER_STRING + getFieldDelimiter()); else sb.append(new java.lang.String(_floatDerived.serialize())); return sb.append(getObjectTrailer()).toString().getBytes(); }
@Override public org.drip.state.estimator.PredictorResponseWeightConstraint generateCalibPRLC( final org.drip.param.valuation.ValuationParams valParams, final org.drip.param.pricer.PricerParams pricerParams, final org.drip.param.definition.ComponentMarketParams mktParams, final org.drip.param.valuation.QuotingParams quotingParams, final org.drip.state.representation.LatentStateMetricMeasure lsmm) { org.drip.state.estimator.PredictorResponseWeightConstraint prwc = _floatDerived.generateCalibPRLC(valParams, pricerParams, mktParams, quotingParams, lsmm); if (null == prwc) return null; org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double> mapReferenceValue = _floatReference.value(valParams, null, mktParams, quotingParams); if (null == mapReferenceValue || !mapReferenceValue.containsKey("CleanPV")) return null; return prwc.updateValue(-1. * mapReferenceValue.get("CleanPV")) ? prwc : null; }
@Override public org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double> value( final org.drip.param.valuation.ValuationParams valParams, final org.drip.param.pricer.PricerParams pricerParams, final org.drip.param.definition.ComponentMarketParams mktParams, final org.drip.param.valuation.QuotingParams quotingParams) { long lStart = System.nanoTime(); org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double> mapFloatReferenceStreamResult = _floatReference.value(valParams, pricerParams, mktParams, quotingParams); org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double> mapFloatDerivedStreamResult = _floatDerived.value(valParams, pricerParams, mktParams, quotingParams); if (null == mapFloatReferenceStreamResult || 0 == mapFloatReferenceStreamResult.size() || null == mapFloatDerivedStreamResult || 0 == mapFloatDerivedStreamResult.size()) return null; org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double> mapResult = new org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double>(); mapResult.put("ReferenceAccrued01", mapFloatReferenceStreamResult.get("Accrued01")); mapResult.put("ReferenceAccrued", mapFloatReferenceStreamResult.get("FloatAccrued")); double dblReferenceCleanDV01 = mapFloatReferenceStreamResult.get("CleanDV01"); mapResult.put("ReferenceCleanDV01", dblReferenceCleanDV01); double dblReferenceCleanPV = mapFloatReferenceStreamResult.get("CleanPV"); mapResult.put("ReferenceCleanPV", dblReferenceCleanPV); mapResult.put("ReferenceDirtyDV01", mapFloatReferenceStreamResult.get("DirtyDV01")); double dblReferenceDirtyPV = mapFloatReferenceStreamResult.get("DirtyPV"); mapResult.put("ReferenceDirtyPV", dblReferenceDirtyPV); mapResult.put("ReferenceDV01", mapFloatReferenceStreamResult.get("DV01")); mapResult.put("ReferenceFixing01", mapFloatReferenceStreamResult.get("Fixing01")); double dblReferencePV = mapFloatReferenceStreamResult.get("PV"); mapResult.put("ReferencePV", dblReferencePV); mapResult.put("ReferenceResetDate", mapFloatReferenceStreamResult.get("ResetDate")); mapResult.put("ReferenceResetRate", mapFloatReferenceStreamResult.get("ResetRate")); mapResult.put("DerivedAccrued01", mapFloatDerivedStreamResult.get("Accrued01")); mapResult.put("DerivedAccrued", mapFloatDerivedStreamResult.get("FloatAccrued")); double dblDerivedCleanDV01 = mapFloatDerivedStreamResult.get("CleanDV01"); mapResult.put("DerivedCleanDV01", dblDerivedCleanDV01); double dblDerivedCleanPV = mapFloatDerivedStreamResult.get("CleanPV"); mapResult.put("DerivedCleanPV", dblDerivedCleanPV); mapResult.put("DerivedDirtyDV01", mapFloatDerivedStreamResult.get("DirtyDV01")); double dblDerivedDirtyPV = mapFloatDerivedStreamResult.get("DirtyPV"); mapResult.put("DerivedDirtyPV", dblDerivedDirtyPV); mapResult.put("DerivedDV01", mapFloatDerivedStreamResult.get("DV01")); mapResult.put("DerivedFixing01", mapFloatDerivedStreamResult.get("Fixing01")); double dblDerivedPV = mapFloatDerivedStreamResult.get("PV"); mapResult.put("DerivedPV", dblDerivedPV); mapResult.put("DerivedResetDate", mapFloatDerivedStreamResult.get("ResetDate")); mapResult.put("DerivedResetRate", mapFloatDerivedStreamResult.get("ResetRate")); double dblCleanPV = dblReferenceCleanPV + dblDerivedCleanPV; mapResult.put("CleanPV", dblCleanPV); mapResult.put("DirtyPV", dblDerivedCleanPV + dblDerivedDirtyPV); mapResult.put("PV", dblReferencePV + dblDerivedPV); mapResult.put( "Upfront", mapFloatReferenceStreamResult.get("Upfront") + mapFloatDerivedStreamResult.get("Upfront")); mapResult.put( "ReferenceParBasisSpread", -1. * (dblReferenceCleanPV + dblDerivedCleanPV) / dblReferenceCleanDV01); mapResult.put( "DerivedParBasisSpread", -1. * (dblReferenceCleanPV + dblDerivedCleanPV) / dblDerivedCleanDV01); double dblValueNotional = java.lang.Double.NaN; try { dblValueNotional = getNotional(valParams.valueDate()); } catch (java.lang.Exception e) { e.printStackTrace(); } try { if (org.drip.quant.common.NumberUtil.IsValid(dblValueNotional)) { double dblCleanPrice = 100. * (1. + (dblCleanPV / getInitialNotional() / dblValueNotional)); mapResult.put("Price", dblCleanPrice); mapResult.put("CleanPrice", dblCleanPrice); } } catch (java.lang.Exception e) { e.printStackTrace(); return null; } mapResult.put("CalcTime", (System.nanoTime() - lStart) * 1.e-09); return mapResult; }
@Override public org.drip.param.valuation.CashSettleParams getCashSettleParams() { return _floatReference.getCashSettleParams(); }
@Override public java.util.List<org.drip.analytics.period.CashflowPeriod> getCashFlowPeriod() { return org.drip.analytics.support.AnalyticsHelper.MergePeriodLists( _floatReference.getCashFlowPeriod(), _floatDerived.getCashFlowPeriod()); }
@Override public java.lang.String getForwardCurveName() { return _floatDerived.getForwardCurveName(); }
@Override public java.lang.String getIRCurveName() { return _floatReference.getIRCurveName(); }
@Override public double getCoupon( final double dblValue, final org.drip.param.definition.ComponentMarketParams mktParams) throws java.lang.Exception { return _floatReference.getCoupon(dblValue, mktParams); }
@Override public boolean setCurves( final java.lang.String strIR, final java.lang.String strIRTSY, final java.lang.String strCC) { return _floatReference.setCurves(strIR, strIRTSY, strCC) && _floatDerived.setCurves(strIR, strIRTSY, strCC); }
@Override public double getNotional(final double dblDate1, final double dblDate2) throws java.lang.Exception { return _floatReference.getNotional(dblDate1, dblDate2); }
@Override public double getInitialNotional() throws java.lang.Exception { return _floatReference.getInitialNotional(); }