public Dictionary <string, IVolSurface> GetSegaScenariosOuterWing(double bumpSize, DateTime?LastSensitivityDate) { var o = new Dictionary <string, IVolSurface>(); var lastExpiry = LastIx(LastSensitivityDate); var highDeltaFirst = WingDeltas.First() > WingDeltas.Last(); var outerWingIx = WingDeltas.Length - 1; for (var i = 0; i < lastExpiry; i++) { var volsBumped = (double[][])Flies.Clone(); if (highDeltaFirst) { volsBumped[i][outerWingIx] += bumpSize; } else { volsBumped[i][0] += bumpSize; } o.Add(PillarLabels[i], new RiskyFlySurface(OriginDate, ATMs, Expiries, WingDeltas, Riskies, volsBumped, Forwards, WingQuoteType, AtmVolType, StrikeInterpolatorType, TimeInterpolatorType, PillarLabels)); } return(o); }
public Dictionary <string, IVolSurface> GetSegaScenarios(double bumpSize, DateTime?LastSensitivityDate) { var o = new Dictionary <string, IVolSurface>(); var lastExpiry = LastIx(LastSensitivityDate); var highDeltaFirst = WingDeltas.First() > WingDeltas.Last(); for (var i = 0; i < lastExpiry; i++) { var volsBumped = (double[][])Flies.Clone(); if (highDeltaFirst) { var ratios = volsBumped[i].Select(x => x / volsBumped[i][0]).ToArray(); volsBumped[i] = ratios.Select(r => (volsBumped[i][0] + bumpSize) * r).ToArray(); } else { var ratios = volsBumped[i].Select(x => x / volsBumped[i].Last()).ToArray(); volsBumped[i] = ratios.Select(r => (volsBumped[i].Last() + bumpSize) * r).ToArray(); } o.Add(PillarLabels[i], new RiskyFlySurface(OriginDate, ATMs, Expiries, WingDeltas, Riskies, volsBumped, Forwards, WingQuoteType, AtmVolType, StrikeInterpolatorType, TimeInterpolatorType, PillarLabels)); } return(o); }