Hi,
Here are issues found on PNL analytic when using OREApp from inputs:
mporConventions is set when loading from parameters in OREAppInputParameters::loadParameters() but when loading from inputs they need to be restored in the singleton. A trivial patch is here 2ec67e1#diff-fc7fe4cb9eb88b19791d900766cf3d2572bb75d34e9f2af231d328fbb48f5b12, to make room for a Conventions and then set it from OREApp::initFromInputs();
- on fixings, this parameter
fixingCutoff was introduced and is used in OREApp::buildCsvLoader , but is used only when having parameters. When using inputs, is using MarketDataInMemoryLoaderImpl which calls loadDataFromBuffers and eventually loads fixings up to today (date < today || (date == today && !implyTodaysFixings)) in contrast to CSVLoader::loadFile where we have this extra || (fixingCutOffDate_ != Date() && date <= fixingCutOffDate_). This is pretty relevant because we need fixings of the PNL period otherwise alert of missing fixing is emitted.
For PNL_EXPLAIN with PAR sensitivity. Using example in MarketRisk\Input\ore_pnlexplain_par.xml:
- The
SensitivityAnalysis flag UseSpreadedTermStructures has to be enabled (in MarketRisk\Input\Pnl\sensitivity.xml). Otherwise we get alert addDifferenceToScenario(): second argument must be difference scenario which comes from this zeroScenarios->setGenerateDifferenceScenarios(t0SimMarket->useSpreadedTermStructures());
- The list of
ShiftTenors (in sensitivity.xml) has to be identical to YieldCurves\Configuration\Tenors (in simulation.xml). For example, if we remove 30Y from simulation we get alert getDifferenceScenario(): scenario key sets are not compatible.. A workaround for this is to set in the simulation a separate list of tenors for each curve, e.g. <Configuration curve="USD-FedFunds"> <Tenors>2W, 1M, 3M, 6M, 1Y, 2Y, 3Y, 5Y, 10Y, 15Y, 20Y, 30Y</Tenors> </Configuration>
- A similar issue would be when in sensitivity we have a scenario to which there is no computed sensitivity, e.g. a warning emitted like this
Setting Diagonal Sensi DiscountCurve/EUR/2 w.r.t. DiscountCurve/EUR/2 to 0.01 (got 0) which will lead to the same alert getDifferenceScenario(): scenario key sets are not compatible.. There is no sensible workaround for this because you don't know in advance to which market factors you'll be sensitive.
Thank you,
Laurentiu.
Hi,
Here are issues found on
PNLanalytic when usingOREAppfrom inputs:mporConventionsis set when loading from parameters inOREAppInputParameters::loadParameters()but when loading from inputs they need to be restored in the singleton. A trivial patch is here 2ec67e1#diff-fc7fe4cb9eb88b19791d900766cf3d2572bb75d34e9f2af231d328fbb48f5b12, to make room for aConventionsand then set it fromOREApp::initFromInputs();fixingCutoffwas introduced and is used inOREApp::buildCsvLoader, but is used only when having parameters. When using inputs, is usingMarketDataInMemoryLoaderImplwhich callsloadDataFromBuffersand eventually loads fixings up to today(date < today || (date == today && !implyTodaysFixings))in contrast toCSVLoader::loadFilewhere we have this extra|| (fixingCutOffDate_ != Date() && date <= fixingCutOffDate_). This is pretty relevant because we need fixings of the PNL period otherwise alert of missing fixing is emitted.For
PNL_EXPLAINwithPARsensitivity. Using example inMarketRisk\Input\ore_pnlexplain_par.xml:SensitivityAnalysisflagUseSpreadedTermStructureshas to be enabled (inMarketRisk\Input\Pnl\sensitivity.xml). Otherwise we get alertaddDifferenceToScenario(): second argument must be difference scenariowhich comes from thiszeroScenarios->setGenerateDifferenceScenarios(t0SimMarket->useSpreadedTermStructures());ShiftTenors(insensitivity.xml) has to be identical toYieldCurves\Configuration\Tenors(insimulation.xml). For example, if we remove 30Y from simulation we get alertgetDifferenceScenario(): scenario key sets are not compatible.. A workaround for this is to set in the simulation a separate list of tenors for each curve, e.g.<Configuration curve="USD-FedFunds"> <Tenors>2W, 1M, 3M, 6M, 1Y, 2Y, 3Y, 5Y, 10Y, 15Y, 20Y, 30Y</Tenors> </Configuration>Setting Diagonal Sensi DiscountCurve/EUR/2 w.r.t. DiscountCurve/EUR/2 to 0.01 (got 0)which will lead to the same alertgetDifferenceScenario(): scenario key sets are not compatible.. There is no sensible workaround for this because you don't know in advance to which market factors you'll be sensitive.Thank you,
Laurentiu.