Loading...
Home / Interpretation of scenariodump.csv

Home Forums Help Interpretation of scenariodump.csv

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #6164
    rkapl
    Participant

    Dear All!

    I’m trying to understand the Output of scenariodump.csv (readable Scenario marketdata) and I believe that there is some additional tweaking necessary.
    The Discount Curves (DiscountCurve/CAD/0, DiscountCurve/CAD/1, ….) are in my assumption all discount factors at the given Tenor (0=3M,1=6M,…11=20Y in my case):
    ` <YieldCurves>
    <Configuration>
    <Tenors>3M,6M,1Y,2Y,3Y,4Y,5Y,7Y,10Y,12Y,15Y,20Y</Tenors>
    <Interpolation>LogLinear</Interpolation>
    <Extrapolation>Y</Extrapolation>
    </Configuration>
    </YieldCurves>

    Now, the maximum “discount factor” for the 20Y-CAD Tenor over all Scenarios is 3.36, which would imply a zero-rate of ~ -5.8% (roughly calculated with (1/DF)^(1/T)-1 ), which seems pretty improbable to me.
    The same applies to CHF, GBP, and – not so extreme – to EUR, USD and JPY (but even a negative rate of -2.4% seems strange for a 20Y Tenor in JPY).

    The Indices (IndexCurve/EUR-EURIBOR-3M/0 …) are similarly strange to Interpret, they look also like discount factors to me…

    Is there some additional calculation with the given numeraire column to be done?

    -regards,
    Roland

    #6168
    rkapl
    Participant

    Maybe I should add that all foreign currency (non EUR) curves are set up as “collateral in EUR” curves, i.e. the foreign Ccy cashflows are discounted using the EUR1D (EONIA Swap) curve + the Basis swap spread:

    ` <YieldCurve>
    <CurveId>CHF-IN-EUR</CurveId>
    <CurveDescription>CHF collateralized in EUR discount curve</CurveDescription>
    <Currency>CHF</Currency>
    <DiscountCurve/>
    <Segments>
    <CrossCurrency>
    <Type>Cross Currency Basis Swap</Type>
    <Quotes>
    <Quote>CC_BASIS_SWAP/BASIS_SPREAD/EUR/3M/CHF/3M/1Y</Quote>
    <Quote>CC_BASIS_SWAP/BASIS_SPREAD/EUR/3M/CHF/3M/2Y</Quote>
    <Quote>CC_BASIS_SWAP/BASIS_SPREAD/EUR/3M/CHF/3M/3Y</Quote>
    <Quote>CC_BASIS_SWAP/BASIS_SPREAD/EUR/3M/CHF/3M/4Y</Quote>
    <Quote>CC_BASIS_SWAP/BASIS_SPREAD/EUR/3M/CHF/3M/5Y</Quote>
    <Quote>CC_BASIS_SWAP/BASIS_SPREAD/EUR/3M/CHF/3M/7Y</Quote>
    <Quote>CC_BASIS_SWAP/BASIS_SPREAD/EUR/3M/CHF/3M/10Y</Quote>
    <Quote>CC_BASIS_SWAP/BASIS_SPREAD/EUR/3M/CHF/3M/15Y</Quote>
    <Quote>CC_BASIS_SWAP/BASIS_SPREAD/EUR/3M/CHF/3M/20Y</Quote>
    </Quotes>
    <Conventions>EUR-CHF-XCCY-BASIS-CONVENTIONS</Conventions>
    <DiscountCurve>EUR1D</DiscountCurve>
    <SpotRate>FX/RATE/EUR/CHF</SpotRate>
    <ProjectionCurveDomestic>CHF3M</ProjectionCurveDomestic>
    <ProjectionCurveForeign>EUR3M</ProjectionCurveForeign>
    </CrossCurrency>
    </Segments>
    <InterpolationVariable>Discount</InterpolationVariable>
    <InterpolationMethod>LogLinear</InterpolationMethod>
    <YieldCurveDayCounter>A365</YieldCurveDayCounter>
    <Tolerance>0.000000000001</Tolerance>
    </YieldCurve>

    Could it be that this leads to These strange simulation results?

    -regards,
    Roland

    #6169
    rkapl
    Participant

    OK, I’ve seen from the test cases that indeed there is a need to divide all scenario data by the numeraire:

    ` // Basic martingale tests
    Size samples = 10000;
    Real eur = 0.0, usd = 0.0, gbp = 0.0, eur2 = 0.0, usd2 = 0.0, gbp2 = 0.0;

    boost::timer timer;
    for (Size i = 0; i < samples; i++) {
    for (Date d : grid->dates()) {
    boost::shared_ptr<Scenario> scenario = scenGen->next(d);

    if (d == grid->dates().back()) { // in 10 years from today
    RiskFactorKey eurKey(RiskFactorKey::KeyType::DiscountCurve, “EUR”, 8);
    RiskFactorKey usdKey(RiskFactorKey::KeyType::DiscountCurve, “USD”, 8);
    RiskFactorKey gbpKey(RiskFactorKey::KeyType::DiscountCurve, “GBP”, 8);
    RiskFactorKey usdeurKey(RiskFactorKey::KeyType::FXSpot, “USDEUR”);
    RiskFactorKey gbpeurKey(RiskFactorKey::KeyType::FXSpot, “GBPEUR”);

    Real usdeurFX = scenario->get(usdeurKey);
    Real gbpeurFX = scenario->get(gbpeurKey);
    Real numeraire = scenario->getNumeraire();
    Real eur10yDiscount = scenario->get(eurKey);
    Real gbp10yDiscount = scenario->get(gbpKey);
    Real usd10yDiscount = scenario->get(usdKey);
    eur += eur10yDiscount / numeraire;
    gbp += gbp10yDiscount * gbpeurFX / numeraire;
    usd += usd10yDiscount * usdeurFX / numeraire;
    eur2 += 1.0 / numeraire;
    gbp2 += gbpeurFX / numeraire;
    usd2 += usdeurFX / numeraire;
    }
    }
    }
    Real elapsed = timer.elapsed();

    eur /= samples;
    gbp /= samples;
    usd /= samples;
    eur2 /= samples;
    gbp2 /= samples;
    usd2 /= samples;

    Real relTolerance = 0.01;
    Real eurExpected = d.market->discountCurve(“EUR”)->discount(20.);
    BOOST_CHECK_MESSAGE(fabs(eur – eurExpected) / eurExpected < relTolerance,
    “EUR 20Y Discount mismatch: ” << eur << ” vs ” << eurExpected);

    Doing this results in a “shock” inverse scenario with very low discount factors at the short end (giving a ~60000% zero rate) and moderately low rates at the long end (~2% zero rate) … well, it’s the highest CAD discount rate in all scenarios …

    Furthermore, I’ve seen that the index curve needs to be interpreted as discount factors, also needing above correction with the numeraire.

    -regards,
    Roland

    #6171
    Roland Lichters
    Keymaster

    Hi Roland,

    apologies for the delay, but you have answered it already.

    I just want to point you to a configuration option that introduces a change of measure and therefore affects the scenario dump output. Example section 4.13 in the ORE user guide illustrates it- parameter “ShiftHorizon” in the simulation model configuration (when set to a time larger than 0) changes measure from the LGM measure to the Hull-White T-Forward measure which has quite a significant effect in long-term simulations, see figure 20.

    Regards,
    Roland

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.