protected static List <MarginWeighting> CalculateMarginsWeighting(SensitivityCategory category, Dictionary <String, Decimal> thresholdFactors, List <Sensitivity> sensitivities) { if (sensitivities == null) { throw new ArgumentNullException(nameof(sensitivities)); } if (thresholdFactors == null) { throw new ArgumentNullException(nameof(thresholdFactors)); } List <MarginWeighting> weightingMargins = new List <MarginWeighting>(sensitivities.Count); foreach (Sensitivity sensitivity in sensitivities) { Decimal riskWeight = ModelParameters.GetWeightRisk(category, sensitivity); Decimal thresholdFactor = (sensitivity.Subrisk == SensitivitySubrisk.CrossCurrencyBasis) ? 1m : thresholdFactors[sensitivity.Qualifier]; Amount weightingMarginAmount = sensitivity.Amount * riskWeight * thresholdFactor; weightingMargins.Add(MarginWeighting.Of(sensitivity, weightingMarginAmount)); } return(weightingMargins); }
protected static List <MarginWeighting> CalculateMarginsWeighting(SensitivityCategory category, List <Sensitivity> sensitivities) { if (sensitivities == null) { throw new ArgumentNullException(nameof(sensitivities)); } List <MarginWeighting> weightingMargins = new List <MarginWeighting>(sensitivities.Count); foreach (Sensitivity sensitivity in sensitivities) { Decimal riskWeight = ModelParameters.GetWeightRisk(category, sensitivity); Amount weightingMarginAmount = sensitivity.Amount * riskWeight; weightingMargins.Add(MarginWeighting.Of(sensitivity, weightingMarginAmount)); } return(weightingMargins); }