Exemple #1
0
        public void RiskInstrument(int instrumentNumber, LinearRateModel model, DateTime asOf, bool useAd = false)
        {
            if (Products.ContainsKey(instrumentNumber) == false)
            {
                throw new InvalidOperationException("Portfolio does not contain " + instrumentNumber + " as an identififer for a linearRateProduct.");
            }

            if (useAd)
            {
                RiskOutputs[instrumentNumber] = model.ZcbRiskProductOutputContainer(Products[instrumentNumber], asOf);
            }
            else
            {
                RiskOutputs[instrumentNumber] = model.RiskAgainstAllCurvesBumpAndRun(Products[instrumentNumber], asOf);
            }
        }
Exemple #2
0
 public void RiskInstrumentBumpAndRun(LinearRateModel model, DateTime asOf)
 {
     RiskOutput = model.RiskAgainstAllCurvesBumpAndRun(Instrument, asOf);
     RiskOutput.ConstructFullGradient();
 }