From ab3287a6ec36630f8d7779e643c865de802c7cd8 Mon Sep 17 00:00:00 2001 From: Slavomir Batka Date: Wed, 10 May 2023 19:56:19 +0200 Subject: [PATCH 01/55] add Amortisation Factor --- ifrs17/DataModel/DataStructure.ipynb | 3 +++ ifrs17/Import/Importers.ipynb | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/ifrs17/DataModel/DataStructure.ipynb b/ifrs17/DataModel/DataStructure.ipynb index cd156be2..93a526e4 100644 --- a/ifrs17/DataModel/DataStructure.ipynb +++ b/ifrs17/DataModel/DataStructure.ipynb @@ -1626,6 +1626,9 @@ "\n [Display(Order = 40)]", "\n public InterpolationMethod InterpolationMethod { get; init; }", "\n ", + "\n [Conversion(typeof(PrimitiveArrayConverter))]", + "\n [Display(Order = 50)]", + "\n public double[] AmortizationFactor {get; set;}", "\n}", "\n", "\npublic record InterDataNodeParameter : DataNodeParameter {", diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index 99450cfb..0387dd99 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -1191,6 +1191,9 @@ "\n else if ( !(periodicity == (CashFlowPeriodicity)default && string.IsNullOrEmpty(interpolationMethodInput)) ) { ApplicationMessage.Log(Error.InvalidInterpolationMethod, dataNode); return null; }", "\n }", "\n", + "\n var amortizationFactors = datarow.Table.Columns.Where(c => c.ColumnName.StartsWith(nameof(SingleDataNodeParameter.AmortizationFactor))).OrderBy(c => c.ColumnName.Length).ThenBy(c => c.ColumnName)", + "\n .Select(x => datarow.Field(x.ColumnName).CheckStringForExponentialAndConvertToDouble()).ToArray();", + "\n ", "\n //Instantiate SingleDataNodeParameter", "\n return new SingleDataNodeParameter {", "\n Year = args.Year,", @@ -1200,6 +1203,7 @@ "\n DataNode = dataNode,", "\n CashFlowPeriodicity = periodicity,", "\n InterpolationMethod = interpolationMethod,", + "\n AmortizationFactor = amortizationFactors,", "\n PremiumAllocation = (datarow.Field(nameof(SingleDataNodeParameter.PremiumAllocation)))", "\n .ToString().CheckStringForExponentialAndConvertToDouble(),", "\n };", From 07fdeee35c53fecd7ecb33532e1cba3964276d90 Mon Sep 17 00:00:00 2001 From: Slavomir Batka Date: Thu, 11 May 2023 13:21:07 +0200 Subject: [PATCH 02/55] add ContractTerm --- ifrs17/DataModel/DataStructure.ipynb | 10 +++++++--- ifrs17/Import/Importers.ipynb | 6 ++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ifrs17/DataModel/DataStructure.ipynb b/ifrs17/DataModel/DataStructure.ipynb index 93a526e4..924e6679 100644 --- a/ifrs17/DataModel/DataStructure.ipynb +++ b/ifrs17/DataModel/DataStructure.ipynb @@ -1621,14 +1621,18 @@ "\n [Dimension(typeof(CashFlowPeriodicity))]", "\n [Display(Order = 30)]", "\n public CashFlowPeriodicity CashFlowPeriodicity { get; init; }", - "\n ", + "\n", "\n [Dimension(typeof(InterpolationMethod))]", "\n [Display(Order = 40)]", "\n public InterpolationMethod InterpolationMethod { get; init; }", + "\n ", + "\n [Dimension(typeof(int),nameof(ContractTerm))]", + "\n [Display(Order = 50)]", + "\n public int ContractTerm { get; init; }", "\n ", "\n [Conversion(typeof(PrimitiveArrayConverter))]", - "\n [Display(Order = 50)]", - "\n public double[] AmortizationFactor {get; set;}", + "\n [Display(Order = 60)]", + "\n public double[] DacAmortizationFactor {get; set;}", "\n}", "\n", "\npublic record InterDataNodeParameter : DataNodeParameter {", diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index 0387dd99..a639da57 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -1164,6 +1164,7 @@ "\n", "\n var hasCashFlowPeriodicityColumn = dataSet.Tables[nameof(SingleDataNodeParameter)].Columns.Any(x => x.ColumnName == nameof(SingleDataNodeParameter.CashFlowPeriodicity));", "\n var hasInterpolationMethodColumn = dataSet.Tables[nameof(SingleDataNodeParameter)].Columns.Any(x => x.ColumnName == nameof(SingleDataNodeParameter.InterpolationMethod));", + "\n var hasContractTerm = dataSet.Tables[nameof(SingleDataNodeParameter)].Columns.Any(x => x.ColumnName == nameof(SingleDataNodeParameter.ContractTerm));", "\n", "\n var importLog = await Import.FromDataSet(dataSet)", "\n .WithType( (dataset, datarow) => {", @@ -1191,7 +1192,7 @@ "\n else if ( !(periodicity == (CashFlowPeriodicity)default && string.IsNullOrEmpty(interpolationMethodInput)) ) { ApplicationMessage.Log(Error.InvalidInterpolationMethod, dataNode); return null; }", "\n }", "\n", - "\n var amortizationFactors = datarow.Table.Columns.Where(c => c.ColumnName.StartsWith(nameof(SingleDataNodeParameter.AmortizationFactor))).OrderBy(c => c.ColumnName.Length).ThenBy(c => c.ColumnName)", + "\n var dacAmortizationFactors = datarow.Table.Columns.Where(c => c.ColumnName.StartsWith(nameof(SingleDataNodeParameter.DacAmortizationFactor))).OrderBy(c => c.ColumnName.Length).ThenBy(c => c.ColumnName)", "\n .Select(x => datarow.Field(x.ColumnName).CheckStringForExponentialAndConvertToDouble()).ToArray();", "\n ", "\n //Instantiate SingleDataNodeParameter", @@ -1203,7 +1204,8 @@ "\n DataNode = dataNode,", "\n CashFlowPeriodicity = periodicity,", "\n InterpolationMethod = interpolationMethod,", - "\n AmortizationFactor = amortizationFactors,", + "\n ContractTerm = Int32.TryParse(datarow.Field(nameof(SingleDataNodeParameter.ContractTerm)), out var ct)? ct : default,", + "\n DacAmortizationFactor = dacAmortizationFactors,", "\n PremiumAllocation = (datarow.Field(nameof(SingleDataNodeParameter.PremiumAllocation)))", "\n .ToString().CheckStringForExponentialAndConvertToDouble(),", "\n };", From e38c5c80e1fa57524ef25d58f100b164dc1e3076 Mon Sep 17 00:00:00 2001 From: Slavomir Batka Date: Thu, 11 May 2023 16:10:31 +0200 Subject: [PATCH 03/55] add InterpolationMethod at Start --- ifrs17/Constants/Enums.ipynb | 2 +- ifrs17/Utils/ImportCalculationMethods.ipynb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ifrs17/Constants/Enums.ipynb b/ifrs17/Constants/Enums.ipynb index f41c965f..1d8a7fb8 100644 --- a/ifrs17/Constants/Enums.ipynb +++ b/ifrs17/Constants/Enums.ipynb @@ -236,7 +236,7 @@ { "cell_type": "code", "source": [ - "public enum InterpolationMethod { NotApplicable, Uniform /*, Linear, Start, End, Custom*/ }" + "public enum InterpolationMethod { NotApplicable, Uniform, Start, End /*, Linear, Custom*/ }" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17/Utils/ImportCalculationMethods.ipynb b/ifrs17/Utils/ImportCalculationMethods.ipynb index 9beb2fb7..384ccdae 100644 --- a/ifrs17/Utils/ImportCalculationMethods.ipynb +++ b/ifrs17/Utils/ImportCalculationMethods.ipynb @@ -237,6 +237,7 @@ "\n };", "\n ", "\n return interpolationMethod switch {", + "\n InterpolationMethod.Start => cashflowValues.SelectMany(v => Enumerable.Range(0, frequency).Select(x => x == 0 ? v : default)).ToArray(),", "\n InterpolationMethod.Uniform or _ => cashflowValues.SelectMany(v => Enumerable.Range(0, frequency).Select( _ => v / (double)frequency)).ToArray()", "\n };", "\n", From 62178afae8c93de5de71e06c5cec26b9a3730d20 Mon Sep 17 00:00:00 2001 From: Slavomir Batka Date: Thu, 11 May 2023 16:10:39 +0200 Subject: [PATCH 04/55] prepare Getters in storage --- ifrs17/Import/Importers.ipynb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index a639da57..ce76d874 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -202,6 +202,18 @@ "\n return inner[CurrentPeriod].InterpolationMethod; ", "\n }", "\n", + "\n public int GetContractTerm(string goc) {", + "\n if(!SingleDataNodeParametersByGoc.TryGetValue(goc, out var inner)) ", + "\n return default;", + "\n return inner[CurrentPeriod].ContractTerm; ", + "\n }", + "\n", + "\n public double[] GetDacAmortizationFactor(string goc) {", + "\n if(!SingleDataNodeParametersByGoc.TryGetValue(goc, out var inner)) ", + "\n return null;", + "\n return inner[CurrentPeriod].DacAmortizationFactor; ", + "\n }", + "\n", "\n // Validations", "\n public string ValidateEstimateType(string et, string goc) {", "\n var allowedEstimateTypes = estimateTypes;", From 2693e2c283cd0f594a3c7e1bb0d4dc4da0afac7d Mon Sep 17 00:00:00 2001 From: Slavomir Batka Date: Mon, 15 May 2023 19:25:43 +0200 Subject: [PATCH 05/55] add getters to ImportStorage --- ifrs17/Import/ImportStorage.ipynb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ifrs17/Import/ImportStorage.ipynb b/ifrs17/Import/ImportStorage.ipynb index ee2947d2..53019345 100644 --- a/ifrs17/Import/ImportStorage.ipynb +++ b/ifrs17/Import/ImportStorage.ipynb @@ -369,7 +369,14 @@ "\n ", "\n public double GetPremiumAllocationFactor(ImportIdentity id) => SingleDataNodeParametersByGoc.TryGetValue(id.DataNode, out var singleDataNodeParameter) ", "\n ? singleDataNodeParameter[CurrentPeriod].PremiumAllocation : DefaultPremiumExperienceAdjustmentFactor;", - "\n ", + "\n", + "\n public int GetContractTerm(ImportIdentity id) => SingleDataNodeParametersByGoc.TryGetValue(id.DataNode, out var singleDataNodeParameter) ", + "\n ? singleDataNodeParameter[CurrentPeriod].ContractTerm : default;", + "\n", + "\n public double[] GetDacAmortizationFactor(ImportIdentity id) => SingleDataNodeParametersByGoc.TryGetValue(id.DataNode, out var singleDataNodeParameter) ", + "\n ? singleDataNodeParameter[CurrentPeriod].DacAmortizationFactor : default;", + "\n", + "\n ", "\n // Data Node relationships", "\n public IEnumerable GetUnderlyingGic(ImportIdentity id) => !InterDataNodeParametersByGoc.TryGetValue(id.DataNode, out var interDataNodeParameters)", "\n ? Enumerable.Empty()", From eb871390dc2278733a0def94c0d36a3b378990f0 Mon Sep 17 00:00:00 2001 From: Slavomir Batka Date: Mon, 15 May 2023 19:26:00 +0200 Subject: [PATCH 06/55] add some tests --- ifrs17/Test/AggregateInterpolateTest.ipynb | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/ifrs17/Test/AggregateInterpolateTest.ipynb b/ifrs17/Test/AggregateInterpolateTest.ipynb index 7b659c85..c21656c2 100644 --- a/ifrs17/Test/AggregateInterpolateTest.ipynb +++ b/ifrs17/Test/AggregateInterpolateTest.ipynb @@ -137,6 +137,15 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "markdown", + "source": [ + "## Method: Uniform" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ @@ -168,6 +177,34 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "markdown", + "source": [ + "## Method: At Start" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var yearly = cashflow.Interpolate(CashFlowPeriodicity.Yearly, InterpolationMethod.Start);", + "\n(yearly[0], yearly[11], yearly[12], yearly[23]).Should().Be((120, 0, 180, 0));" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Method: Not Applicable" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ From 90f3a9a3a771dd41755894331a5c1e35898fe2b4 Mon Sep 17 00:00:00 2001 From: Slavomir Batka Date: Mon, 15 May 2023 19:27:12 +0200 Subject: [PATCH 07/55] Extrapolate Defferable Cashflow from first 12 values --- ifrs17/Import/Importers.ipynb | 3 ++- ifrs17/Utils/ImportCalculationMethods.ipynb | 29 +++++++++++++++++++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index ce76d874..cfce52c6 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -1397,7 +1397,8 @@ "\n : (int?)null,", "\n Partition = parsingStorage.TargetPartitionByReportingNodeAndPeriod.Id,", "\n Values = Multiply(GetSign(ImportFormats.Cashflow, (aocType, valueType.AmountType, valueType.EstimateType, dataNodeData.IsReinsurance), parsingStorage.HierarchyCache), values)", - "\n .Interpolate(parsingStorage.GetCashFlowPeriodicity(dataNode), parsingStorage.GetInterpolationMethod(dataNode))", + "\n .Interpolate(valueType.AmountType, parsingStorage.GetCashFlowPeriodicity(dataNode), parsingStorage.GetInterpolationMethod(dataNode))", + "\n .Extrapolate(valueType.AmountType, parsingStorage.GetContractTerm(dataNode), parsingStorage.GetDacAmortizationFactor(dataNode))", "\n };", "\n return item;", "\n }, ImportFormats.Cashflow", diff --git a/ifrs17/Utils/ImportCalculationMethods.ipynb b/ifrs17/Utils/ImportCalculationMethods.ipynb index 384ccdae..a54ef378 100644 --- a/ifrs17/Utils/ImportCalculationMethods.ipynb +++ b/ifrs17/Utils/ImportCalculationMethods.ipynb @@ -225,9 +225,9 @@ { "cell_type": "code", "source": [ - "public static double[] Interpolate(this double[] cashflowValues, CashFlowPeriodicity periodicity, InterpolationMethod interpolationMethod)", + "public static double[] Interpolate(this double[] cashflowValues, string amountType, CashFlowPeriodicity periodicity, InterpolationMethod interpolationMethod)", "\n{ ", - "\n if (periodicity == CashFlowPeriodicity.Monthly)", + "\n if (periodicity == CashFlowPeriodicity.Monthly || (amountType == AmountTypes.ACA || amountType == AmountTypes.AEA)) // TODO remove hardcoding!!", "\n return cashflowValues;", "\n ", "\n var frequency = periodicity switch {", @@ -247,6 +247,31 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "markdown", + "source": [ + "## Defer Acquisition Cost" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public static double[] Extrapolate(this double[] cashflowValues, string amountType, int contractTerm, double[] dacAmortizationFactors)", + "\n{ ", + "\n var cashflowValuesFixed = cashflowValues.Take(12).Concat(Enumerable.Repeat((double)0, 12 - cashflowValues.Take(12).Count()));", + "\n return amountType switch {", + "\n AmountTypes.AEA or AmountTypes.ACA => Enumerable.Repeat(cashflowValuesFixed, dacAmortizationFactors.Count() + 1).SelectMany(x => x).ToArray(),", + "\n _ => cashflowValues", + "\n };", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "markdown", "source": [ From b0b928e069cfe8c3efd914001d91c31294903939 Mon Sep 17 00:00:00 2001 From: Slavomir Batka Date: Tue, 16 May 2023 15:52:41 +0200 Subject: [PATCH 08/55] add EconomicBasis to SDNP --- ifrs17/Constants/Validations.ipynb | 3 ++- ifrs17/DataModel/DataStructure.ipynb | 11 ++++++++--- ifrs17/Import/ImportStorage.ipynb | 4 ++-- ifrs17/Import/Importers.ipynb | 15 ++++++++------- 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/ifrs17/Constants/Validations.ipynb b/ifrs17/Constants/Validations.ipynb index 0152a7e0..31d6d12a 100644 --- a/ifrs17/Constants/Validations.ipynb +++ b/ifrs17/Constants/Validations.ipynb @@ -76,7 +76,7 @@ "\n // Data Note State", "\n ChangeDataNodeState, InactiveDataNodeState,", "\n // Parameters", - "\n ReinsuranceCoverageDataNode, DuplicateInterDataNode, DuplicateSingleDataNode, InvalidDataNode, InvalidDataNodeForOpening, InvalidCashFlowPeriodicity, InvalidInterpolationMethod,", + "\n ReinsuranceCoverageDataNode, DuplicateInterDataNode, DuplicateSingleDataNode, InvalidDataNode, InvalidDataNodeForOpening, InvalidCashFlowPeriodicity, InvalidInterpolationMethod, InvalidEconomicBasisDriver,", "\n // Storage", "\n DataNodeNotFound, PartnerNotFound, RatingNotFound, CreditDefaultRateNotFound, MissingPremiumAllocation, ReinsuranceCoverage, ", "\n YieldCurveNotFound, YieldCurvePeriodNotApplicable, EconomicBasisNotFound, AccountingVariableTypeNotFound,", @@ -156,6 +156,7 @@ "\n (Error.InvalidDataNodeForOpening , 1) => $\"Data imported for invalid Data Node or for a Data Node after its inception year {s[0]}.\",", "\n (Error.InvalidCashFlowPeriodicity, 1) => $\"Single Data Node Parameter CashFlowPeriodicity for Data Node {s[0]} is invalid.\",", "\n (Error.InvalidInterpolationMethod, 1) => $\"Single Data Node Parameter InterpolationMethod for Data Node {s[0]} is invalid.\",", + "\n (Error.InvalidEconomicBasisDriver, 1) => $\"Single Data Node Parameter EconomicBasisDriver for Data Node {s[0]} is invalid.\",", "\n // Storage", "\n (Error.DataNodeNotFound , 1) => $\"DataNode {s[0]} not found.\",", "\n (Error.PartnerNotFound , 1) => $\"Partner not found for DataNode {s[0]}.\",", diff --git a/ifrs17/DataModel/DataStructure.ipynb b/ifrs17/DataModel/DataStructure.ipynb index 924e6679..225dd965 100644 --- a/ifrs17/DataModel/DataStructure.ipynb +++ b/ifrs17/DataModel/DataStructure.ipynb @@ -1629,10 +1629,15 @@ "\n [Dimension(typeof(int),nameof(ContractTerm))]", "\n [Display(Order = 50)]", "\n public int ContractTerm { get; init; }", - "\n ", - "\n [Conversion(typeof(PrimitiveArrayConverter))]", + "\n", + "\n [Dimension(typeof(EconomicBasis))]", "\n [Display(Order = 60)]", - "\n public double[] DacAmortizationFactor {get; set;}", + "\n public string EconomicBasisDriver {get; init;}", + "\n", + "\n [Conversion(typeof(PrimitiveArrayConverter))]", + "\n [Display(Order = 70)]", + "\n public double[] AmortizationFactor {get; init;}", + "\n", "\n}", "\n", "\npublic record InterDataNodeParameter : DataNodeParameter {", diff --git a/ifrs17/Import/ImportStorage.ipynb b/ifrs17/Import/ImportStorage.ipynb index 53019345..68dc6f89 100644 --- a/ifrs17/Import/ImportStorage.ipynb +++ b/ifrs17/Import/ImportStorage.ipynb @@ -373,8 +373,8 @@ "\n public int GetContractTerm(ImportIdentity id) => SingleDataNodeParametersByGoc.TryGetValue(id.DataNode, out var singleDataNodeParameter) ", "\n ? singleDataNodeParameter[CurrentPeriod].ContractTerm : default;", "\n", - "\n public double[] GetDacAmortizationFactor(ImportIdentity id) => SingleDataNodeParametersByGoc.TryGetValue(id.DataNode, out var singleDataNodeParameter) ", - "\n ? singleDataNodeParameter[CurrentPeriod].DacAmortizationFactor : default;", + "\n public double[] GetAmortizationFactor(ImportIdentity id) => SingleDataNodeParametersByGoc.TryGetValue(id.DataNode, out var singleDataNodeParameter) ", + "\n ? singleDataNodeParameter[CurrentPeriod].AmortizationFactor : default;", "\n", "\n ", "\n // Data Node relationships", diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index cfce52c6..7a9eb481 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -208,10 +208,10 @@ "\n return inner[CurrentPeriod].ContractTerm; ", "\n }", "\n", - "\n public double[] GetDacAmortizationFactor(string goc) {", + "\n public double[] GetAmortizationFactor(string goc) {", "\n if(!SingleDataNodeParametersByGoc.TryGetValue(goc, out var inner)) ", "\n return null;", - "\n return inner[CurrentPeriod].DacAmortizationFactor; ", + "\n return inner[CurrentPeriod].AmortizationFactor; ", "\n }", "\n", "\n // Validations", @@ -1176,7 +1176,7 @@ "\n", "\n var hasCashFlowPeriodicityColumn = dataSet.Tables[nameof(SingleDataNodeParameter)].Columns.Any(x => x.ColumnName == nameof(SingleDataNodeParameter.CashFlowPeriodicity));", "\n var hasInterpolationMethodColumn = dataSet.Tables[nameof(SingleDataNodeParameter)].Columns.Any(x => x.ColumnName == nameof(SingleDataNodeParameter.InterpolationMethod));", - "\n var hasContractTerm = dataSet.Tables[nameof(SingleDataNodeParameter)].Columns.Any(x => x.ColumnName == nameof(SingleDataNodeParameter.ContractTerm));", + "\n var hasEconomicBasisDriver = dataSet.Tables[nameof(SingleDataNodeParameter)].Columns.Any(x => x.ColumnName == nameof(SingleDataNodeParameter.EconomicBasisDriver));", "\n", "\n var importLog = await Import.FromDataSet(dataSet)", "\n .WithType( (dataset, datarow) => {", @@ -1204,8 +1204,8 @@ "\n else if ( !(periodicity == (CashFlowPeriodicity)default && string.IsNullOrEmpty(interpolationMethodInput)) ) { ApplicationMessage.Log(Error.InvalidInterpolationMethod, dataNode); return null; }", "\n }", "\n", - "\n var dacAmortizationFactors = datarow.Table.Columns.Where(c => c.ColumnName.StartsWith(nameof(SingleDataNodeParameter.DacAmortizationFactor))).OrderBy(c => c.ColumnName.Length).ThenBy(c => c.ColumnName)", - "\n .Select(x => datarow.Field(x.ColumnName).CheckStringForExponentialAndConvertToDouble()).ToArray();", + "\n var amortizationFactors = datarow.Table.Columns.Where(c => c.ColumnName.StartsWith(nameof(SingleDataNodeParameter.AmortizationFactor))).OrderBy(c => c.ColumnName.Length).ThenBy(c => c.ColumnName)", + "\n .Select(x => datarow.Field(x.ColumnName).CheckStringForExponentialAndConvertToDouble()).ToArray().Prune();", "\n ", "\n //Instantiate SingleDataNodeParameter", "\n return new SingleDataNodeParameter {", @@ -1217,7 +1217,8 @@ "\n CashFlowPeriodicity = periodicity,", "\n InterpolationMethod = interpolationMethod,", "\n ContractTerm = Int32.TryParse(datarow.Field(nameof(SingleDataNodeParameter.ContractTerm)), out var ct)? ct : default,", - "\n DacAmortizationFactor = dacAmortizationFactors,", + "\n EconomicBasisDriver = datarow.Field(nameof(SingleDataNodeParameter.EconomicBasisDriver)) ?? EconomicBases.N,", + "\n AmortizationFactor = amortizationFactors,", "\n PremiumAllocation = (datarow.Field(nameof(SingleDataNodeParameter.PremiumAllocation)))", "\n .ToString().CheckStringForExponentialAndConvertToDouble(),", "\n };", @@ -1398,7 +1399,7 @@ "\n Partition = parsingStorage.TargetPartitionByReportingNodeAndPeriod.Id,", "\n Values = Multiply(GetSign(ImportFormats.Cashflow, (aocType, valueType.AmountType, valueType.EstimateType, dataNodeData.IsReinsurance), parsingStorage.HierarchyCache), values)", "\n .Interpolate(valueType.AmountType, parsingStorage.GetCashFlowPeriodicity(dataNode), parsingStorage.GetInterpolationMethod(dataNode))", - "\n .Extrapolate(valueType.AmountType, parsingStorage.GetContractTerm(dataNode), parsingStorage.GetDacAmortizationFactor(dataNode))", + "\n .Extrapolate(valueType.AmountType, parsingStorage.GetContractTerm(dataNode), parsingStorage.GetAmortizationFactor(dataNode))", "\n };", "\n return item;", "\n }, ImportFormats.Cashflow", From ca45cd949a72250ac6901b644a4244f6f3365391 Mon Sep 17 00:00:00 2001 From: Slavomir Batka Date: Tue, 16 May 2023 18:05:29 +0200 Subject: [PATCH 09/55] bit more --- ifrs17/Constants/Consts.ipynb | 5 +++-- ifrs17/Import/2ImportScope-PresentValue.ipynb | 20 +++++++------------ ifrs17/Test/AggregateInterpolateTest.ipynb | 10 +++++----- 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/ifrs17/Constants/Consts.ipynb b/ifrs17/Constants/Consts.ipynb index 74437596..f69dafa3 100644 --- a/ifrs17/Constants/Consts.ipynb +++ b/ifrs17/Constants/Consts.ipynb @@ -297,7 +297,7 @@ "public static class EstimateTypes{", "\n public const string BE = nameof(BE); //Best Estimate", "\n public const string RA = nameof(RA); //Risk Adjustment", - "\n public const string CU = nameof(CU); //Coverage Units", + "\n public const string P = nameof(P); //Patterns", "\n public const string A = nameof(A); //Actuals", "\n public const string AA = nameof(AA); //Advance Actuals", "\n public const string OA = nameof(OA); //Overdue Actuals", @@ -385,6 +385,7 @@ "\n public const string AC = nameof(AC); // Attributable Commissions", "\n public const string AE = nameof(AE); // Attributable Expenses", "\n public const string ULE = nameof(ULE); // Unallocated Loss Adjustment Expenses", + "\n public const string CU = nameof(CU); // Coverage Units", "\n}" ], "metadata": {}, @@ -482,4 +483,4 @@ "outputs": [] } ] -} +} \ No newline at end of file diff --git a/ifrs17/Import/2ImportScope-PresentValue.ipynb b/ifrs17/Import/2ImportScope-PresentValue.ipynb index 46d985d5..6eba233b 100644 --- a/ifrs17/Import/2ImportScope-PresentValue.ipynb +++ b/ifrs17/Import/2ImportScope-PresentValue.ipynb @@ -797,10 +797,13 @@ "\n{ ", "\n [NotVisible] string EconomicBasis => GetContext();", "\n ", - "\n [IdentityProperty][NotVisible][Dimension(typeof(EstimateType))]", - "\n string EstimateType => EstimateTypes.CU;", + "\n [IdentityProperty][NotVisible][Dimension(typeof(AmountType))]", + "\n string AmountType => AmountTypes.CU;", "\n ", - "\n double[] Values => GetScope((Identity, (string)null, EstimateType, (int?)null)).Values;", + "\n [IdentityProperty][NotVisible][Dimension(typeof(EstimateType))]", + "\n string EstimateType => EstimateTypes.P; ", + "\n", + "\n double[] Values => GetScope((Identity, AmountType, EstimateType, (int?)null)).Values;", "\n}" ], "metadata": {}, @@ -848,7 +851,7 @@ "source": [ "public interface MonthlyAmortizationFactorCashflow : IScope", "\n{", - "\n private double[] NominalCuCashflow => GetScope((Identity with {AocType = AocTypes.CL}, (string)null, EstimateTypes.CU, (int?)null)).Values;", + "\n private double[] NominalCuCashflow => GetScope((Identity with {AocType = AocTypes.CL}, (string)null, AmountTypes.CU, (int?)null)).Values;", "\n private double[] DiscountedCuCashflow => Multiply(-1d, GetScope(Identity with {AocType = AocTypes.CL}, o => o.WithContext(EconomicBasis)).Values);", "\n ", "\n [NotVisible] string EconomicBasis => GetContext();", @@ -914,15 +917,6 @@ "metadata": {}, "execution_count": 0, "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] } ] } \ No newline at end of file diff --git a/ifrs17/Test/AggregateInterpolateTest.ipynb b/ifrs17/Test/AggregateInterpolateTest.ipynb index c21656c2..da1410a1 100644 --- a/ifrs17/Test/AggregateInterpolateTest.ipynb +++ b/ifrs17/Test/AggregateInterpolateTest.ipynb @@ -150,7 +150,7 @@ "cell_type": "code", "source": [ "var cashflow = new double [] {120, 180} ;", - "\nvar yearly = cashflow.Interpolate(CashFlowPeriodicity.Yearly, InterpolationMethod.Uniform);", + "\nvar yearly = cashflow.Interpolate( AmountTypes.PR, CashFlowPeriodicity.Yearly, InterpolationMethod.Uniform);", "\n(yearly[0], yearly[11], yearly[12], yearly[23]).Should().Be((10, 10, 15, 15));" ], "metadata": {}, @@ -160,7 +160,7 @@ { "cell_type": "code", "source": [ - "var quarterly = cashflow.Interpolate(CashFlowPeriodicity.Quarterly, InterpolationMethod.Uniform);", + "var quarterly = cashflow.Interpolate(AmountTypes.PR, CashFlowPeriodicity.Quarterly, InterpolationMethod.Uniform);", "\n(quarterly[0], quarterly[3], quarterly[4], quarterly[6]).Should().Be((30, 30, 45, 45));" ], "metadata": {}, @@ -170,7 +170,7 @@ { "cell_type": "code", "source": [ - "var monthly = cashflow.Interpolate(CashFlowPeriodicity.Monthly, InterpolationMethod.Uniform);", + "var monthly = cashflow.Interpolate(AmountTypes.PR, CashFlowPeriodicity.Monthly, InterpolationMethod.Uniform);", "\n(monthly[0], monthly[1]).Should().Be((120,180));" ], "metadata": {}, @@ -189,7 +189,7 @@ { "cell_type": "code", "source": [ - "var yearly = cashflow.Interpolate(CashFlowPeriodicity.Yearly, InterpolationMethod.Start);", + "var yearly = cashflow.Interpolate(AmountTypes.PR, CashFlowPeriodicity.Yearly, InterpolationMethod.Start);", "\n(yearly[0], yearly[11], yearly[12], yearly[23]).Should().Be((120, 0, 180, 0));" ], "metadata": {}, @@ -208,7 +208,7 @@ { "cell_type": "code", "source": [ - "var yearly = cashflow.Interpolate(CashFlowPeriodicity.Yearly, InterpolationMethod.NotApplicable);", + "var yearly = cashflow.Interpolate(AmountTypes.PR, CashFlowPeriodicity.Yearly, InterpolationMethod.NotApplicable);", "\n(yearly[0], yearly[11], yearly[12], yearly[23]).Should().Be((10, 10, 15, 15));" ], "metadata": {}, From 1fbdea5f36321893fdb7ed5ee5d31dd25de388cc Mon Sep 17 00:00:00 2001 From: Slavomir Batka Date: Tue, 16 May 2023 19:02:05 +0200 Subject: [PATCH 10/55] enhance Param files --- .../Files/DataNodes/DataNodeParameters_CH_2020_12.csv | 2 +- .../Files/DataNodes/DataNodeParameters_ES_2020_12.csv | 2 +- .../Files/DataNodes/DataNodeParameters_FR_2020_12.csv | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ifrs17-template/Files/DataNodes/DataNodeParameters_CH_2020_12.csv b/ifrs17-template/Files/DataNodes/DataNodeParameters_CH_2020_12.csv index 0e17cb6d..c98ce3f4 100644 --- a/ifrs17-template/Files/DataNodes/DataNodeParameters_CH_2020_12.csv +++ b/ifrs17-template/Files/DataNodes/DataNodeParameters_CH_2020_12.csv @@ -3,7 +3,7 @@ ReportingNode,Year,Month CH,2020,12 ,, @@SingleDataNodeParameter,, -DataNode,PremiumAllocation, +DataNode,PremiumAllocation,CashFlowPeriodicity,InterpolationMethod,EconomicBasisDriver,AmortizationFactor0,AmortizationFactor1,AmortizationFactor2,AmortizationFactor3,AmortizationFactor4,AmortizationFactor5,AmortizationFactor6,AmortizationFactor7,AmortizationFactor8,AmortizationFactor9 GicComplex,0.8, DT1.1,0.8, DT1.2,0.8, diff --git a/ifrs17-template/Files/DataNodes/DataNodeParameters_ES_2020_12.csv b/ifrs17-template/Files/DataNodes/DataNodeParameters_ES_2020_12.csv index e3bf89c8..f3159832 100644 --- a/ifrs17-template/Files/DataNodes/DataNodeParameters_ES_2020_12.csv +++ b/ifrs17-template/Files/DataNodes/DataNodeParameters_ES_2020_12.csv @@ -3,7 +3,7 @@ ReportingNode,Year,Month ES,2020,12 ,, @@SingleDataNodeParameter,, -DataNode,PremiumAllocation, +DataNode,PremiumAllocation,CashFlowPeriodicity,InterpolationMethod,EconomicBasisDriver,AmortizationFactor0,AmortizationFactor1,AmortizationFactor2,AmortizationFactor3,AmortizationFactor4,AmortizationFactor5,AmortizationFactor6,AmortizationFactor7,AmortizationFactor8,AmortizationFactor9 3BBBA.0,1, 3BPAA.0,1, 3BBBA.1,1, diff --git a/ifrs17-template/Files/DataNodes/DataNodeParameters_FR_2020_12.csv b/ifrs17-template/Files/DataNodes/DataNodeParameters_FR_2020_12.csv index f02f1b4e..ab450b5e 100644 --- a/ifrs17-template/Files/DataNodes/DataNodeParameters_FR_2020_12.csv +++ b/ifrs17-template/Files/DataNodes/DataNodeParameters_FR_2020_12.csv @@ -3,7 +3,7 @@ ReportingNode,Year,Month FR,2020,12 ,, @@SingleDataNodeParameter,, -DataNode,PremiumAllocation, +DataNode,PremiumAllocation,CashFlowPeriodicity,InterpolationMethod,EconomicBasisDriver,AmortizationFactor0,AmortizationFactor1,AmortizationFactor2,AmortizationFactor3,AmortizationFactor4,AmortizationFactor5,AmortizationFactor6,AmortizationFactor7,AmortizationFactor8,AmortizationFactor9DataNode,PremiumAllocation, EY52BBA.1,1, EY52PPA.1,1, EY57G.1,1, From 93b0e9326d2ed2431769317bbad62ce5bfba1930 Mon Sep 17 00:00:00 2001 From: Slavomir Batka Date: Tue, 16 May 2023 19:21:20 +0200 Subject: [PATCH 11/55] bit more data in Parameters + move CU and P --- .../DataNodeParameters_CH_2020_12.csv | 20 ++++++++-------- .../DataNodeParameters_ES_2020_12.csv | 24 +++++++++---------- .../DataNodeParameters_FR_2020_12.csv | 16 ++++++------- ifrs17-template/Files/Dimensions.csv | 3 ++- 4 files changed, 32 insertions(+), 31 deletions(-) diff --git a/ifrs17-template/Files/DataNodes/DataNodeParameters_CH_2020_12.csv b/ifrs17-template/Files/DataNodes/DataNodeParameters_CH_2020_12.csv index c98ce3f4..2020b8fd 100644 --- a/ifrs17-template/Files/DataNodes/DataNodeParameters_CH_2020_12.csv +++ b/ifrs17-template/Files/DataNodes/DataNodeParameters_CH_2020_12.csv @@ -4,16 +4,16 @@ CH,2020,12 ,, @@SingleDataNodeParameter,, DataNode,PremiumAllocation,CashFlowPeriodicity,InterpolationMethod,EconomicBasisDriver,AmortizationFactor0,AmortizationFactor1,AmortizationFactor2,AmortizationFactor3,AmortizationFactor4,AmortizationFactor5,AmortizationFactor6,AmortizationFactor7,AmortizationFactor8,AmortizationFactor9 -GicComplex,0.8, -DT1.1,0.8, -DT1.2,0.8, -DT1.3,1, -DT1.4,0.8, -DT1.5,0.8, -DT2.1,0.8, -DT2.2,0.8, -DT3.1,0.8, -DT4.1,0.8, +GicComplex,0.8,Monthly,Uniform,N, +DT1.1,0.8,Monthly,Uniform,N, +DT1.2,0.8,Monthly,Uniform,N, +DT1.3,1,Monthly,Uniform,N, +DT1.4,0.8,Monthly,Uniform,N, +DT1.5,0.8,Monthly,Uniform,N, +DT2.1,0.8,Monthly,Uniform,N, +DT2.2,0.8,Monthly,Uniform,N, +DT3.1,0.8,Monthly,Uniform,N, +DT4.1,0.8,Monthly,Uniform,N, ,, @@InterDataNodeParameter,, DataNode,LinkedDataNode,ReinsuranceCoverage diff --git a/ifrs17-template/Files/DataNodes/DataNodeParameters_ES_2020_12.csv b/ifrs17-template/Files/DataNodes/DataNodeParameters_ES_2020_12.csv index f3159832..a47ac355 100644 --- a/ifrs17-template/Files/DataNodes/DataNodeParameters_ES_2020_12.csv +++ b/ifrs17-template/Files/DataNodes/DataNodeParameters_ES_2020_12.csv @@ -4,15 +4,15 @@ ES,2020,12 ,, @@SingleDataNodeParameter,, DataNode,PremiumAllocation,CashFlowPeriodicity,InterpolationMethod,EconomicBasisDriver,AmortizationFactor0,AmortizationFactor1,AmortizationFactor2,AmortizationFactor3,AmortizationFactor4,AmortizationFactor5,AmortizationFactor6,AmortizationFactor7,AmortizationFactor8,AmortizationFactor9 -3BBBA.0,1, -3BPAA.0,1, -3BBBA.1,1, -3BPAA.1,1, -3BBBA.2,1, -3BPAA.2,1, -3BBBA.3,1, -3BPAA.3,1, -3BBBA.4,1, -3BPAA.4,1, -3BBBA.5,1, -3BPAA.5,1, +3BBBA.0,1,Monthly,Uniform,N, +3BPAA.0,1,Monthly,Uniform,N, +3BBBA.1,1,Monthly,Uniform,N, +3BPAA.1,1,Monthly,Uniform,N, +3BBBA.2,1,Monthly,Uniform,N, +3BPAA.2,1,Monthly,Uniform,N, +3BBBA.3,1,Monthly,Uniform,N, +3BPAA.3,1,Monthly,Uniform,N, +3BBBA.4,1,Monthly,Uniform,N, +3BPAA.4,1,Monthly,Uniform,N, +3BBBA.5,1,Monthly,Uniform,N, +3BPAA.5,1,Monthly,Uniform,N, diff --git a/ifrs17-template/Files/DataNodes/DataNodeParameters_FR_2020_12.csv b/ifrs17-template/Files/DataNodes/DataNodeParameters_FR_2020_12.csv index ab450b5e..d9d15623 100644 --- a/ifrs17-template/Files/DataNodes/DataNodeParameters_FR_2020_12.csv +++ b/ifrs17-template/Files/DataNodes/DataNodeParameters_FR_2020_12.csv @@ -4,14 +4,14 @@ FR,2020,12 ,, @@SingleDataNodeParameter,, DataNode,PremiumAllocation,CashFlowPeriodicity,InterpolationMethod,EconomicBasisDriver,AmortizationFactor0,AmortizationFactor1,AmortizationFactor2,AmortizationFactor3,AmortizationFactor4,AmortizationFactor5,AmortizationFactor6,AmortizationFactor7,AmortizationFactor8,AmortizationFactor9DataNode,PremiumAllocation, -EY52BBA.1,1, -EY52PPA.1,1, -EY57G.1,1, -EY58G.1,1, -EY58G.2,1, -EY59G.1,1, -EY59G.2,1, -EY63G.1,1, +EY52BBA.1,1,Monthly,Uniform,N, +EY52PPA.1,1,Monthly,Uniform,N, +EY57G.1,1,Monthly,Uniform,N, +EY58G.1,1,Monthly,Uniform,N, +EY58G.2,1,Monthly,Uniform,N, +EY59G.1,1,Monthly,Uniform,N, +EY59G.2,1,Monthly,Uniform,N, +EY63G.1,1,Monthly,Uniform,N, ,, @@InterDataNodeParameter,, DataNode,LinkedDataNode,ReinsuranceCoverage diff --git a/ifrs17-template/Files/Dimensions.csv b/ifrs17-template/Files/Dimensions.csv index 6341704f..08ff8494 100644 --- a/ifrs17-template/Files/Dimensions.csv +++ b/ifrs17-template/Files/Dimensions.csv @@ -15,6 +15,7 @@ NE,Non Attributable Expenses,,110,BeginningOfPeriod,,,,,,, AC,Attributable Commission,,120,BeginningOfPeriod,,,,,,, ACA,Aquisition,AC,130,BeginningOfPeriod,,,,,,, ACM,Maitenance,AC,140,EndOfPeriod,,,,,,, +CU,Coverage Units,,150,EndOfPeriod,,,,,,, ,,,,,,,,,,, @@DeferrableAmountType,,,,,,,,,,, SystemName,DisplayName,Parent,Order,PeriodType,,,,,,, @@ -114,7 +115,7 @@ C,Current,20,,,,,,,,, SystemName,DisplayName,Order,StructureType,InputSource,PeriodType,,,,,, BE,Best Estimate of Present Value,1,AoC,4,EndOfPeriod,,,,,, RA,Risk Adjustment,10,AoC,4,EndOfPeriod,,,,,, -CU,CoverageUnit,15,AoC,4,EndOfPeriod,,,,,, +P,Patterns,15,AoC,4,EndOfPeriod,,,,,, C,Contractual Service Margin,20,AoC,7,NotApplicable,,,,,, L,Loss Component,30,AoC,7,NotApplicable,,,,,, LR,Loss Recovery Component,40,AoC,7,NotApplicable,,,,,, From ff21851f364904a636e6aae3937e727a9f6198a6 Mon Sep 17 00:00:00 2001 From: Slavomir Batka Date: Wed, 17 May 2023 09:39:37 +0200 Subject: [PATCH 12/55] adapt CFS for CU change --- .../NominalCashflows_CH_2020_12.csv | 60 +++++++++---------- ...NominalCashflows_CH_2020_12_Projection.csv | 4 +- .../NominalCashflows_CH_2021_3.csv | 60 +++++++++---------- .../NominalCashflows_CH_2021_3_Projection.csv | 4 +- .../NominalCashflows_ES_2020_12.csv | 2 +- .../NominalCashflows_FR_2020_12.csv | 22 +++---- 6 files changed, 76 insertions(+), 76 deletions(-) diff --git a/ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2020_12.csv b/ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2020_12.csv index fc7e76c9..19b59a59 100644 --- a/ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2020_12.csv +++ b/ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2020_12.csv @@ -5,113 +5,113 @@ CH,2020,12,,,,,,,,,,,,,,,,,,,,,,,,,,, DataNode,AmountType,EstimateType,AocType,Novelty,AccidentYear,Values0,Values1,Values2,Values3,Values4,Values5,Values6,Values7,Values8,Values9,Values10,Values11,Values12,Values13,Values14,Values15,Values16,Values17,Values18,Values19,Values20,Values21,Values22,Values23 DT1.1,PR,BE,BOP,N,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0 DT1.1,NIC,BE,BOP,N,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 -DT1.1,,CU,BOP,N,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 +DT1.1,CU,P,BOP,N,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 DT1.1,,RA,BOP,N,,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 DT1.1,PR,BE,CL,C,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0 DT1.1,NIC,BE,CL,C,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 -DT1.1,,CU,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 +DT1.1,CU,P,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 DT1.1,,RA,CL,C,,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 DT1.2,NIC,BE,BOP,N,2020,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 -DT1.2,,CU,BOP,N,2020,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 +DT1.2,CU,P,BOP,N,2020,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 DT1.2,,RA,BOP,N,2020,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 DT1.2,NIC,BE,CL,C,2020,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 -DT1.2,,CU,CL,C,2020,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 +DT1.2,CU,P,CL,C,2020,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 DT1.2,,RA,CL,C,2020,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 DT1.3,PR,BE,BOP,N,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0 DT1.3,NIC,BE,BOP,N,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 -DT1.3,,CU,BOP,N,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 +DT1.3,CU,P,BOP,N,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 DT1.3,,RA,BOP,N,,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 DT1.3,PR,BE,CL,C,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0 DT1.3,NIC,BE,CL,C,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 -DT1.3,,CU,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 +DT1.3,CU,P,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 DT1.3,,RA,CL,C,,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 DT2.1,PR,BE,BOP,N,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0 DT2.1,NIC,BE,BOP,N,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 -DT2.1,,CU,BOP,N,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 +DT2.1,CU,P,BOP,N,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 DT2.1,,RA,BOP,N,,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 DT2.1,PR,BE,CL,C,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0 DT2.1,NIC,BE,CL,C,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 -DT2.1,,CU,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 +DT2.1,CU,P,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 DT2.1,,RA,CL,C,,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 DT2.2,NIC,BE,BOP,N,2020,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 -DT2.2,,CU,BOP,N,2020,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 +DT2.2,CU,P,BOP,N,2020,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 DT2.2,,RA,BOP,N,2020,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 DT2.2,NIC,BE,CL,C,2020,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 -DT2.2,,CU,CL,C,2020,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 +DT2.2,CU,P,CL,C,2020,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 DT2.2,,RA,CL,C,2020,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 DTR1.1,PR,BE,BOP,N,,-50,0,0,-50,0,0,-50,0,0,-50,0,0,0,-50,0,0,-50,0,0,-50,0,0,-50,0 DTR1.1,NIC,BE,BOP,N,,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5 -DTR1.1,,CU,BOP,N,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 +DTR1.1,CU,P,BOP,N,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 DTR1.1,,RA,BOP,N,,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25 DTR1.1,PR,BE,CL,C,,-50,0,0,-50,0,0,-50,0,0,-50,0,0,0,-50,0,0,-50,0,0,-50,0,0,-50,0 DTR1.1,NIC,BE,CL,C,,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5 -DTR1.1,,CU,CL,C,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 +DTR1.1,CU,P,CL,C,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 DTR1.1,,RA,CL,C,,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25 DTR1.2,NIC,BE,BOP,N,2020,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5 -DTR1.2,,CU,BOP,N,2020,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 +DTR1.2,CU,P,BOP,N,2020,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 DTR1.2,,RA,BOP,N,2020,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25 DTR1.2,NIC,BE,CL,C,2020,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5 -DTR1.2,,CU,CL,C,2020,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 +DTR1.2,CU,P,CL,C,2020,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 DTR1.2,,RA,CL,C,2020,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25 DTR2.1,PR,BE,BOP,N,,-50,0,0,-50,0,0,-50,0,0,-50,0,0,0,-50,0,0,-50,0,0,-50,0,0,-50,0 DTR2.1,NIC,BE,BOP,N,,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5 -DTR2.1,,CU,BOP,N,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 +DTR2.1,CU,P,BOP,N,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 DTR2.1,,RA,BOP,N,,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25 DTR2.1,PR,BE,CL,C,,-50,0,0,-50,0,0,-50,0,0,-50,0,0,0,-50,0,0,-50,0,0,-50,0,0,-50,0 DTR2.1,NIC,BE,CL,C,,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5 -DTR2.1,,CU,CL,C,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 +DTR2.1,CU,P,CL,C,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 DTR2.1,,RA,CL,C,,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25 DTR2.2,NIC,BE,BOP,N,2020,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5 -DTR2.2,,CU,BOP,N,2020,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 +DTR2.2,CU,P,BOP,N,2020,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 DTR2.2,,RA,BOP,N,2020,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25 DTR2.2,NIC,BE,CL,C,2020,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5 -DTR2.2,,CU,CL,C,2020,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 +DTR2.2,CU,P,CL,C,2020,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 DTR2.2,,RA,CL,C,2020,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25 DT3.1,PR,BE,BOP,N,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0 DT3.1,NIC,BE,BOP,N,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 -DT3.1,,CU,BOP,N,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 +DT3.1,CU,P,BOP,N,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 DT3.1,,RA,BOP,N,,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 DT3.1,PR,BE,CL,C,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0 DT3.1,NIC,BE,CL,C,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 -DT3.1,,CU,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 +DT3.1,CU,P,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 DT3.1,,RA,CL,C,,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 DT4.1,PR,BE,BOP,N,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0 DT4.1,NIC,BE,BOP,N,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 -DT4.1,,CU,BOP,N,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 +DT4.1,CU,P,BOP,N,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 DT4.1,,RA,BOP,N,,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 DT4.1,PR,BE,CL,C,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0 DT4.1,NIC,BE,CL,C,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 -DT4.1,,CU,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 +DT4.1,CU,P,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 DT4.1,,RA,CL,C,,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 DT1.4,PR,BE,BOP,N,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0 DT1.4,NIC,BE,BOP,N,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 -DT1.4,,CU,BOP,N,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 +DT1.4,CU,P,BOP,N,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 DT1.4,,RA,BOP,N,,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 DT1.4,PR,BE,CL,C,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0 DT1.4,NIC,BE,CL,C,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 -DT1.4,,CU,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 +DT1.4,CU,P,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 DT1.4,,RA,CL,C,,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 DT1.5,PR,BE,BOP,N,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0 DT1.5,NIC,BE,BOP,N,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 -DT1.5,,CU,BOP,N,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 +DT1.5,CU,P,BOP,N,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 DT1.5,,RA,BOP,N,,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 DT1.5,PR,BE,CL,C,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0 DT1.5,NIC,BE,CL,C,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 -DT1.5,,CU,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 +DT1.5,CU,P,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 DT1.5,,RA,CL,C,,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 DTR1.3,PR,BE,BOP,N,,-50,0,0,-50,0,0,-50,0,0,-50,0,0,0,-50,0,0,-50,0,0,-50,0,0,-50,0 DTR1.3,NIC,BE,BOP,N,,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12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5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5 -DTR1.4,,CU,BOP,N,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 +DTR1.4,CU,P,BOP,N,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 DTR1.4,,RA,BOP,N,,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25 DTR1.4,PR,BE,CL,C,,-50,0,0,-50,0,0,-50,0,0,-50,0,0,0,-50,0,0,-50,0,0,-50,0,0,-50,0 DTR1.4,NIC,BE,CL,C,,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5 -DTR1.4,,CU,CL,C,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 +DTR1.4,CU,P,CL,C,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 DTR1.4,,RA,CL,C,,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25 diff --git a/ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2020_12_Projection.csv b/ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2020_12_Projection.csv index 11a03541..59d27636 100644 --- a/ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2020_12_Projection.csv +++ b/ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2020_12_Projection.csv @@ -5,9 +5,9 @@ CH,2020,12,,,,,,,,,,,,,,,,,,,,,,,,,,, DataNode,AmountType,EstimateType,AocType,Novelty,AccidentYear,Values0,Values1,Values2,Values3,Values4,Values5,Values6,Values7,Values8,Values9,Values10,Values11,Values12,Values13,Values14,Values15,Values16,Values17,Values18,Values19,Values20,Values21,Values22,Values23 DTP1.1,PR,BE,BOP,N,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0 DTP1.1,NIC,BE,BOP,N,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 -DTP1.1,,CU,BOP,N,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 +DTP1.1,CU,P,BOP,N,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 DTP1.1,,RA,BOP,N,,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 DTP1.1,PR,BE,CL,C,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0 DTP1.1,NIC,BE,CL,C,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 -DTP1.1,,CU,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 +DTP1.1,CU,P,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 DTP1.1,,RA,CL,C,,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 diff --git a/ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2021_3.csv b/ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2021_3.csv index b814f614..8975012d 100644 --- a/ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2021_3.csv +++ b/ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2021_3.csv @@ -5,7 +5,7 @@ CH,2021,3,,,,,,,,,,,,,,,,,,,,,,,, DataNode,AmountType,EstimateType,AocType,Novelty,AccidentYear,Values0,Values1,Values2,Values3,Values4,Values5,Values6,Values7,Values8,Values9,Values10,Values11,Values12,Values13,Values14,Values15,Values16,Values17,Values18,Values19,Values20 DT1.1,PR,BE,MC,I,,0,110,0,0,110,0,0,110,0,0,110,0,0,0,0,0,0,0,0,0,0 DT1.1,NIC,BE,MC,I,,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,0,0,0,0,0,0,0,0,0 -DT1.1,,CU,MC,I,,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3,0,0,0,0,0,0,0,0,0 +DT1.1,CU,P,MC,I,,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3,0,0,0,0,0,0,0,0,0 DT1.1,,RA,MC,I,,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,0,0,0,0,0,0,0,0,0 DT1.1,PR,BE,BOP,N,,0,10,0,0,10,0,0,10,0,0,10,0,0,0,0,0,0,0,0,0,0 DT1.1,ICO,BE,BOP,N,,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0 @@ -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25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0,0,0,0,0,0,0,0,0 DTR1.4,PR,BE,CL,C,,0,-57.5,0,0,-57.5,0,0,-57.5,0,0,-57.5,0,0,0,0,0,0,0,0,0,0 DTR1.4,NIC,BE,CL,C,,15,15,15,15,15,15,15,15,15,15,15,15,0,0,0,0,0,0,0,0,0 -DTR1.4,,CU,CL,C,,-7.5,-3.5,-3.5,-3.5,-3.5,-3.5,-3.5,-3.5,-3.5,-3.5,-3.5,-2.5,0,0,0,0,0,0,0,0,0 +DTR1.4,CU,P,CL,C,,-7.5,-3.5,-3.5,-3.5,-3.5,-3.5,-3.5,-3.5,-3.5,-3.5,-3.5,-2.5,0,0,0,0,0,0,0,0,0 DTR1.4,,RA,CL,C,,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,0,0,0,0,0,0,0,0,0 diff --git a/ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2021_3_Projection.csv b/ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2021_3_Projection.csv index 5056a3e4..05e41d33 100644 --- a/ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2021_3_Projection.csv +++ b/ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2021_3_Projection.csv @@ -5,7 +5,7 @@ CH,2021,3,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, DataNode,AmountType,EstimateType,AocType,Novelty,AccidentYear,Values0,Values1,Values2,Values3,Values4,Values5,Values6,Values7,Values8,Values9,Values10,Values11,Values12,Values13,Values14,Values15,Values16,Values17,Values18,Values19,Values20,Values21,Values22,Values23,Values24,Values25,Values26,Values27,Values28,Values29,Values30,Values31,Values32,Values33,Values34,Values35,Values36,Values37,Values38,Values39,Values40,Values41,Values42,Values43,Values44,Values45,Values46,Values47,Values48,Values49,Values50,Values51,Values52,Values53,Values54,Values55,Values56,Values57,Values58,Values59,Values60,Values61,Values62,Values63,Values64,Values65,Values66,Values67,Values68,Values69,Values70,Values71,Values72,Values73,Values74,Values75,Values76,Values77,Values78,Values79,Values80,Values81,Values82,Values83,Values84,Values85,Values86,Values87,Values88,Values89,Values90,Values91,Values92,Values93,Values94,Values95,Values96,Values97,Values98,Values99,Values100,Values101,Values102,Values103,Values104,Values105,Values106,Values107,Values108,Values109,Values110,Values111,Values112,Values113,Values114,Values115,Values116,Values117,Values118,Values119,Values120,Values121,Values122,Values123,Values124,Values125,Values126,Values127,Values128,Values129,Values130,Values131,Values132,Values133,Values134,Values135,Values136,Values137,Values138,Values139,Values140,Values141,Values142,Values143,Values144,Values145,Values146,Values147,Values148,Values149,Values150,Values151,Values152,Values153,Values154,Values155,Values156,Values157,Values158,Values159,Values160,Values161,Values162,Values163,Values164,Values165,Values166,Values167,Values168,Values169,Values170,Values171,Values172,Values173,Values174,Values175,Values176,Values177,Values178,Values179,Values180,Values181,Values182,Values183,Values184,Values185,Values186,Values187,Values188,Values189,Values190,Values191,Values192,Values193,Values194,Values195,Values196,Values197,Values198,Values199,Values200,Values201,Values202,Values203,Values204,Values205,Values206,Values207,Values208,Values209,Values210,Values211,Values212,Values213,Values214,Values215,Values216,Values217,Values218,Values219,Values220,Values221,Values222,Values223,Values224,Values225,Values226,Values227 DTP1.1,PR,BE,MC,I,,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0 DTP1.1,NIC,BE,MC,I,,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20 -DTP1.1,,CU,MC,I,,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3,-10,-5,-5,-5,-5,-5,-5,-5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0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5 DTP1.1,PR,BE,CL,C,,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0 DTP1.1,NIC,BE,CL,C,,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29 -DTP1.1,,CU,CL,C,,-15,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-5,-15,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-5,-15,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-5,-15,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-5,-15,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-5,-15,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-5,-15,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-5,-15,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-5,-15,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-5,-15,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-5,-15,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-5,-15,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-5,-15,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-5,-15,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-5,-15,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-5,-15,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-5,-15,-7,-7,-7,-7,-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644 --- a/ifrs17-template/Files/TransactionalData/NominalCashflows_ES_2020_12.csv +++ b/ifrs17-template/Files/TransactionalData/NominalCashflows_ES_2020_12.csv @@ -11,4 +11,4 @@ DataNode,AmountType,EstimateType,AocType,Novelty,AccidentYear,Values0,Values1,Va 3BBBA.0,NIC,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,,,,,,,,,,,,,,,,,,,,,,,, 3BBBA.0,AEM,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,,,,,,,,,,,,,,,,,,,,,,,, 3BBBA.0,AEA,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,,,,,,,,,,,,,,,,,,,,,,,, -3BBBA.0,,CU,CL,C,,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,,,,,,,,,,,,,,,,,,,,,,,, +3BBBA.0,CU,P,CL,C,,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,,,,,,,,,,,,,,,,,,,,,,,, diff --git a/ifrs17-template/Files/TransactionalData/NominalCashflows_FR_2020_12.csv b/ifrs17-template/Files/TransactionalData/NominalCashflows_FR_2020_12.csv index 662e8b2f..c0ac6474 100644 --- a/ifrs17-template/Files/TransactionalData/NominalCashflows_FR_2020_12.csv +++ b/ifrs17-template/Files/TransactionalData/NominalCashflows_FR_2020_12.csv @@ -8,52 +8,52 @@ EY52BBA.1,NIC,BE,BOP,N,,-75,-75,-75,-75,-75,-75,-75,-75,-75,-75,-75,-75,-75,-75, EY52BBA.1,NIC,BE,EV,N,,0,0,0,0,0,0,0,0,0,0,0,0,-79.16666667,-79.16666667,-79.16666667,-79.16666667,-79.16666667,-79.16666667,-79.16666667,-79.16666667,-79.16666667,-79.16666667,-79.16666667,-79.16666667 EY52BBA.1,PR,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 EY52BBA.1,NIC,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,-79.16666667,-79.16666667,-79.16666667,-79.16666667,-79.16666667,-79.16666667,-79.16666667,-79.16666667,-79.16666667,-79.16666667,-79.16666667,-79.16666667 -EY52BBA.1,,CU,CL,C,,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 +EY52BBA.1,CU,P,CL,C,,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 EY57G.1,PR,BE,BOP,N,,1000,0,0,0,0,0,0,0,0,0,0,0,,,,,,,,,,,, EY57G.1,NIC,BE,BOP,N,,-75,-75,-75,-75,-75,-75,-75,-75,-75,-75,-75,-75,,,,,,,,,,,, EY57G.1,,RA,BOP,N,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,,,,,,,,,,,, EY57G.1,PR,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,,,,,,,,,,,, EY57G.1,NIC,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,,,,,,,,,,,, EY57G.1,,RA,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,,,,,,,,,,,, -EY57G.1,,CU,CL,C,,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,,,,,,,,,,,, +EY57G.1,CU,P,CL,C,,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,,,,,,,,,,,, EY57R.1,PR,BE,BOP,N,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,,,,,,,,,,,, EY57R.1,NIC,BE,BOP,N,,22.5,22.5,22.5,22.5,22.5,22.5,22.5,22.5,22.5,22.5,22.5,22.5,,,,,,,,,,,, EY57R.1,,RA,BOP,N,,1.5,1.5,1.5,1.5,1.5,1.5,1.5,1.5,1.5,1.5,1.5,1.5,,,,,,,,,,,, EY57R.1,PR,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,,,,,,,,,,,, EY57R.1,NI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-26.25,-26.25,-26.25,-26.25,-26.25,-26.25,-26.25,,,,,,,,,,,, EY58R.1,NIC,BE,BOP,N,,22.5,22.5,22.5,22.5,22.5,22.5,22.5,22.5,22.5,22.5,22.5,22.5,,,,,,,,,,,, EY58R.1,PR,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,,,,,,,,,,,, EY58R.1,NIC,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,,,,,,,,,,,, -EY58R.1,,CU,CL,C,,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,,,,,,,,,,,, +EY58R.1,CU,P,CL,C,,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,,,,,,,,,,,, EY59G.1,NIC,BE,BOP,I,,0,0,0,0,0,0,0,0,0,0,0,0,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 EY59G.1,NIC,BE,EV,I,,0,0,0,0,0,0,0,0,0,0,0,0,-29.16666667,-29.16666667,-29.16666667,-29.16666667,-29.16666667,-29.16666667,-29.16666667,-29.16666667,-29.16666667,-29.16666667,-29.16666667,-29.16666667 EY59G.1,NIC,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,-29.16666667,-29.16666667,-29.16666667,-29.16666667,-29.16666667,-29.16666667,-29.16666667,-29.16666667,-29.16666667,-29.16666667,-29.16666667,-29.16666667 -EY59G.1,,CU,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 +EY59G.1,CU,P,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 EY59G.2,NIC,BE,BOP,I,,0,0,0,0,0,0,0,0,0,0,0,0,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 EY59G.2,NIC,BE,EV,I,,0,0,0,0,0,0,0,0,0,0,0,0,-38.33333333,-38.33333333,-38.33333333,-38.33333333,-38.33333333,-38.33333333,-38.33333333,-38.33333333,-38.33333333,-38.33333333,-38.33333333,-38.33333333 EY59G.2,NIC,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,-38.33333333,-38.33333333,-38.33333333,-38.33333333,-38.33333333,-38.33333333,-38.33333333,-38.33333333,-38.33333333,-38.33333333,-38.33333333,-38.33333333 -EY59G.2,,CU,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 +EY59G.2,CU,P,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 EY59R.1,NIC,BE,BOP,I,,0,0,0,0,0,0,0,0,0,0,0,0,7.5,7.5,7.5,7.5,7.5,7.5,7.5,7.5,7.5,7.5,7.5,7.5 EY59R.1,NIC,BE,EV,I,,0,0,0,0,0,0,0,0,0,0,0,0,8.75,8.75,8.75,8.75,8.75,8.75,8.75,8.75,8.75,8.75,8.75,8.75 EY59R.1,NIC,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,8.75,8.75,8.75,8.75,8.75,8.75,8.75,8.75,8.75,8.75,8.75,8.75 -EY59R.1,,CU,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 +EY59R.1,CU,P,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 EY59R.2,NIC,BE,BOP,I,,0,0,0,0,0,0,0,0,0,0,0,0,7.5,7.5,7.5,7.5,7.5,7.5,7.5,7.5,7.5,7.5,7.5,7.5 EY59R.2,NIC,BE,EV,I,,0,0,0,0,0,0,0,0,0,0,0,0,11.5,11.5,11.5,11.5,11.5,11.5,11.5,11.5,11.5,11.5,11.5,11.5 EY59R.2,NIC,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,11.5,11.5,11.5,11.5,11.5,11.5,11.5,11.5,11.5,11.5,11.5,11.5 -EY59R.2,,CU,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 +EY59R.2,CU,P,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 EY63G.1,NIC,BE,BOP,I,2019,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100 EY63G.1,NIC,BE,EV,I,2019,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-115 EY63G.1,NIC,BE,CL,C,2019,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-115 @@ -62,4 +62,4 @@ EY63R.1,NIC,BE,BOP,N,,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50 EY63R.1,NIC,BE,EV,N,,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57.5 EY63R.1,PR,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 EY63R.1,NIC,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57.5 -EY63R.1,,CU,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1 +EY63R.1,CU,P,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1 From 9c7c0fecdbf3915c91e462dc2a029d272cb48b76 Mon Sep 17 00:00:00 2001 From: Slavomir Batka Date: Wed, 17 May 2023 13:01:56 +0200 Subject: [PATCH 13/55] fix test file --- .../Test/Data/NominalCashflows_CH_2020_12_DT1.1NoPrem.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ifrs17-template/Test/Data/NominalCashflows_CH_2020_12_DT1.1NoPrem.csv b/ifrs17-template/Test/Data/NominalCashflows_CH_2020_12_DT1.1NoPrem.csv index 885890c3..8c6a5295 100644 --- a/ifrs17-template/Test/Data/NominalCashflows_CH_2020_12_DT1.1NoPrem.csv +++ b/ifrs17-template/Test/Data/NominalCashflows_CH_2020_12_DT1.1NoPrem.csv @@ -4,8 +4,8 @@ CH,2020,12,,,,,,,,,,,,,,,,,,,,,,,,,,, @@Cashflow,,,,,,,,,,,,,,,,,,,,,,,,,,,,, DataNode,AmountType,EstimateType,AocType,Novelty,AccidentYear,Values0,Values1,Values2,Values3,Values4,Values5,Values6,Values7,Values8,Values9,Values10,Values11,Values12,Values13,Values14,Values15,Values16,Values17,Values18,Values19,Values20,Values21,Values22,Values23 DT1.1,NIC,BE,BOP,N,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 -DT1.1,,CU,BOP,N,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 +DT1.1,CU,P,BOP,N,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 DT1.1,,RA,BOP,N,,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 DT1.1,NIC,BE,CL,C,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 -DT1.1,,CU,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 +DT1.1,CU,P,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 DT1.1,,RA,CL,C,,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 From acdff116494ae2965acc6bfcfba8a633022ddd7b Mon Sep 17 00:00:00 2001 From: Slavomir Batka Date: Wed, 17 May 2023 13:37:57 +0200 Subject: [PATCH 14/55] remove unused methods --- ifrs17/Constants/Enums.ipynb | 2 +- ifrs17/DataModel/DataStructure.ipynb | 8 ++----- ifrs17/Import/ImportStorage.ipynb | 3 --- ifrs17/Import/Importers.ipynb | 8 ------- ifrs17/Utils/ImportCalculationMethods.ipynb | 25 --------------------- 5 files changed, 3 insertions(+), 43 deletions(-) diff --git a/ifrs17/Constants/Enums.ipynb b/ifrs17/Constants/Enums.ipynb index 1d8a7fb8..d1f3e733 100644 --- a/ifrs17/Constants/Enums.ipynb +++ b/ifrs17/Constants/Enums.ipynb @@ -236,7 +236,7 @@ { "cell_type": "code", "source": [ - "public enum InterpolationMethod { NotApplicable, Uniform, Start, End /*, Linear, Custom*/ }" + "public enum InterpolationMethod { NotApplicable, Uniform, Start, /*End , Linear, Custom*/ }" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17/DataModel/DataStructure.ipynb b/ifrs17/DataModel/DataStructure.ipynb index 225dd965..be07686d 100644 --- a/ifrs17/DataModel/DataStructure.ipynb +++ b/ifrs17/DataModel/DataStructure.ipynb @@ -1625,17 +1625,13 @@ "\n [Dimension(typeof(InterpolationMethod))]", "\n [Display(Order = 40)]", "\n public InterpolationMethod InterpolationMethod { get; init; }", - "\n ", - "\n [Dimension(typeof(int),nameof(ContractTerm))]", - "\n [Display(Order = 50)]", - "\n public int ContractTerm { get; init; }", "\n", "\n [Dimension(typeof(EconomicBasis))]", - "\n [Display(Order = 60)]", + "\n [Display(Order = 50)]", "\n public string EconomicBasisDriver {get; init;}", "\n", "\n [Conversion(typeof(PrimitiveArrayConverter))]", - "\n [Display(Order = 70)]", + "\n [Display(Order = 60)]", "\n public double[] AmortizationFactor {get; init;}", "\n", "\n}", diff --git a/ifrs17/Import/ImportStorage.ipynb b/ifrs17/Import/ImportStorage.ipynb index 68dc6f89..0caf69d2 100644 --- a/ifrs17/Import/ImportStorage.ipynb +++ b/ifrs17/Import/ImportStorage.ipynb @@ -370,9 +370,6 @@ "\n public double GetPremiumAllocationFactor(ImportIdentity id) => SingleDataNodeParametersByGoc.TryGetValue(id.DataNode, out var singleDataNodeParameter) ", "\n ? singleDataNodeParameter[CurrentPeriod].PremiumAllocation : DefaultPremiumExperienceAdjustmentFactor;", "\n", - "\n public int GetContractTerm(ImportIdentity id) => SingleDataNodeParametersByGoc.TryGetValue(id.DataNode, out var singleDataNodeParameter) ", - "\n ? singleDataNodeParameter[CurrentPeriod].ContractTerm : default;", - "\n", "\n public double[] GetAmortizationFactor(ImportIdentity id) => SingleDataNodeParametersByGoc.TryGetValue(id.DataNode, out var singleDataNodeParameter) ", "\n ? singleDataNodeParameter[CurrentPeriod].AmortizationFactor : default;", "\n", diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index 7a9eb481..bf6cc355 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -202,12 +202,6 @@ "\n return inner[CurrentPeriod].InterpolationMethod; ", "\n }", "\n", - "\n public int GetContractTerm(string goc) {", - "\n if(!SingleDataNodeParametersByGoc.TryGetValue(goc, out var inner)) ", - "\n return default;", - "\n return inner[CurrentPeriod].ContractTerm; ", - "\n }", - "\n", "\n public double[] GetAmortizationFactor(string goc) {", "\n if(!SingleDataNodeParametersByGoc.TryGetValue(goc, out var inner)) ", "\n return null;", @@ -1216,7 +1210,6 @@ "\n DataNode = dataNode,", "\n CashFlowPeriodicity = periodicity,", "\n InterpolationMethod = interpolationMethod,", - "\n ContractTerm = Int32.TryParse(datarow.Field(nameof(SingleDataNodeParameter.ContractTerm)), out var ct)? ct : default,", "\n EconomicBasisDriver = datarow.Field(nameof(SingleDataNodeParameter.EconomicBasisDriver)) ?? EconomicBases.N,", "\n AmortizationFactor = amortizationFactors,", "\n PremiumAllocation = (datarow.Field(nameof(SingleDataNodeParameter.PremiumAllocation)))", @@ -1399,7 +1392,6 @@ "\n Partition = parsingStorage.TargetPartitionByReportingNodeAndPeriod.Id,", "\n Values = Multiply(GetSign(ImportFormats.Cashflow, (aocType, valueType.AmountType, valueType.EstimateType, dataNodeData.IsReinsurance), parsingStorage.HierarchyCache), values)", "\n .Interpolate(valueType.AmountType, parsingStorage.GetCashFlowPeriodicity(dataNode), parsingStorage.GetInterpolationMethod(dataNode))", - "\n .Extrapolate(valueType.AmountType, parsingStorage.GetContractTerm(dataNode), parsingStorage.GetAmortizationFactor(dataNode))", "\n };", "\n return item;", "\n }, ImportFormats.Cashflow", diff --git a/ifrs17/Utils/ImportCalculationMethods.ipynb b/ifrs17/Utils/ImportCalculationMethods.ipynb index a54ef378..edc4dd8a 100644 --- a/ifrs17/Utils/ImportCalculationMethods.ipynb +++ b/ifrs17/Utils/ImportCalculationMethods.ipynb @@ -247,31 +247,6 @@ "execution_count": 0, "outputs": [] }, - { - "cell_type": "markdown", - "source": [ - "## Defer Acquisition Cost" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "public static double[] Extrapolate(this double[] cashflowValues, string amountType, int contractTerm, double[] dacAmortizationFactors)", - "\n{ ", - "\n var cashflowValuesFixed = cashflowValues.Take(12).Concat(Enumerable.Repeat((double)0, 12 - cashflowValues.Take(12).Count()));", - "\n return amountType switch {", - "\n AmountTypes.AEA or AmountTypes.ACA => Enumerable.Repeat(cashflowValuesFixed, dacAmortizationFactors.Count() + 1).SelectMany(x => x).ToArray(),", - "\n _ => cashflowValues", - "\n };", - "\n}" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, { "cell_type": "markdown", "source": [ From 15246af5865452ca5680174320a859dc1dc70743 Mon Sep 17 00:00:00 2001 From: Slavomir Batka Date: Wed, 17 May 2023 16:11:01 +0200 Subject: [PATCH 15/55] fix signature & remove unused getter --- ifrs17/Import/2ImportScope-PresentValue.ipynb | 2 +- ifrs17/Import/Importers.ipynb | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/ifrs17/Import/2ImportScope-PresentValue.ipynb b/ifrs17/Import/2ImportScope-PresentValue.ipynb index 6eba233b..dc8994f1 100644 --- a/ifrs17/Import/2ImportScope-PresentValue.ipynb +++ b/ifrs17/Import/2ImportScope-PresentValue.ipynb @@ -851,7 +851,7 @@ "source": [ "public interface MonthlyAmortizationFactorCashflow : IScope", "\n{", - "\n private double[] NominalCuCashflow => GetScope((Identity with {AocType = AocTypes.CL}, (string)null, AmountTypes.CU, (int?)null)).Values;", + "\n private double[] NominalCuCashflow => GetScope((Identity with {AocType = AocTypes.CL}, AmountTypes.CU, EstimateTypes.P, (int?)null)).Values;", "\n private double[] DiscountedCuCashflow => Multiply(-1d, GetScope(Identity with {AocType = AocTypes.CL}, o => o.WithContext(EconomicBasis)).Values);", "\n ", "\n [NotVisible] string EconomicBasis => GetContext();", diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index bf6cc355..4f0b36ee 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -202,12 +202,6 @@ "\n return inner[CurrentPeriod].InterpolationMethod; ", "\n }", "\n", - "\n public double[] GetAmortizationFactor(string goc) {", - "\n if(!SingleDataNodeParametersByGoc.TryGetValue(goc, out var inner)) ", - "\n return null;", - "\n return inner[CurrentPeriod].AmortizationFactor; ", - "\n }", - "\n", "\n // Validations", "\n public string ValidateEstimateType(string et, string goc) {", "\n var allowedEstimateTypes = estimateTypes;", From 6f949ff7aa239af7ee8324df17393cbedf89c520 Mon Sep 17 00:00:00 2001 From: Slavomir Batka Date: Wed, 17 May 2023 16:31:17 +0200 Subject: [PATCH 16/55] reset Param files since these are optional --- .../DataNodeParameters_CH_2020_12.csv | 22 ++++++++-------- .../DataNodeParameters_ES_2020_12.csv | 26 +++++++++---------- .../DataNodeParameters_FR_2020_12.csv | 18 ++++++------- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/ifrs17-template/Files/DataNodes/DataNodeParameters_CH_2020_12.csv b/ifrs17-template/Files/DataNodes/DataNodeParameters_CH_2020_12.csv index 2020b8fd..0e17cb6d 100644 --- a/ifrs17-template/Files/DataNodes/DataNodeParameters_CH_2020_12.csv +++ b/ifrs17-template/Files/DataNodes/DataNodeParameters_CH_2020_12.csv @@ -3,17 +3,17 @@ ReportingNode,Year,Month CH,2020,12 ,, @@SingleDataNodeParameter,, -DataNode,PremiumAllocation,CashFlowPeriodicity,InterpolationMethod,EconomicBasisDriver,AmortizationFactor0,AmortizationFactor1,AmortizationFactor2,AmortizationFactor3,AmortizationFactor4,AmortizationFactor5,AmortizationFactor6,AmortizationFactor7,AmortizationFactor8,AmortizationFactor9 -GicComplex,0.8,Monthly,Uniform,N, -DT1.1,0.8,Monthly,Uniform,N, -DT1.2,0.8,Monthly,Uniform,N, -DT1.3,1,Monthly,Uniform,N, -DT1.4,0.8,Monthly,Uniform,N, -DT1.5,0.8,Monthly,Uniform,N, -DT2.1,0.8,Monthly,Uniform,N, -DT2.2,0.8,Monthly,Uniform,N, -DT3.1,0.8,Monthly,Uniform,N, -DT4.1,0.8,Monthly,Uniform,N, +DataNode,PremiumAllocation, +GicComplex,0.8, +DT1.1,0.8, +DT1.2,0.8, +DT1.3,1, +DT1.4,0.8, +DT1.5,0.8, +DT2.1,0.8, +DT2.2,0.8, +DT3.1,0.8, +DT4.1,0.8, ,, @@InterDataNodeParameter,, DataNode,LinkedDataNode,ReinsuranceCoverage diff --git a/ifrs17-template/Files/DataNodes/DataNodeParameters_ES_2020_12.csv b/ifrs17-template/Files/DataNodes/DataNodeParameters_ES_2020_12.csv index a47ac355..e3bf89c8 100644 --- a/ifrs17-template/Files/DataNodes/DataNodeParameters_ES_2020_12.csv +++ b/ifrs17-template/Files/DataNodes/DataNodeParameters_ES_2020_12.csv @@ -3,16 +3,16 @@ ReportingNode,Year,Month ES,2020,12 ,, @@SingleDataNodeParameter,, -DataNode,PremiumAllocation,CashFlowPeriodicity,InterpolationMethod,EconomicBasisDriver,AmortizationFactor0,AmortizationFactor1,AmortizationFactor2,AmortizationFactor3,AmortizationFactor4,AmortizationFactor5,AmortizationFactor6,AmortizationFactor7,AmortizationFactor8,AmortizationFactor9 -3BBBA.0,1,Monthly,Uniform,N, -3BPAA.0,1,Monthly,Uniform,N, -3BBBA.1,1,Monthly,Uniform,N, -3BPAA.1,1,Monthly,Uniform,N, -3BBBA.2,1,Monthly,Uniform,N, -3BPAA.2,1,Monthly,Uniform,N, -3BBBA.3,1,Monthly,Uniform,N, -3BPAA.3,1,Monthly,Uniform,N, -3BBBA.4,1,Monthly,Uniform,N, -3BPAA.4,1,Monthly,Uniform,N, -3BBBA.5,1,Monthly,Uniform,N, -3BPAA.5,1,Monthly,Uniform,N, +DataNode,PremiumAllocation, +3BBBA.0,1, +3BPAA.0,1, +3BBBA.1,1, +3BPAA.1,1, +3BBBA.2,1, +3BPAA.2,1, +3BBBA.3,1, +3BPAA.3,1, +3BBBA.4,1, +3BPAA.4,1, +3BBBA.5,1, +3BPAA.5,1, diff --git a/ifrs17-template/Files/DataNodes/DataNodeParameters_FR_2020_12.csv b/ifrs17-template/Files/DataNodes/DataNodeParameters_FR_2020_12.csv index d9d15623..f02f1b4e 100644 --- a/ifrs17-template/Files/DataNodes/DataNodeParameters_FR_2020_12.csv +++ b/ifrs17-template/Files/DataNodes/DataNodeParameters_FR_2020_12.csv @@ -3,15 +3,15 @@ ReportingNode,Year,Month FR,2020,12 ,, @@SingleDataNodeParameter,, -DataNode,PremiumAllocation,CashFlowPeriodicity,InterpolationMethod,EconomicBasisDriver,AmortizationFactor0,AmortizationFactor1,AmortizationFactor2,AmortizationFactor3,AmortizationFactor4,AmortizationFactor5,AmortizationFactor6,AmortizationFactor7,AmortizationFactor8,AmortizationFactor9DataNode,PremiumAllocation, -EY52BBA.1,1,Monthly,Uniform,N, -EY52PPA.1,1,Monthly,Uniform,N, -EY57G.1,1,Monthly,Uniform,N, -EY58G.1,1,Monthly,Uniform,N, -EY58G.2,1,Monthly,Uniform,N, -EY59G.1,1,Monthly,Uniform,N, -EY59G.2,1,Monthly,Uniform,N, -EY63G.1,1,Monthly,Uniform,N, +DataNode,PremiumAllocation, +EY52BBA.1,1, +EY52PPA.1,1, +EY57G.1,1, +EY58G.1,1, +EY58G.2,1, +EY59G.1,1, +EY59G.2,1, +EY63G.1,1, ,, @@InterDataNodeParameter,, DataNode,LinkedDataNode,ReinsuranceCoverage From 6401188a92e497dbc09545728acac675f22c9b59 Mon Sep 17 00:00:00 2001 From: Slavomir Batka Date: Wed, 17 May 2023 18:25:54 +0200 Subject: [PATCH 17/55] add validations to new parameter items --- .../MigrationAndScaffolding/Initial.ipynb | 9 ++-- ifrs17/Constants/Validations.ipynb | 4 +- ifrs17/Import/Importers.ipynb | 42 ++++++++++++++++--- 3 files changed, 46 insertions(+), 9 deletions(-) diff --git a/ifrs17-template/Database/MigrationAndScaffolding/Initial.ipynb b/ifrs17-template/Database/MigrationAndScaffolding/Initial.ipynb index 2d41bce1..8c967a9d 100644 --- a/ifrs17-template/Database/MigrationAndScaffolding/Initial.ipynb +++ b/ifrs17-template/Database/MigrationAndScaffolding/Initial.ipynb @@ -37,7 +37,7 @@ { "cell_type": "code", "source": [ - "[Migration(\"20230425145745_InitialTypes\")]", + "[Migration(\"20230517142117_InitialTypes\")]", "\npublic class InitialTypes : Migration", "\n{", "\n protected override void Up(MigrationBuilder migrationBuilder)", @@ -162,7 +162,9 @@ "\n ReinsuranceCoverage = table.Column(type: \"float\", nullable: true),", "\n PremiumAllocation = table.Column(type: \"float\", nullable: true),", "\n CashFlowPeriodicity = table.Column(type: \"int\", nullable: true),", - "\n InterpolationMethod = table.Column(type: \"int\", nullable: true)", + "\n InterpolationMethod = table.Column(type: \"int\", nullable: true),", + "\n EconomicBasisDriver = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n AmortizationFactor = table.Column(type: \"varbinary(max)\", nullable: true)", "\n },", "\n constraints: table =>", "\n {", @@ -421,7 +423,8 @@ "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", "\n Shift = table.Column(type: \"int\", nullable: false),", "\n TimeStep = table.Column(type: \"int\", nullable: false),", - "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Order = table.Column(type: \"int\", nullable: false)", "\n },", "\n constraints: table =>", "\n {", diff --git a/ifrs17/Constants/Validations.ipynb b/ifrs17/Constants/Validations.ipynb index 31d6d12a..cb900aa2 100644 --- a/ifrs17/Constants/Validations.ipynb +++ b/ifrs17/Constants/Validations.ipynb @@ -76,7 +76,7 @@ "\n // Data Note State", "\n ChangeDataNodeState, InactiveDataNodeState,", "\n // Parameters", - "\n ReinsuranceCoverageDataNode, DuplicateInterDataNode, DuplicateSingleDataNode, InvalidDataNode, InvalidDataNodeForOpening, InvalidCashFlowPeriodicity, InvalidInterpolationMethod, InvalidEconomicBasisDriver,", + "\n ReinsuranceCoverageDataNode, DuplicateInterDataNode, DuplicateSingleDataNode, InvalidDataNode, InvalidDataNodeForOpening, InvalidCashFlowPeriodicity, InvalidInterpolationMethod, InvalidEconomicBasisDriver, InvalidAmortizationFactors,", "\n // Storage", "\n DataNodeNotFound, PartnerNotFound, RatingNotFound, CreditDefaultRateNotFound, MissingPremiumAllocation, ReinsuranceCoverage, ", "\n YieldCurveNotFound, YieldCurvePeriodNotApplicable, EconomicBasisNotFound, AccountingVariableTypeNotFound,", @@ -157,6 +157,8 @@ "\n (Error.InvalidCashFlowPeriodicity, 1) => $\"Single Data Node Parameter CashFlowPeriodicity for Data Node {s[0]} is invalid.\",", "\n (Error.InvalidInterpolationMethod, 1) => $\"Single Data Node Parameter InterpolationMethod for Data Node {s[0]} is invalid.\",", "\n (Error.InvalidEconomicBasisDriver, 1) => $\"Single Data Node Parameter EconomicBasisDriver for Data Node {s[0]} is invalid.\",", + "\n (Error.InvalidAmortizationFactors, 1) => $\"Single Data Node Parameters AmortizationFactors for Data Node {s[0]} are invalid.\",", + "\n ", "\n // Storage", "\n (Error.DataNodeNotFound , 1) => $\"DataNode {s[0]} not found.\",", "\n (Error.PartnerNotFound , 1) => $\"Partner not found for DataNode {s[0]}.\",", diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index 4f0b36ee..4d932eae 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -1165,6 +1165,7 @@ "\n var hasCashFlowPeriodicityColumn = dataSet.Tables[nameof(SingleDataNodeParameter)].Columns.Any(x => x.ColumnName == nameof(SingleDataNodeParameter.CashFlowPeriodicity));", "\n var hasInterpolationMethodColumn = dataSet.Tables[nameof(SingleDataNodeParameter)].Columns.Any(x => x.ColumnName == nameof(SingleDataNodeParameter.InterpolationMethod));", "\n var hasEconomicBasisDriver = dataSet.Tables[nameof(SingleDataNodeParameter)].Columns.Any(x => x.ColumnName == nameof(SingleDataNodeParameter.EconomicBasisDriver));", + "\n var hasAmortizationFactors = dataSet.Tables[nameof(SingleDataNodeParameter)].Columns.Any(x => x.ColumnName.StartsWith(nameof(SingleDataNodeParameter.AmortizationFactor)));", "\n", "\n var importLog = await Import.FromDataSet(dataSet)", "\n .WithType( (dataset, datarow) => {", @@ -1190,10 +1191,31 @@ "\n if ( Enum.TryParse(interpolationMethodInput, out InterpolationMethod ipm)) ", "\n interpolationMethod = ipm;", "\n else if ( !(periodicity == (CashFlowPeriodicity)default && string.IsNullOrEmpty(interpolationMethodInput)) ) { ApplicationMessage.Log(Error.InvalidInterpolationMethod, dataNode); return null; }", - "\n }", - "\n", - "\n var amortizationFactors = datarow.Table.Columns.Where(c => c.ColumnName.StartsWith(nameof(SingleDataNodeParameter.AmortizationFactor))).OrderBy(c => c.ColumnName.Length).ThenBy(c => c.ColumnName)", - "\n .Select(x => datarow.Field(x.ColumnName).CheckStringForExponentialAndConvertToDouble()).ToArray().Prune();", + "\n }", + "\n", + "\n string economicBasisDriver = default;", + "\n if(hasEconomicBasisDriver)", + "\n {", + "\n var economicBasisDriverInput = datarow.Field(nameof(SingleDataNodeParameter.EconomicBasisDriver));", + "\n if (!string.IsNullOrEmpty(economicBasisDriverInput))", + "\n economicBasisDriver = economicBasisDriverInput;", + "\n else { ApplicationMessage.Log(Error.InvalidEconomicBasisDriver, dataNode); return null; }", + "\n }", + "\n ", + "\n double[] amortizationFactors = default;", + "\n if(hasAmortizationFactors)", + "\n {", + "\n var amortizationFactorsInput = datarow.Table.Columns", + "\n .Where(c => c.ColumnName.StartsWith(nameof(SingleDataNodeParameter.AmortizationFactor)))", + "\n .OrderBy(c => c.ColumnName.Length).ThenBy(c => c.ColumnName)", + "\n .Select(x => datarow.Field(x.ColumnName).CheckStringForExponentialAndConvertToDouble())", + "\n .ToArray()", + "\n .Prune();", + "\n", + "\n if (amortizationFactorsInput.Any())", + "\n amortizationFactors = amortizationFactorsInput;", + "\n else { ApplicationMessage.Log(Error.InvalidAmortizationFactors, dataNode); return null; }", + "\n }", "\n ", "\n //Instantiate SingleDataNodeParameter", "\n return new SingleDataNodeParameter {", @@ -1204,7 +1226,7 @@ "\n DataNode = dataNode,", "\n CashFlowPeriodicity = periodicity,", "\n InterpolationMethod = interpolationMethod,", - "\n EconomicBasisDriver = datarow.Field(nameof(SingleDataNodeParameter.EconomicBasisDriver)) ?? EconomicBases.N,", + "\n EconomicBasisDriver = economicBasisDriver,", "\n AmortizationFactor = amortizationFactors,", "\n PremiumAllocation = (datarow.Field(nameof(SingleDataNodeParameter.PremiumAllocation)))", "\n .ToString().CheckStringForExponentialAndConvertToDouble(),", @@ -1255,6 +1277,16 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "code", + "source": [ + "double?[] amortizationFactorsInput = {};", + "\namortizationFactorsInput.Any()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ From e0d659f14dc817576b3f9d79224fa10267129545 Mon Sep 17 00:00:00 2001 From: Slavomir Batka Date: Wed, 17 May 2023 18:26:15 +0200 Subject: [PATCH 18/55] add ContractDuration to data model --- ifrs17/DataModel/DataStructure.ipynb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ifrs17/DataModel/DataStructure.ipynb b/ifrs17/DataModel/DataStructure.ipynb index be07686d..43f8f20a 100644 --- a/ifrs17/DataModel/DataStructure.ipynb +++ b/ifrs17/DataModel/DataStructure.ipynb @@ -1447,6 +1447,8 @@ "\n public string YieldCurveName { get; init; }", "\n ", "\n public virtual string Partner { get; init; }", + "\n", + "\n public int ContractDuration { get; init; }", "\n}" ], "metadata": {}, From 6aad3420245731ab160080c1e7e5c9f8a4387a8e Mon Sep 17 00:00:00 2001 From: Slavomir Batka Date: Wed, 17 May 2023 18:45:41 +0200 Subject: [PATCH 19/55] adapt data model --- ifrs17-template/Database/MigrationAndScaffolding/Initial.ipynb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ifrs17-template/Database/MigrationAndScaffolding/Initial.ipynb b/ifrs17-template/Database/MigrationAndScaffolding/Initial.ipynb index 8c967a9d..6bd15990 100644 --- a/ifrs17-template/Database/MigrationAndScaffolding/Initial.ipynb +++ b/ifrs17-template/Database/MigrationAndScaffolding/Initial.ipynb @@ -37,7 +37,7 @@ { "cell_type": "code", "source": [ - "[Migration(\"20230517142117_InitialTypes\")]", + "[Migration(\"20230517163443_InitialTypes\")]", "\npublic class InitialTypes : Migration", "\n{", "\n protected override void Up(MigrationBuilder migrationBuilder)", @@ -140,6 +140,7 @@ "\n Portfolio = table.Column(type: \"nvarchar(max)\", nullable: true),", "\n YieldCurveName = table.Column(type: \"nvarchar(max)\", nullable: true),", "\n Partner = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n ContractDuration = table.Column(type: \"int\", nullable: true),", "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true)", "\n },", "\n constraints: table =>", From 4db3cc3d831613de609dce6272ab13fd4ee81f9c Mon Sep 17 00:00:00 2001 From: Slavomir Batka Date: Wed, 17 May 2023 18:54:16 +0200 Subject: [PATCH 20/55] adapt UnitTests for new Parameters (not passing yet) --- .../Data/DataNodeParameter_InvalidParameters.csv | 15 +++++++++------ .../Test/MapTemplateAndImportTest.ipynb | 16 ++++++---------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/ifrs17-template/Test/Data/DataNodeParameter_InvalidParameters.csv b/ifrs17-template/Test/Data/DataNodeParameter_InvalidParameters.csv index 00108a5f..72b25fc1 100644 --- a/ifrs17-template/Test/Data/DataNodeParameter_InvalidParameters.csv +++ b/ifrs17-template/Test/Data/DataNodeParameter_InvalidParameters.csv @@ -3,12 +3,15 @@ ReportingNode,Year,Month CH,2020,12 @@SingleDataNodeParameter -DataNode,PremiumAllocation,CashFlowPeriodicity,InterpolationMethod -DT1.1,0.9,Monthly,InvalidEntry -DT1.2,0.85,InvalidEntry,Uniform -DT1.3,0.9,,Uniform -DT1.4,0.85,Monthly, -DT1.5,0.9,Yearly, +DataNode,PremiumAllocation,CashFlowPeriodicity,InterpolationMethod,EconomicBasisDriver +DT1.1,0.9,Monthly,InvalidEntry,L +DT1.2,0.85,InvalidEntry,Uniform,N +DT1.3,0.9,,Uniform,C +DT1.4,0.85,Monthly,,N +DT1.5,0.9,Yearly,,L +DT1.6,0.85,Monthly,Uniform,InvalidEntry +DT1.7,0.85,Monthly,Uniform, + @@InterDataNodeParameter DataNode,LinkedDataNode,ReinsuranceCoverage diff --git a/ifrs17-template/Test/MapTemplateAndImportTest.ipynb b/ifrs17-template/Test/MapTemplateAndImportTest.ipynb index 4702c3dd..14649308 100644 --- a/ifrs17-template/Test/MapTemplateAndImportTest.ipynb +++ b/ifrs17-template/Test/MapTemplateAndImportTest.ipynb @@ -701,22 +701,18 @@ "\nvar errorsBm = new List(){Get(Error.InvalidInterpolationMethod, \"DT1.1\"), ", "\n Get(Error.InvalidCashFlowPeriodicity, \"DT1.2\"),", "\n Get(Error.InvalidCashFlowPeriodicity, \"DT1.3\"),", - "\n Get(Error.InvalidInterpolationMethod, \"DT1.5\")};", + "\n Get(Error.InvalidInterpolationMethod, \"DT1.4\"),", + "\n Get(Error.InvalidInterpolationMethod, \"DT1.5\"),", + "\n Get(Error.InvalidEconomicBasisDriver, \"DT1.6\"),", + "\n Get(Error.InvalidEconomicBasisDriver, \"DT1.7\"),", + "\n ", + "\n };", "\nvar activity = await CheckErrors(inputFileName, errorsBm, ws5);", "\nactivity" ], "metadata": {}, "execution_count": 0, "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] } ] } \ No newline at end of file From 07f3115bcdf07e32e7d8a398f8df9ccec1cc0ecd Mon Sep 17 00:00:00 2001 From: Slavomir Batka Date: Wed, 17 May 2023 19:07:13 +0200 Subject: [PATCH 21/55] some documentation --- ifrs17/DataModel/DataStructure.ipynb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ifrs17/DataModel/DataStructure.ipynb b/ifrs17/DataModel/DataStructure.ipynb index 43f8f20a..eb2d7930 100644 --- a/ifrs17/DataModel/DataStructure.ipynb +++ b/ifrs17/DataModel/DataStructure.ipynb @@ -1561,9 +1561,17 @@ "\n## Data Node Parameters", "\n", "\nData Node Parameters are used to keep track of other parameters pertaining to each Data Node, and their movements in time (year and month).", + "\n", "\n
PremiumAllocation : defines the weight of Premium to be included in the Experience Adjustement AoC Type of the Technical Margin and is valid only for Group of Insurance Contract with LiabilityType : Liability for Remaining Coverage.", + "\n", "\n
CashFlowPeriodicity : defines the periodicity of the provided cash flows, it is not a mandatory input. Supported values can be found [here](../Constants/Enums#cashflowperiodicity). When the column *CashFlowPeriodicity* is missing from the input file it is assumed a monthly periodicity (default value). When the *CashFlowPeriodicity* column is present, a valid value must be entered. ", + "\n", "\n
InterpolationMethod : defines the interpolation method to be applied to interpolate the cash flow to the monthly granularity, it is not a mandatory input. Supported values can be found [here](../Constants/Enums#interpolation-method). When the *InterpolationMethod* is not present in the input file or the *CashFlowPeriodicity* has the default value, then the default value for the *InterpolationMethod* is applied. The default value is Not Applicable. ", + "\n", + "\n
Amortization Pattern : defines the pattern of factors that will be used to defer and amortize any AmountType over the course of contract term. It is not a mandatory input. Note this pattern is the fallback if no *Amortizaltion Pattern* is provided in the Cashflows, specified by AmountType and EstimateType.", + "\n", + "\n
EconomicBasisDriver : defines the economic basis sthat will be used to discounting of any Amortization Pattern. It is not a mandatory input. Supported values can be found [here](../Constants/Enums#economic-basis). When the *EconomicBasisDriver* is not present in the input file, then the default value for the *EconomicBasisDriver* is applied. The default value is \"Nominal\" (ie no discounting applied).", + "\n", "\n
ReinsuranceCoverage : defines the weight of the underlying gross business to be considered in the computation of the allocation of the Technical Margin in a Reinsurance case. In other words, it represents the percentage to which claims in the underlying GICs are expected to be reinboursed by the Reinsurance Contracts belonging to the GRIC. For proportional contracts, this factor is given by the cession while for other contracts it should be estimated. ", "\n", "\nThe latest Data Node Parameters available in the system with Year and Month earlier or equal to Year and Month of the closing period will be used as the current value during calculation." From 23ce6b052a4cb563de20ac4908b90efad0b82415 Mon Sep 17 00:00:00 2001 From: Slavomir Batka Date: Wed, 17 May 2023 19:23:03 +0200 Subject: [PATCH 22/55] bit more --- ifrs17/Import/ImportStorage.ipynb | 2 +- ifrs17/Utils/ImportCalculationMethods.ipynb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ifrs17/Import/ImportStorage.ipynb b/ifrs17/Import/ImportStorage.ipynb index 0caf69d2..91b6f945 100644 --- a/ifrs17/Import/ImportStorage.ipynb +++ b/ifrs17/Import/ImportStorage.ipynb @@ -370,7 +370,7 @@ "\n public double GetPremiumAllocationFactor(ImportIdentity id) => SingleDataNodeParametersByGoc.TryGetValue(id.DataNode, out var singleDataNodeParameter) ", "\n ? singleDataNodeParameter[CurrentPeriod].PremiumAllocation : DefaultPremiumExperienceAdjustmentFactor;", "\n", - "\n public double[] GetAmortizationFactor(ImportIdentity id) => SingleDataNodeParametersByGoc.TryGetValue(id.DataNode, out var singleDataNodeParameter) ", + "\n public double[] GetAmortizationFactor(ImportIdentity id, string amountType) => SingleDataNodeParametersByGoc.TryGetValue(id.DataNode, out var singleDataNodeParameter) ", "\n ? singleDataNodeParameter[CurrentPeriod].AmortizationFactor : default;", "\n", "\n ", diff --git a/ifrs17/Utils/ImportCalculationMethods.ipynb b/ifrs17/Utils/ImportCalculationMethods.ipynb index edc4dd8a..33df796d 100644 --- a/ifrs17/Utils/ImportCalculationMethods.ipynb +++ b/ifrs17/Utils/ImportCalculationMethods.ipynb @@ -227,7 +227,7 @@ "source": [ "public static double[] Interpolate(this double[] cashflowValues, string amountType, CashFlowPeriodicity periodicity, InterpolationMethod interpolationMethod)", "\n{ ", - "\n if (periodicity == CashFlowPeriodicity.Monthly || (amountType == AmountTypes.ACA || amountType == AmountTypes.AEA)) // TODO remove hardcoding!!", + "\n if (periodicity == CashFlowPeriodicity.Monthly)", "\n return cashflowValues;", "\n ", "\n var frequency = periodicity switch {", From a9594c593352902542ad8ccf50eaf5c014e79a44 Mon Sep 17 00:00:00 2001 From: Slavomir Batka Date: Wed, 17 May 2023 19:33:29 +0200 Subject: [PATCH 23/55] fix signature of Interpolate method --- ifrs17/Import/Importers.ipynb | 12 +----------- ifrs17/Test/AggregateInterpolateTest.ipynb | 10 +++++----- ifrs17/Utils/ImportCalculationMethods.ipynb | 2 +- 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index 4d932eae..eefdeff0 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -1277,16 +1277,6 @@ "execution_count": 0, "outputs": [] }, - { - "cell_type": "code", - "source": [ - "double?[] amortizationFactorsInput = {};", - "\namortizationFactorsInput.Any()" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, { "cell_type": "code", "source": [ @@ -1417,7 +1407,7 @@ "\n : (int?)null,", "\n Partition = parsingStorage.TargetPartitionByReportingNodeAndPeriod.Id,", "\n Values = Multiply(GetSign(ImportFormats.Cashflow, (aocType, valueType.AmountType, valueType.EstimateType, dataNodeData.IsReinsurance), parsingStorage.HierarchyCache), values)", - "\n .Interpolate(valueType.AmountType, parsingStorage.GetCashFlowPeriodicity(dataNode), parsingStorage.GetInterpolationMethod(dataNode))", + "\n .Interpolate(parsingStorage.GetCashFlowPeriodicity(dataNode), parsingStorage.GetInterpolationMethod(dataNode))", "\n };", "\n return item;", "\n }, ImportFormats.Cashflow", diff --git a/ifrs17/Test/AggregateInterpolateTest.ipynb b/ifrs17/Test/AggregateInterpolateTest.ipynb index da1410a1..c21656c2 100644 --- a/ifrs17/Test/AggregateInterpolateTest.ipynb +++ b/ifrs17/Test/AggregateInterpolateTest.ipynb @@ -150,7 +150,7 @@ "cell_type": "code", "source": [ "var cashflow = new double [] {120, 180} ;", - "\nvar yearly = cashflow.Interpolate( AmountTypes.PR, CashFlowPeriodicity.Yearly, InterpolationMethod.Uniform);", + "\nvar yearly = cashflow.Interpolate(CashFlowPeriodicity.Yearly, InterpolationMethod.Uniform);", "\n(yearly[0], yearly[11], yearly[12], yearly[23]).Should().Be((10, 10, 15, 15));" ], "metadata": {}, @@ -160,7 +160,7 @@ { "cell_type": "code", "source": [ - "var quarterly = cashflow.Interpolate(AmountTypes.PR, CashFlowPeriodicity.Quarterly, InterpolationMethod.Uniform);", + "var quarterly = cashflow.Interpolate(CashFlowPeriodicity.Quarterly, InterpolationMethod.Uniform);", "\n(quarterly[0], quarterly[3], quarterly[4], quarterly[6]).Should().Be((30, 30, 45, 45));" ], "metadata": {}, @@ -170,7 +170,7 @@ { "cell_type": "code", "source": [ - "var monthly = cashflow.Interpolate(AmountTypes.PR, CashFlowPeriodicity.Monthly, InterpolationMethod.Uniform);", + "var monthly = cashflow.Interpolate(CashFlowPeriodicity.Monthly, InterpolationMethod.Uniform);", "\n(monthly[0], monthly[1]).Should().Be((120,180));" ], "metadata": {}, @@ -189,7 +189,7 @@ { "cell_type": "code", "source": [ - "var yearly = cashflow.Interpolate(AmountTypes.PR, CashFlowPeriodicity.Yearly, InterpolationMethod.Start);", + "var yearly = cashflow.Interpolate(CashFlowPeriodicity.Yearly, InterpolationMethod.Start);", "\n(yearly[0], yearly[11], yearly[12], yearly[23]).Should().Be((120, 0, 180, 0));" ], "metadata": {}, @@ -208,7 +208,7 @@ { "cell_type": "code", "source": [ - "var yearly = cashflow.Interpolate(AmountTypes.PR, CashFlowPeriodicity.Yearly, InterpolationMethod.NotApplicable);", + "var yearly = cashflow.Interpolate(CashFlowPeriodicity.Yearly, InterpolationMethod.NotApplicable);", "\n(yearly[0], yearly[11], yearly[12], yearly[23]).Should().Be((10, 10, 15, 15));" ], "metadata": {}, diff --git a/ifrs17/Utils/ImportCalculationMethods.ipynb b/ifrs17/Utils/ImportCalculationMethods.ipynb index 33df796d..384ccdae 100644 --- a/ifrs17/Utils/ImportCalculationMethods.ipynb +++ b/ifrs17/Utils/ImportCalculationMethods.ipynb @@ -225,7 +225,7 @@ { "cell_type": "code", "source": [ - "public static double[] Interpolate(this double[] cashflowValues, string amountType, CashFlowPeriodicity periodicity, InterpolationMethod interpolationMethod)", + "public static double[] Interpolate(this double[] cashflowValues, CashFlowPeriodicity periodicity, InterpolationMethod interpolationMethod)", "\n{ ", "\n if (periodicity == CashFlowPeriodicity.Monthly)", "\n return cashflowValues;", From aa1066de7d337f9d71f4ff253005ed848f237535 Mon Sep 17 00:00:00 2001 From: Davide Colleoni Date: Mon, 22 May 2023 08:37:08 +0200 Subject: [PATCH 24/55] on importers and tests --- ifrs17/Constants/Validations.ipynb | 8 +- ifrs17/DataModel/DataStructure.ipynb | 4 +- ifrs17/Import/Importers.ipynb | 40 +- .../Test/DataNodeImporterValidationTest.ipynb | 691 ++++++++++++++++++ ifrs17/Test/TestData.ipynb | 27 +- 5 files changed, 746 insertions(+), 24 deletions(-) create mode 100644 ifrs17/Test/DataNodeImporterValidationTest.ipynb diff --git a/ifrs17/Constants/Validations.ipynb b/ifrs17/Constants/Validations.ipynb index cb900aa2..5b85122f 100644 --- a/ifrs17/Constants/Validations.ipynb +++ b/ifrs17/Constants/Validations.ipynb @@ -154,10 +154,10 @@ "\n (Error.DuplicateSingleDataNode , 1) => $\"Duplicated Single-DataNode parameter for {s[0]} is found.\",", "\n (Error.InvalidDataNode , 1) => $\"Data imported for invalid Data Node {s[0]}.\",", "\n (Error.InvalidDataNodeForOpening , 1) => $\"Data imported for invalid Data Node or for a Data Node after its inception year {s[0]}.\",", - "\n (Error.InvalidCashFlowPeriodicity, 1) => $\"Single Data Node Parameter CashFlowPeriodicity for Data Node {s[0]} is invalid.\",", - "\n (Error.InvalidInterpolationMethod, 1) => $\"Single Data Node Parameter InterpolationMethod for Data Node {s[0]} is invalid.\",", - "\n (Error.InvalidEconomicBasisDriver, 1) => $\"Single Data Node Parameter EconomicBasisDriver for Data Node {s[0]} is invalid.\",", - "\n (Error.InvalidAmortizationFactors, 1) => $\"Single Data Node Parameters AmortizationFactors for Data Node {s[0]} are invalid.\",", + "\n (Error.InvalidCashFlowPeriodicity , 1) => $\"Invalid CashFlowPeriodicity parameter for Data Node {s[0]}.\",", + "\n (Error.InvalidInterpolationMethod , 1) => $\"Invalid InterpolationMethod parameter for Data Node {s[0]}.\",", + "\n (Error.InvalidEconomicBasisDriver , 1) => $\"Invalid EconomicBasisDriver parameter for Data Node {s[0]}.\",", + "\n (Error.InvalidAmortizationFactors , 1) => $\"Invalid AmortizationFactor parameters for Data Node {s[0]}.\",", "\n ", "\n // Storage", "\n (Error.DataNodeNotFound , 1) => $\"DataNode {s[0]} not found.\",", diff --git a/ifrs17/DataModel/DataStructure.ipynb b/ifrs17/DataModel/DataStructure.ipynb index eb2d7930..1391da26 100644 --- a/ifrs17/DataModel/DataStructure.ipynb +++ b/ifrs17/DataModel/DataStructure.ipynb @@ -1447,8 +1447,6 @@ "\n public string YieldCurveName { get; init; }", "\n ", "\n public virtual string Partner { get; init; }", - "\n", - "\n public int ContractDuration { get; init; }", "\n}" ], "metadata": {}, @@ -1570,7 +1568,7 @@ "\n", "\n
Amortization Pattern : defines the pattern of factors that will be used to defer and amortize any AmountType over the course of contract term. It is not a mandatory input. Note this pattern is the fallback if no *Amortizaltion Pattern* is provided in the Cashflows, specified by AmountType and EstimateType.", "\n", - "\n
EconomicBasisDriver : defines the economic basis sthat will be used to discounting of any Amortization Pattern. It is not a mandatory input. Supported values can be found [here](../Constants/Enums#economic-basis). When the *EconomicBasisDriver* is not present in the input file, then the default value for the *EconomicBasisDriver* is applied. The default value is \"Nominal\" (ie no discounting applied).", + "\n
EconomicBasisDriver : defines the economic basis that will be used in discounting any Amortization Pattern. It is not a mandatory input. Supported values are the defined values for [EconomicBasis](#economic-basis). When the *EconomicBasisDriver* is not present in the input file, then the default value for the *EconomicBasisDriver* is applied. The default value is *Locked-in* rates for Building Block Approach, *Current* rates for Variable Fee Approach and Premium Allocation Approach for liabilities of incurred claims and *Nominal* for Premium Allocation Approach for liabilities of remaining coverage.", "\n", "\n
ReinsuranceCoverage : defines the weight of the underlying gross business to be considered in the computation of the allocation of the Technical Margin in a Reinsurance case. In other words, it represents the percentage to which claims in the underlying GICs are expected to be reinboursed by the Reinsurance Contracts belonging to the GRIC. For proportional contracts, this factor is given by the cession while for other contracts it should be estimated. ", "\n", diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index eefdeff0..9d475348 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -71,6 +71,7 @@ "\n public HashSet AocTypeMap;", "\n private HashSet estimateTypes;", "\n private HashSet amountTypes;", + "\n private HashSet economicBasis;", "\n private Dictionary> amountTypesByEstimateType => GetAmountTypesByEstimateType(HierarchyCache);", "\n public HashSet TechnicalMarginEstimateTypes => GetTechnicalMarginEstimateType(); ", "\n public Dictionary> DimensionsWithExternalId;", @@ -149,6 +150,7 @@ "\n EstimateType = (await dataSource.Query().ToArrayAsync()).ToDictionary(x => x.SystemName);", "\n AmountType = (await dataSource.Query().Where(x =>!(x is DeferrableAmountType)).ToArrayAsync()).ToDictionary(x => x.SystemName);", "\n amountTypes = (await dataSource.Query().ToArrayAsync()).Select(at => at.SystemName).ToHashSet();", + "\n economicBasis = (await dataSource.Query().ToArrayAsync()).Select(eb => eb.SystemName).ToHashSet();", "\n estimateTypes = args.ImportFormat switch {", "\n ImportFormats.SimpleValue => (await dataSource.Query().ToArrayAsync()).Select(et => et.SystemName).ToHashSet(),", "\n ImportFormats.Opening => (await dataSource.Query().Where(et => et.StructureType == StructureType.AoC).ToArrayAsync())", @@ -239,6 +241,21 @@ "\n if (amountTypesByEstimateType.TryGetValue(estimateType, out var ats) && ats.Any() && !ats.Contains(amountType))", "\n ApplicationMessage.Log(Error.InvalidAmountTypeEstimateType, estimateType, amountType);", "\n }", + "\n", + "\n public string ValidateEconomicBasisDriver(string eb, string goc){", + "\n if(string.IsNullOrEmpty(eb))", + "\n return (DataNodeDataBySystemName[goc].ValuationApproach, DataNodeDataBySystemName[goc].LiabilityType) switch {", + "\n (ValuationApproaches.BBA, _) => EconomicBases.L,", + "\n (ValuationApproaches.VFA, _) => EconomicBases.C,", + "\n (ValuationApproaches.PAA, LiabilityTypes.LIC) => EconomicBases.C,", + "\n _ => EconomicBases.N,", + "\n };", + "\n if(!economicBasis.Contains(eb)){", + "\n ApplicationMessage.Log(Error.InvalidEconomicBasisDriver, goc);", + "\n return null;", + "\n }", + "\n return eb;", + "\n }", "\n}" ], "metadata": {}, @@ -1195,27 +1212,20 @@ "\n", "\n string economicBasisDriver = default;", "\n if(hasEconomicBasisDriver)", - "\n {", - "\n var economicBasisDriverInput = datarow.Field(nameof(SingleDataNodeParameter.EconomicBasisDriver));", - "\n if (!string.IsNullOrEmpty(economicBasisDriverInput))", - "\n economicBasisDriver = economicBasisDriverInput;", - "\n else { ApplicationMessage.Log(Error.InvalidEconomicBasisDriver, dataNode); return null; }", - "\n }", + "\n economicBasisDriver = storage.ValidateEconomicBasisDriver(datarow.Field(nameof(SingleDataNodeParameter.EconomicBasisDriver)), dataNode);", + "\n // var economicBasisDriverInput = datarow.Field(nameof(SingleDataNodeParameter.EconomicBasisDriver));", + "\n // if (string.IsNullOrEmpty(economicBasisDriverInput) && S)", + "\n // economicBasisDriver = economicBasisDriverInput;", + "\n // else { ApplicationMessage.Log(Error.InvalidEconomicBasisDriver, dataNode); return null; }", + "\n ", "\n ", "\n double[] amortizationFactors = default;", "\n if(hasAmortizationFactors)", - "\n {", - "\n var amortizationFactorsInput = datarow.Table.Columns", + "\n amortizationFactors = datarow.Table.Columns", "\n .Where(c => c.ColumnName.StartsWith(nameof(SingleDataNodeParameter.AmortizationFactor)))", "\n .OrderBy(c => c.ColumnName.Length).ThenBy(c => c.ColumnName)", "\n .Select(x => datarow.Field(x.ColumnName).CheckStringForExponentialAndConvertToDouble())", - "\n .ToArray()", - "\n .Prune();", - "\n", - "\n if (amortizationFactorsInput.Any())", - "\n amortizationFactors = amortizationFactorsInput;", - "\n else { ApplicationMessage.Log(Error.InvalidAmortizationFactors, dataNode); return null; }", - "\n }", + "\n .ToArray().Prune();", "\n ", "\n //Instantiate SingleDataNodeParameter", "\n return new SingleDataNodeParameter {", diff --git a/ifrs17/Test/DataNodeImporterValidationTest.ipynb b/ifrs17/Test/DataNodeImporterValidationTest.ipynb new file mode 100644 index 00000000..177150c6 --- /dev/null +++ b/ifrs17/Test/DataNodeImporterValidationTest.ipynb @@ -0,0 +1,691 @@ +{ + "metadata": { + "authors": [], + "id": "NpyHCIZoQUC0-mOcSyoLvw", + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "

Test DataNode Validation

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!import \"../Import/Importers\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!import \"TestData\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Workspace Initialization " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromString(novelties).WithType().WithTarget(DataSource).ExecuteAsync();", + "\nawait Import.FromString(canonicalAocTypes).WithType().WithTarget(DataSource).ExecuteAsync();", + "\nawait Import.FromString(canonicalAocConfig).WithFormat(ImportFormats.AocConfiguration).WithTarget(DataSource).ExecuteAsync();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await DataSource.UpdateAsync(reportingNodeG.RepeatOnce());", + "\nawait DataSource.UpdateAsync(dt1.RepeatOnce());", + "\nawait DataSource.UpdateAsync(dtr1.RepeatOnce());", + "\nawait DataSource.UpdateAsync(new [] {dt11});", + "\nawait DataSource.UpdateAsync(new [] {dtr11});" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await DataSource.UpdateAsync(new [ ] {dt11State,dtr11State});", + "\n// await DataSource.UpdateAsync(new [ ] {dt11Inter});" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromString(estimateType).WithType().WithTarget(DataSource).ExecuteAsync();", + "\nawait Import.FromString(economicBasis).WithType().WithTarget(DataSource).ExecuteAsync();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await DataSource.UpdateAsync(new [ ] {yieldCurvePrevious});" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await DataSource.UpdateAsync(new[]{partition, previousPeriodPartition});", + "\nawait DataSource.UpdateAsync(new[]{partitionReportingNode});" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "Workspace.Initialize(x => x.FromSource(DataSource).DisableInitialization().DisableInitialization());" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Test" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public async Task TestValidation(string inputFile, List errorBms){", + "\n var ws = Workspace.CreateNew();", + "\n ws.InitializeFrom(DataSource);", + "\n Activity.Start();", + "\n var log = await Import.FromString(inputFile).WithFormat(ImportFormats.DataNodeParameter).WithTarget(ws).ExecuteAsync();", + "\n log.Errors.Count().Should().Be(errorBms.Count());", + "\n errorBms.Intersect(log.Errors.Select(x => x.ToString().Substring(0,x.ToString().Length-2).Substring(40)).ToArray()).Count().Should().Be(errorBms.Count());", + "\n return Activity.Finish();", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Use Cases" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Invalid DataNode in Single and Inter Parameter" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var inputFile = ", + "\n@\"@@Main", + "\nReportingNode,Year,Month", + "\nCH,2020,12", + "\n", + "\n@@SingleDataNodeParameter", + "\nDataNode,PremiumAllocation,CashFlowPeriodicity,InterpolationMethod", + "\nDT1.1,0.9,Monthly,Uniform", + "\nDataNodeInvalid0,0.85,Monthly,Uniform", + "\n", + "\n@@InterDataNodeParameter", + "\nDataNode,LinkedDataNode,ReinsuranceCoverage", + "\nDTR1.1,DT1.1,1", + "\nDataNodeInvalid1,DTR1.1,1", + "\nDTR1.1,DataNodeInvalid2,1\";", + "\n", + "\nvar errorsBm = new List(){Get(Error.InvalidDataNode, \"DataNodeInvalid0\"),", + "\n Get(Error.InvalidDataNode, \"DataNodeInvalid1\"),", + "\n Get(Error.InvalidDataNode, \"DataNodeInvalid2\")};" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var activity = await TestValidation(inputFile, errorsBm);", + "\nactivity" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Duplicated DataNode" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var inputFile = ", + "\n@\"@@Main", + "\nReportingNode,Year,Month", + "\nCH,2020,12", + "\n", + "\n@@SingleDataNodeParameter", + "\nDataNode,PremiumAllocation", + "\nDT1.1,0.9", + "\nDT1.1,0.9", + "\n", + "\n@@InterDataNodeParameter", + "\nDataNode,LinkedDataNode,ReinsuranceCoverage", + "\nDTR1.1,DT1.1,1", + "\nDT1.1,DTR1.1,1", + "\n\";", + "\nvar errorsBm = new List(){Get(Error.DuplicateSingleDataNode, \"DT1.1\"),", + "\n Get(Error.DuplicateInterDataNode, \"DT1.1\",\"DTR1.1\"),};" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var activity = await TestValidation(inputFile, errorsBm);", + "\nactivity" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Reinsurance Coverage" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var inputFile = ", + "\n@\"", + "\n@@Main", + "\nReportingNode,Year,Month", + "\nCH,2020,12", + "\n", + "\n@@SingleDataNodeParameter", + "\nDataNode,PremiumAllocation,", + "\nDT1.1,0.85,", + "\n@@InterDataNodeParameter", + "\nDataNode,LinkedDataNode,ReinsuranceCoverage", + "\nDT1.1,DT1.1,1", + "\n\";", + "\nvar errorsBm = new List(){Get(Error.ReinsuranceCoverageDataNode, \"DT1.1\",\"DT1.1\")};" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var activity = await TestValidation(inputFile, errorsBm);", + "\nactivity" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Interpolation Method" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "### Wrong value fails" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var inputFile = ", + "\n@\"@@Main", + "\nReportingNode,Year,Month", + "\nCH,2020,12", + "\n", + "\n@@SingleDataNodeParameter", + "\nDataNode,PremiumAllocation,CashFlowPeriodicity,InterpolationMethod", + "\nDT1.1,0.85,Monthly,InvalidEntry", + "\n\";", + "\nvar errorsBm = new List(){Get(Error.InvalidInterpolationMethod, \"DT1.1\"),};" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var activity = await TestValidation(inputFile, errorsBm);", + "\nactivity" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "### Null value passes when interpolation is required " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var inputFile = ", + "\n@\"@@Main", + "\nReportingNode,Year,Month", + "\nCH,2020,12", + "\n", + "\n@@SingleDataNodeParameter", + "\nDataNode,PremiumAllocation,CashFlowPeriodicity,InterpolationMethod", + "\nDT1.1,0.85,Monthly,,", + "\n\";", + "\nvar errorsBm = new List(){};//Get(Error.InvalidInterpolationMethod, \"DT1.1\"),};" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var activity = await TestValidation(inputFile, errorsBm);", + "\nactivity" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "### Null value is not accepted when interpolation is required" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var inputFile = ", + "\n@\"@@Main", + "\nReportingNode,Year,Month", + "\nCH,2020,12", + "\n", + "\n@@SingleDataNodeParameter", + "\nDataNode,PremiumAllocation,CashFlowPeriodicity,InterpolationMethod", + "\nDT1.1,0.85,Yearly,,", + "\n\";", + "\nvar errorsBm = new List(){Get(Error.InvalidInterpolationMethod, \"DT1.1\"),};" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var activity = await TestValidation(inputFile, errorsBm);", + "\nactivity" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## CashFlow Periodicity" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "### Wrong Value" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var inputFile = ", + "\n@\"@@Main", + "\nReportingNode,Year,Month", + "\nCH,2020,12", + "\n", + "\n@@SingleDataNodeParameter", + "\nDataNode,PremiumAllocation,CashFlowPeriodicity,InterpolationMethod", + "\nDT1.1,0.85,A,,", + "\n\";", + "\nvar errorsBm = new List(){Get(Error.InvalidCashFlowPeriodicity, \"DT1.1\"),};" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var activity = await TestValidation(inputFile, errorsBm);", + "\nactivity" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "### Null value with a valid interpolation " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var inputFile = ", + "\n@\"@@Main", + "\nReportingNode,Year,Month", + "\nCH,2020,12", + "\n", + "\n@@SingleDataNodeParameter", + "\nDataNode,PremiumAllocation,CashFlowPeriodicity,InterpolationMethod", + "\nDT1.1,0.85,,Uniform,", + "\n\";", + "\nvar errorsBm = new List(){Get(Error.InvalidCashFlowPeriodicity, \"DT1.1\"),};" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var activity = await TestValidation(inputFile, errorsBm);", + "\nactivity" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "### Null value is accepted when interpolation method is also null" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var inputFile = ", + "\n@\"@@Main", + "\nReportingNode,Year,Month", + "\nCH,2020,12", + "\n", + "\n@@SingleDataNodeParameter", + "\nDataNode,PremiumAllocation,CashFlowPeriodicity,InterpolationMethod", + "\nDT1.1,0.85,,,", + "\n\";", + "\nvar errorsBm = new List(){};" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var activity = await TestValidation(inputFile, errorsBm);", + "\nactivity" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var ws = Workspace.CreateNew();", + "\nws.InitializeFrom(DataSource);", + "\nawait Import.FromString(inputFile).WithFormat(ImportFormats.DataNodeParameter).WithTarget(ws).ExecuteAsync()", + "\n " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## EconomicBasis" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var inputFile = ", + "\n@\"@@Main", + "\nReportingNode,Year,Month", + "\nCH,2020,12", + "\n", + "\n@@SingleDataNodeParameter", + "\nDataNode,PremiumAllocation,EconomicBasisDriver", + "\nDT1.1,0.85,A", + "\n\";", + "\nvar errorsBm = new List(){Get(Error.InvalidEconomicBasisDriver, \"DT1.1\"),};" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var activity = await TestValidation(inputFile, errorsBm);", + "\nactivity" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "### Default values" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var inputFile = ", + "\n@\"@@Main", + "\nReportingNode,Year,Month", + "\nCH,2020,12", + "\n", + "\n@@SingleDataNodeParameter", + "\nDataNode,PremiumAllocation,EconomicBasisDriver", + "\nDT1.1,0.85,", + "\n\";" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var economicBasisDriverByValuationApproach = new Dictionary<(string,string),string>{", + "\n {(ValuationApproaches.BBA, LiabilityTypes.LIC), EconomicBases.L},", + "\n {(ValuationApproaches.BBA, LiabilityTypes.LRC), EconomicBases.L},", + "\n {(ValuationApproaches.VFA, LiabilityTypes.LIC), EconomicBases.C},", + "\n {(ValuationApproaches.VFA, LiabilityTypes.LRC), EconomicBases.C},", + "\n {(ValuationApproaches.PAA, LiabilityTypes.LIC), EconomicBases.C},", + "\n {(ValuationApproaches.PAA, LiabilityTypes.LRC), EconomicBases.N},", + "\n };" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public async Task CheckDefaultEbDriver((string va, string lt) key, string eb){", + "\n var ws = Workspace.CreateNew();", + "\n ws.InitializeFrom(DataSource);", + "\n ws.InitializeFrom(DataSource);", + "\n await ws.DeleteAsync(ws.Query());", + "\n await ws.UpdateAsync(new [] {dt11 with {ValuationApproach = key.va, LiabilityType = key.lt}});", + "\n ", + "\n var log = await Import.FromString(inputFile).WithFormat(ImportFormats.DataNodeParameter).WithTarget(ws).ExecuteAsync();", + "\n log.Status.Should().Be(ActivityLogStatus.Succeeded);", + "\n return (await ws.Query().ToArrayAsync()).Single().EconomicBasisDriver == eb;", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var comparison = new Dictionary<(string,string),bool>();", + "\nforeach (var kvp in economicBasisDriverByValuationApproach)", + "\n comparison[kvp.Key] = await CheckDefaultEbDriver(kvp.Key, kvp.Value);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "comparison.All(x => x.Value).Should().BeTrue();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17/Test/TestData.ipynb b/ifrs17/Test/TestData.ipynb index 11b7e3f7..682273b3 100644 --- a/ifrs17/Test/TestData.ipynb +++ b/ifrs17/Test/TestData.ipynb @@ -110,6 +110,29 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "markdown", + "source": [ + "# Economic Basis" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var economicBasis = ", + "\n@\"@@EconomicBasis,,,,,,,,,,,", + "\nSystemName,DisplayName,Order", + "\nL,Locked-in,1", + "\nC,Current,10", + "\nN,Nominal,20\";" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "markdown", "source": [ @@ -198,8 +221,8 @@ "cell_type": "code", "source": [ "var reportingNodeG = new ReportingNode() {", - "\n SystemName = \"G\",", - "\n DisplayName = \"Group\",", + "\n SystemName = \"CH\",", + "\n DisplayName = \"Switzerland\",", "\n Currency = \"CHF\"", "\n};" ], From 935d67851f1f73c9cec88b55e245994b989e04fd Mon Sep 17 00:00:00 2001 From: Davide Colleoni Date: Mon, 22 May 2023 13:12:40 +0200 Subject: [PATCH 25/55] clean up --- .../Test/Data/DataNodeParameter_Duplicate.csv | 13 ------- .../DataNodeParameter_InvalidDataNode.csv | 14 -------- .../DataNodeParameter_InvalidParameters.csv | 20 ----------- .../DataNodeParameter_InvalidReinsCov.csv | 12 ------- ...odeParameter_MissingNonRequiredColumns.csv | 16 --------- ...Test.ipynb => DataNodeParameterTest.ipynb} | 34 ++++--------------- ifrs17/Test/Tests.ipynb | 9 +++++ 7 files changed, 16 insertions(+), 102 deletions(-) delete mode 100644 ifrs17-template/Test/Data/DataNodeParameter_Duplicate.csv delete mode 100644 ifrs17-template/Test/Data/DataNodeParameter_InvalidDataNode.csv delete mode 100644 ifrs17-template/Test/Data/DataNodeParameter_InvalidParameters.csv delete mode 100644 ifrs17-template/Test/Data/DataNodeParameter_InvalidReinsCov.csv delete mode 100644 ifrs17-template/Test/Data/DataNodeParameter_MissingNonRequiredColumns.csv rename ifrs17/Test/{DataNodeImporterValidationTest.ipynb => DataNodeParameterTest.ipynb} (96%) diff --git a/ifrs17-template/Test/Data/DataNodeParameter_Duplicate.csv b/ifrs17-template/Test/Data/DataNodeParameter_Duplicate.csv deleted file mode 100644 index 2c844eef..00000000 --- a/ifrs17-template/Test/Data/DataNodeParameter_Duplicate.csv +++ /dev/null @@ -1,13 +0,0 @@ -@@Main -ReportingNode,Year,Month -CH,2020,12 - -@@SingleDataNodeParameter -DataNode,PremiumAllocation -DT1.1,0.9 -DT1.1,0.9 - -@@InterDataNodeParameter -DataNode,LinkedDataNode,ReinsuranceCoverage -DTR1.1,DT1.1,1 -DT1.1,DTR1.1,1 diff --git a/ifrs17-template/Test/Data/DataNodeParameter_InvalidDataNode.csv b/ifrs17-template/Test/Data/DataNodeParameter_InvalidDataNode.csv deleted file mode 100644 index f20a6621..00000000 --- a/ifrs17-template/Test/Data/DataNodeParameter_InvalidDataNode.csv +++ /dev/null @@ -1,14 +0,0 @@ -@@Main -ReportingNode,Year,Month -CH,2020,12 - -@@SingleDataNodeParameter -DataNode,PremiumAllocation,CashFlowPeriodicity,InterpolationMethod -DT1.1,0.9,Monthly,Uniform -DataNodeInvalid0,0.85,Monthly,Uniform - -@@InterDataNodeParameter -DataNode,LinkedDataNode,ReinsuranceCoverage -DTR1.1,DT1.1,1 -DataNodeInvalid1,DTR1.1,1 -DTR1.1,DataNodeInvalid2,1 diff --git a/ifrs17-template/Test/Data/DataNodeParameter_InvalidParameters.csv b/ifrs17-template/Test/Data/DataNodeParameter_InvalidParameters.csv deleted file mode 100644 index 72b25fc1..00000000 --- a/ifrs17-template/Test/Data/DataNodeParameter_InvalidParameters.csv +++ /dev/null @@ -1,20 +0,0 @@ -@@Main -ReportingNode,Year,Month -CH,2020,12 - -@@SingleDataNodeParameter -DataNode,PremiumAllocation,CashFlowPeriodicity,InterpolationMethod,EconomicBasisDriver -DT1.1,0.9,Monthly,InvalidEntry,L -DT1.2,0.85,InvalidEntry,Uniform,N -DT1.3,0.9,,Uniform,C -DT1.4,0.85,Monthly,,N -DT1.5,0.9,Yearly,,L -DT1.6,0.85,Monthly,Uniform,InvalidEntry -DT1.7,0.85,Monthly,Uniform, - - -@@InterDataNodeParameter -DataNode,LinkedDataNode,ReinsuranceCoverage -DTR1.1,DT1.1,1 -DTR1.2,DT1.2,1 -DTR1.3,DT1.3,1 diff --git a/ifrs17-template/Test/Data/DataNodeParameter_InvalidReinsCov.csv b/ifrs17-template/Test/Data/DataNodeParameter_InvalidReinsCov.csv deleted file mode 100644 index 802ab7b7..00000000 --- a/ifrs17-template/Test/Data/DataNodeParameter_InvalidReinsCov.csv +++ /dev/null @@ -1,12 +0,0 @@ -@@Main -ReportingNode,Year,Month -CH,2020,12 - -@@SingleDataNodeParameter -DataNode,PremiumAllocation -DT1.1,0.9 - -@@InterDataNodeParameter -DataNode,LinkedDataNode,ReinsuranceCoverage -DT1.1,DT1.1,1 - diff --git a/ifrs17-template/Test/Data/DataNodeParameter_MissingNonRequiredColumns.csv b/ifrs17-template/Test/Data/DataNodeParameter_MissingNonRequiredColumns.csv deleted file mode 100644 index 068b8fa4..00000000 --- a/ifrs17-template/Test/Data/DataNodeParameter_MissingNonRequiredColumns.csv +++ /dev/null @@ -1,16 +0,0 @@ -@@Main -ReportingNode,Year,Month -CH,2020,12 - -@@SingleDataNodeParameter -DataNode,PremiumAllocation -DT1.1,0.9 -DT1.2,0.85 -DT1.3,0.9 -DT1.4,0.85 - -@@InterDataNodeParameter -DataNode,LinkedDataNode,ReinsuranceCoverage -DTR1.1,DT1.1,1 -DTR1.2,DT1.2,1 -DTR1.3,DT1.3,1 diff --git a/ifrs17/Test/DataNodeImporterValidationTest.ipynb b/ifrs17/Test/DataNodeParameterTest.ipynb similarity index 96% rename from ifrs17/Test/DataNodeImporterValidationTest.ipynb rename to ifrs17/Test/DataNodeParameterTest.ipynb index 177150c6..c4fe710f 100644 --- a/ifrs17/Test/DataNodeImporterValidationTest.ipynb +++ b/ifrs17/Test/DataNodeParameterTest.ipynb @@ -459,7 +459,8 @@ { "cell_type": "markdown", "source": [ - "### Null value with a valid interpolation " + "### Null value not allowed", + "\n#### Case 1 : with a valid interpolation " ], "metadata": {}, "execution_count": 0, @@ -496,7 +497,7 @@ { "cell_type": "markdown", "source": [ - "### Null value is accepted when interpolation method is also null" + "#### Case 2 : without a valid interpolation " ], "metadata": {}, "execution_count": 0, @@ -514,7 +515,7 @@ "\nDataNode,PremiumAllocation,CashFlowPeriodicity,InterpolationMethod", "\nDT1.1,0.85,,,", "\n\";", - "\nvar errorsBm = new List(){};" + "\nvar errorsBm = new List(){Get(Error.InvalidCashFlowPeriodicity, \"DT1.1\"),};" ], "metadata": {}, "execution_count": 0, @@ -531,12 +532,9 @@ "outputs": [] }, { - "cell_type": "code", + "cell_type": "markdown", "source": [ - "var ws = Workspace.CreateNew();", - "\nws.InitializeFrom(DataSource);", - "\nawait Import.FromString(inputFile).WithFormat(ImportFormats.DataNodeParameter).WithTarget(ws).ExecuteAsync()", - "\n " + "## EconomicBasis" ], "metadata": {}, "execution_count": 0, @@ -545,7 +543,7 @@ { "cell_type": "markdown", "source": [ - "## EconomicBasis" + "### Wrong Value" ], "metadata": {}, "execution_count": 0, @@ -660,24 +658,6 @@ "execution_count": 0, "outputs": [] }, - { - "cell_type": "code", - "source": [ - "" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, { "cell_type": "code", "source": [ diff --git a/ifrs17/Test/Tests.ipynb b/ifrs17/Test/Tests.ipynb index 3158cd88..99916537 100644 --- a/ifrs17/Test/Tests.ipynb +++ b/ifrs17/Test/Tests.ipynb @@ -107,6 +107,15 @@ "metadata": {}, "execution_count": 0, "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!eval-notebook \"DataNodeParameterTest\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file From e61b779b190723eb51a010115fccdea7e875ad78 Mon Sep 17 00:00:00 2001 From: Davide Colleoni Date: Mon, 22 May 2023 13:14:24 +0200 Subject: [PATCH 26/55] Cu,P --- .../NominalCashflows_ActualsCase_CH_2020_12.csv | 8 ++++---- .../NominalCashflows_ActualsCase_CH_2021_12.csv | 8 ++++---- .../NominalCashflows_ActualsCase_CH_2021_6.csv | 8 ++++---- .../NominalCashflows_CH_2020_12_BE.csv | 4 ++-- .../NominalCashflows_CH_2020_12_LR70.csv | 4 ++-- .../NominalCashflows_CH_2020_12_LR80.csv | 4 ++-- .../NominalCashflows_CsmSwitch_CH_2020_12.csv | 2 +- .../NominalCashflows_CsmSwitch_CH_2021_3.csv | 2 +- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/NominalCashflows_ActualsCase_CH_2020_12.csv b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/NominalCashflows_ActualsCase_CH_2020_12.csv index 3209b86f..69444cc3 100644 --- a/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/NominalCashflows_ActualsCase_CH_2020_12.csv +++ b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/NominalCashflows_ActualsCase_CH_2020_12.csv @@ -11,7 +11,7 @@ MZ2.1,NIC,BE,EV,N,,0,0,0,0,0,0,0,0,0,0,0,0,-15,-15,-15,-35,-35,-45,-45,-35,-35,- MZ2.1,,RA,EV,N,,0,0,0,0,0,0,0,0,0,0,0,0,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 MZ2.1,PR,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,105,0,0,105,0,0,105,0,0,105,0,0 MZ2.1,NIC,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,-15,-15,-15,-35,-35,-45,-45,-35,-35,-15,-15,-15 -MZ2.1,,CU,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5 +MZ2.1,CU,P,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5 MZ2.1,,RA,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 MZ2.2,PR,BE,BOP,N,,100,0,0,100,0,0,100,0,0,100,0,0,100,0,0,100,0,0,100,0,0,100,0,0 MZ2.2,NIC,BE,BOP,N,,-15,-15,-15,-30,-30,-45,-45,-30,-30,-15,-15,-15,-15,-15,-15,-30,-30,-45,-45,-30,-30,-15,-15,-15 @@ -21,7 +21,7 @@ MZ2.2,NIC,BE,EV,N,,0,0,0,0,0,0,0,0,0,0,0,0,-15,-15,-15,-35,-35,-45,-45,-35,-35,- MZ2.2,,RA,EV,N,,0,0,0,0,0,0,0,0,0,0,0,0,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 MZ2.2,PR,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,105,0,0,105,0,0,105,0,0,105,0,0 MZ2.2,NIC,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,-15,-15,-15,-35,-35,-45,-45,-35,-35,-15,-15,-15 -MZ2.2,,CU,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5 +MZ2.2,CU,P,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5 MZ2.2,,RA,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 MZ2.3,PR,BE,BOP,N,,100,0,0,100,0,0,100,0,0,100,0,0,100,0,0,100,0,0,100,0,0,100,0,0 MZ2.3,NIC,BE,BOP,N,,-15,-15,-15,-30,-30,-45,-45,-30,-30,-15,-15,-15,-15,-15,-15,-30,-30,-45,-45,-30,-30,-15,-15,-15 @@ -31,7 +31,7 @@ MZ2.3,NIC,BE,EV,N,,0,0,0,0,0,0,0,0,0,0,0,0,-15,-15,-15,-35,-35,-45,-45,-35,-35,- MZ2.3,,RA,EV,N,,0,0,0,0,0,0,0,0,0,0,0,0,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 MZ2.3,PR,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,105,0,0,105,0,0,105,0,0,105,0,0 MZ2.3,NIC,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,-15,-15,-15,-35,-35,-45,-45,-35,-35,-15,-15,-15 -MZ2.3,,CU,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5 +MZ2.3,CU,P,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5 MZ2.3,,RA,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 MZ2.4,PR,BE,BOP,N,,100,0,0,100,0,0,100,0,0,100,0,0,100,0,0,100,0,0,100,0,0,100,0,0 MZ2.4,NIC,BE,BOP,N,,-15,-15,-15,-30,-30,-45,-45,-30,-30,-15,-15,-15,-15,-15,-15,-30,-30,-45,-45,-30,-30,-15,-15,-15 @@ -41,5 +41,5 @@ MZ2.4,NIC,BE,EV,N,,0,0,0,0,0,0,0,0,0,0,0,0,-15,-15,-15,-35,-35,-45,-45,-35,-35,- MZ2.4,,RA,EV,N,,0,0,0,0,0,0,0,0,0,0,0,0,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 MZ2.4,PR,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,105,0,0,105,0,0,105,0,0,105,0,0 MZ2.4,NIC,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,-15,-15,-15,-35,-35,-45,-45,-35,-35,-15,-15,-15 -MZ2.4,,CU,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5 +MZ2.4,CU,P,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5 MZ2.4,,RA,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 diff --git a/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/NominalCashflows_ActualsCase_CH_2021_12.csv b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/NominalCashflows_ActualsCase_CH_2021_12.csv index 208149c0..7cc60a46 100644 --- a/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/NominalCashflows_ActualsCase_CH_2021_12.csv +++ b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/NominalCashflows_ActualsCase_CH_2021_12.csv @@ -14,7 +14,7 @@ MZ2.1,NIC,BE,MC,N,,-5,-5,-5,-20,-20,-10,-10,-10,-10,-5,-5,-5 MZ2.1,,RA,MC,N,,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25 MZ2.1,PR,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 MZ2.1,NIC,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 -MZ2.1,,CU,CL,C,,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25 +MZ2.1,CU,P,CL,C,,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25 MZ2.1,,RA,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 MZ2.2,PR,BE,MC,I,,102,0,0,102,0,0,102,0,0,102,0,0 MZ2.2,NIC,BE,MC,I,,-15,-15,-15,-45,-45,-40,-40,-40,-40,-15,-15,-15 @@ -27,7 +27,7 @@ MZ2.2,NIC,BE,MC,N,,-5,-5,-5,-20,-20,-10,-10,-10,-10,-5,-5,-5 MZ2.2,,RA,MC,N,,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25 MZ2.2,PR,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 MZ2.2,NIC,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 -MZ2.2,,CU,CL,C,,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25 +MZ2.2,CU,P,CL,C,,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25 MZ2.2,,RA,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 MZ2.3,PR,BE,MC,I,,102,0,0,102,0,0,102,0,0,102,0,0 MZ2.3,NIC,BE,MC,I,,-15,-15,-15,-45,-45,-40,-40,-40,-40,-15,-15,-15 @@ -40,7 +40,7 @@ MZ2.3,NIC,BE,MC,N,,-5,-5,-5,-20,-20,-10,-10,-10,-10,-5,-5,-5 MZ2.3,,RA,MC,N,,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25 MZ2.3,PR,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 MZ2.3,NIC,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 -MZ2.3,,CU,CL,C,,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25 +MZ2.3,CU,P,CL,C,,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25 MZ2.3,,RA,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 MZ2.4,PR,BE,MC,I,,102,0,0,102,0,0,102,0,0,102,0,0 MZ2.4,NIC,BE,MC,I,,-15,-15,-15,-45,-45,-40,-40,-40,-40,-15,-15,-15 @@ -53,5 +53,5 @@ MZ2.4,NIC,BE,MC,N,,-5,-5,-5,-20,-20,-10,-10,-10,-10,-5,-5,-5 MZ2.4,,RA,MC,N,,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25 MZ2.4,PR,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 MZ2.4,NIC,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 -MZ2.4,,CU,CL,C,,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25 +MZ2.4,CU,P,CL,C,,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25 MZ2.4,,RA,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/NominalCashflows_ActualsCase_CH_2021_6.csv b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/NominalCashflows_ActualsCase_CH_2021_6.csv index 53260d5c..2682e66f 100644 --- a/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/NominalCashflows_ActualsCase_CH_2021_6.csv +++ b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/NominalCashflows_ActualsCase_CH_2021_6.csv @@ -14,7 +14,7 @@ MZ2.1,NIC,BE,MC,N,,-5,-5,-5,-10,-10,-20,-20,-10,-10,-5,-5,-5 MZ2.1,,RA,MC,N,,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25 MZ2.1,PR,BE,CL,C,,0,0,0,0,0,0,100,0,0,100,0,0 MZ2.1,NIC,BE,CL,C,,0,0,0,0,0,0,-65,-50,-50,-20,-20,-20 -MZ2.1,,CU,CL,C,,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25 +MZ2.1,CU,P,CL,C,,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25 MZ2.1,,RA,CL,C,,0,0,0,0,0,0,-3.25,-3.25,-3.25,-3.25,-3.25,-3.25 MZ2.2,PR,BE,MC,I,,100,0,0,100,0,0,100,0,0,100,0,0 MZ2.2,NIC,BE,MC,I,,-15,-15,-15,-40,-40,-45,-45,-40,-40,-15,-15,-15 @@ -27,7 +27,7 @@ MZ2.2,NIC,BE,MC,N,,-5,-5,-5,-10,-10,-20,-20,-10,-10,-5,-5,-5 MZ2.2,,RA,MC,N,,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25 MZ2.2,PR,BE,CL,C,,0,0,0,0,0,0,100,0,0,100,0,0 MZ2.2,NIC,BE,CL,C,,0,0,0,0,0,0,-65,-50,-50,-20,-20,-20 -MZ2.2,,CU,CL,C,,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25 +MZ2.2,CU,P,CL,C,,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25 MZ2.2,,RA,CL,C,,0,0,0,0,0,0,-3.25,-3.25,-3.25,-3.25,-3.25,-3.25 MZ2.3,PR,BE,MC,I,,100,0,0,100,0,0,100,0,0,100,0,0 MZ2.3,NIC,BE,MC,I,,-15,-15,-15,-40,-40,-45,-45,-40,-40,-15,-15,-15 @@ -40,7 +40,7 @@ MZ2.3,NIC,BE,MC,N,,-5,-5,-5,-10,-10,-20,-20,-10,-10,-5,-5,-5 MZ2.3,,RA,MC,N,,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25 MZ2.3,PR,BE,CL,C,,0,0,0,0,0,0,100,0,0,100,0,0 MZ2.3,NIC,BE,CL,C,,0,0,0,0,0,0,-65,-50,-50,-20,-20,-20 -MZ2.3,,CU,CL,C,,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25 +MZ2.3,CU,P,CL,C,,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25 MZ2.3,,RA,CL,C,,0,0,0,0,0,0,-3.25,-3.25,-3.25,-3.25,-3.25,-3.25 MZ2.4,PR,BE,MC,I,,100,0,0,100,0,0,100,0,0,100,0,0 MZ2.4,NIC,BE,MC,I,,-15,-15,-15,-40,-40,-45,-45,-40,-40,-15,-15,-15 @@ -53,5 +53,5 @@ MZ2.4,NIC,BE,MC,N,,-5,-5,-5,-10,-10,-20,-20,-10,-10,-5,-5,-5 MZ2.4,,RA,MC,N,,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25 MZ2.4,PR,BE,CL,C,,0,0,0,0,0,0,100,0,0,100,0,0 MZ2.4,NIC,BE,CL,C,,0,0,0,0,0,0,-65,-50,-50,-20,-20,-20 -MZ2.4,,CU,CL,C,,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25 +MZ2.4,CU,P,CL,C,,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25 MZ2.4,,RA,CL,C,,0,0,0,0,0,0,-3.25,-3.25,-3.25,-3.25,-3.25,-3.25 diff --git a/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/NominalCashflows_CH_2020_12_BE.csv b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/NominalCashflows_CH_2020_12_BE.csv index 11b389f9..593afbdd 100644 --- a/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/NominalCashflows_CH_2020_12_BE.csv +++ b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/NominalCashflows_CH_2020_12_BE.csv @@ -3,8 +3,8 @@ ReportingNode,Year,Month,Scenario,,,,,,,,,,,,,, CH,2020,12,,,,,,,,,,,,,,, @@Cashflow,,,,,,,,,,,,,,,,, DataNode,AmountType,EstimateType,AocType,Novelty,AccidentYear,Values0,Values1,Values2,Values3,Values4,Values5,Values6,Values7,Values8,Values9,Values10,Values11 -RP1.1,,CU,CL,C,,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333 -RPR1.1,,CU,CL,C,,50,50,50,50,50,50,50,50,50,50,50,50 +RP1.1,CU,P,CL,C,,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333 +RPR1.1,CU,P,CL,C,,50,50,50,50,50,50,50,50,50,50,50,50 RP1.1,PR,BE,BOP,N,,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333 RP1.1,PR,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 RP1.1,NIC,BE,BOP,N,,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50 diff --git a/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/NominalCashflows_CH_2020_12_LR70.csv b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/NominalCashflows_CH_2020_12_LR70.csv index c0bd388a..7859bdc3 100644 --- a/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/NominalCashflows_CH_2020_12_LR70.csv +++ b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/NominalCashflows_CH_2020_12_LR70.csv @@ -3,8 +3,8 @@ ReportingNode,Year,Month,Scenario,,,,,,,,,,,,,, CH,2020,12,LR70,,,,,,,,,,,,,, @@Cashflow,,,,,,,,,,,,,,,,, DataNode,AmountType,EstimateType,AocType,Novelty,AccidentYear,Values0,Values1,Values2,Values3,Values4,Values5,Values6,Values7,Values8,Values9,Values10,Values11 -RP1.1,,CU,CL,C,,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333 -RPR1.1,,CU,CL,C,,58.33333333,58.33333333,58.33333333,58.33333333,58.33333333,58.33333333,58.33333333,58.33333333,58.33333333,58.33333333,58.33333333,58.33333333 +RP1.1,CU,P,CL,C,,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333 +RPR1.1,CU,P,CL,C,,58.33333333,58.33333333,58.33333333,58.33333333,58.33333333,58.33333333,58.33333333,58.33333333,58.33333333,58.33333333,58.33333333,58.33333333 RP1.1,PR,BE,BOP,N,,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333 RP1.1,PR,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 RP1.1,NIC,BE,BOP,N,,-58.33333333,-58.33333333,-58.33333333,-58.33333333,-58.33333333,-58.33333333,-58.33333333,-58.33333333,-58.33333333,-58.33333333,-58.33333333,-58.33333333 diff --git a/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/NominalCashflows_CH_2020_12_LR80.csv b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/NominalCashflows_CH_2020_12_LR80.csv index 6f1d5cdb..d2939ce7 100644 --- a/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/NominalCashflows_CH_2020_12_LR80.csv +++ b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/NominalCashflows_CH_2020_12_LR80.csv @@ -3,8 +3,8 @@ ReportingNode,Year,Month,Scenario,,,,,,,,,,,,,, CH,2020,12,LR80,,,,,,,,,,,,,, @@Cashflow,,,,,,,,,,,,,,,,, DataNode,AmountType,EstimateType,AocType,Novelty,AccidentYear,Values0,Values1,Values2,Values3,Values4,Values5,Values6,Values7,Values8,Values9,Values10,Values11 -RP1.1,,CU,CL,C,,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333 -RPR1.1,,CU,CL,C,,66.66666667,66.66666667,66.66666667,66.66666667,66.66666667,66.66666667,66.66666667,66.66666667,66.66666667,66.66666667,66.66666667,66.66666667 +RP1.1,CU,P,CL,C,,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333 +RPR1.1,CU,P,CL,C,,66.66666667,66.66666667,66.66666667,66.66666667,66.66666667,66.66666667,66.66666667,66.66666667,66.66666667,66.66666667,66.66666667,66.66666667 RP1.1,PR,BE,BOP,N,,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333 RP1.1,PR,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 RP1.1,NIC,BE,BOP,N,,-66.66666667,-66.66666667,-66.66666667,-66.66666667,-66.66666667,-66.66666667,-66.66666667,-66.66666667,-66.66666667,-66.66666667,-66.66666667,-66.66666667 diff --git a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/NominalCashflows_CsmSwitch_CH_2020_12.csv b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/NominalCashflows_CsmSwitch_CH_2020_12.csv index 473ce967..efeeea35 100644 --- a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/NominalCashflows_CsmSwitch_CH_2020_12.csv +++ b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/NominalCashflows_CsmSwitch_CH_2020_12.csv @@ -8,5 +8,5 @@ MZ1.1,NIC,BE,BOP,N,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25, MZ1.1,,RA,BOP,N,,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 MZ1.1,PR,BE,CL,C,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0 MZ1.1,NIC,BE,CL,C,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 -MZ1.1,,CU,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 +MZ1.1,CU,P,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 MZ1.1,,RA,CL,C,,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 diff --git a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/NominalCashflows_CsmSwitch_CH_2021_3.csv b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/NominalCashflows_CsmSwitch_CH_2021_3.csv index f9e9d6b3..f1c692d3 100644 --- a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/NominalCashflows_CsmSwitch_CH_2021_3.csv +++ b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/NominalCashflows_CsmSwitch_CH_2021_3.csv @@ -17,5 +17,5 @@ MZ1.1,,RA,EV,N,,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5 MZ1.1,PR,BE,CL,C,,0,115,0,0,115,0,0,115,0,0,115,0 MZ1.1,ICO,BE,CL,C,,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 MZ1.1,NIC,BE,CL,C,,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29 -MZ1.1,,CU,CL,C,,-15,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-5 +MZ1.1,CU,P,CL,C,,-15,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-5 MZ1.1,,RA,CL,C,,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 From 38633159766fb673c178aa5b515ec4fea95cb87a Mon Sep 17 00:00:00 2001 From: Davide Colleoni Date: Mon, 22 May 2023 13:14:51 +0200 Subject: [PATCH 27/55] cu,P --- .../Test/ScenarioDataImportTest.ipynb | 18 +++++++++--------- .../Test/ScenarioParametersImportTest.ipynb | 8 ++++---- .../Test/ScenarioYieldCurveImportTest.ipynb | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ifrs17-template/Test/ScenarioDataImportTest.ipynb b/ifrs17-template/Test/ScenarioDataImportTest.ipynb index f943b73e..2fcc808c 100644 --- a/ifrs17-template/Test/ScenarioDataImportTest.ipynb +++ b/ifrs17-template/Test/ScenarioDataImportTest.ipynb @@ -114,11 +114,11 @@ "\nDataNode,AmountType,EstimateType,AocType,Novelty,AccidentYear,Values0,Values1,Values2,Values3,Values4,Values5,Values6,Values7,Values8,Values9,Values10,Values11,Values12,Values13,Values14,Values15,Values16,Values17,Values18,Values19,Values20,Values21,Values22,Values23", "\nDT1.1,PR,BE,CL,C,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0", "\nDT1.1,NIC,BE,CL,C,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25", - "\nDT1.1,,CU,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3", + "\nDT1.1,CU,P,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3", "\nDT1.1,,RA,CL,C,,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5", "\nDTR1.1,PR,BE,CL,C,,50,0,0,50,0,0,50,0,0,50,0,0,50,0,0,50,0,0,50,0,0,50,0,0", "\nDTR1.1,NIC,BE,CL,C,,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5", - "\nDTR1.1,,CU,CL,C,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5", + "\nDTR1.1,CU,P,CL,C,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5", "\nDTR1.1,,RA,CL,C,,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25\";" ], "metadata": {}, @@ -192,7 +192,7 @@ "\nDataNode,AmountType,EstimateType,AocType,Novelty,AccidentYear,Values0,Values1,Values2,Values3,Values4,Values5,Values6,Values7,Values8,Values9,Values10,Values11,Values12,Values13,Values14,Values15,Values16,Values17,Values18,Values19,Values20,Values21,Values22,Values23", "\nDT1.1,PR,BE,CL,C,,110,0,0,110,0,0,110,0,0,110,0,0,0,110,0,0,110,0,0,110,0,0,110,0", "\nDT1.1,NIC,BE,CL,C,,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5", - "\nDT1.1,,CU,CL,C,,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-5.5,-5.5,-5.5,-5.5,-5.5,-5.5,-5.5,-5.5,-53.5,-52.5,-31.3", + "\nDT1.1,CU,P,CL,C,,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-5.5,-5.5,-5.5,-5.5,-5.5,-5.5,-5.5,-5.5,-53.5,-52.5,-31.3", "\nDT1.1,,RA,CL,C,,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75\";" ], "metadata": {}, @@ -318,7 +318,7 @@ "\nCH,2020,12,MTUP10pct", "\n@@Cashflow", "\nDataNode,AmountType,EstimateType,AocType,Novelty,AccidentYear,Values0,Values1,Values2,Values3,Values4,Values5,Values6,Values7,Values8,Values9,Values10,Values11,Values12,Values13,Values14,Values15,Values16,Values17,Values18,Values19,Values20,Values21,Values22,Values23", - "\nDT1.1,,CU,CL,C,,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-6.5,-6.5,-6.5,-6.5,-6.5,-6.5,-6.5,-6.5,-6.5,-7.5,-8.5\";" + "\nDT1.1,CU,P,CL,C,,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-6.5,-6.5,-6.5,-6.5,-6.5,-6.5,-6.5,-6.5,-6.5,-7.5,-8.5\";" ], "metadata": {}, "execution_count": 0, @@ -505,7 +505,7 @@ "\nDataNode,AmountType,EstimateType,AocType,Novelty,AccidentYear,Values0,Values1,Values2,Values3,Values4,Values5,Values6,Values7,Values8,Values9,Values10,Values11,Values12,Values13,Values14,Values15,Values16,Values17,Values18,Values19,Values20,Values21,Values22,Values23", "\nDT1.1,PR,BE,CL,C,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0", "\nDT1.1,NIC,BE,CL,C,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25", - "\nDT1.1,,CU,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3", + "\nDT1.1,CU,P,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3", "\nDT1.1,,RA,CL,C,,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5\";" ], "metadata": {}, @@ -596,11 +596,11 @@ "\nDataNode,AmountType,EstimateType,AocType,Novelty,AccidentYear,Values0,Values1,Values2,Values3,Values4,Values5,Values6,Values7,Values8,Values9,Values10,Values11,Values12,Values13,Values14,Values15,Values16,Values17,Values18,Values19,Values20,Values21,Values22,Values23", "\nDT1.1,PR,BE,CL,C,,210,0,0,210,0,0,210,0,0,210,0,0,0,210,0,0,210,0,0,210,0,0,210,0", "\nDT1.1,NIC,BE,CL,C,,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37", - "\nDT1.1,,CU,CL,C,,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-3.3", + "\nDT1.1,CU,P,CL,C,,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-3.3", "\nDT1.1,,RA,CL,C,,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42", "\nDTR1.1,PR,BE,CL,C,,50,0,0,50,0,0,50,0,0,50,0,0,50,0,0,50,0,0,50,0,0,50,0,0", "\nDTR1.1,NIC,BE,CL,C,,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5", - "\nDTR1.1,,CU,CL,C,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5", + "\nDTR1.1,CU,P,CL,C,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5", "\nDTR1.1,,RA,CL,C,,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25\";" ], "metadata": {}, @@ -683,7 +683,7 @@ "\nDT1.1,ICO,BE,CL,C,,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3", "\nDT1.1,PR,BE,CL,C,,210,0,0,210,0,0,210,0,0,210,0,0,0,210,0,0,210,0,0,210,0,0,210,0", "\nDT1.1,NIC,BE,CL,C,,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37", - "\nDT1.1,,CU,CL,C,,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-3.3", + "\nDT1.1,CU,P,CL,C,,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-3.3", "\nDT1.1,,RA,CL,C,,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42\";" ], "metadata": {}, @@ -872,7 +872,7 @@ "\nDataNode,AmountType,EstimateType,AocType,Novelty,AccidentYear,Values0,Values1,Values2,Values3,Values4,Values5,Values6,Values7,Values8,Values9,Values10,Values11,Values12,Values13,Values14,Values15,Values16,Values17,Values18,Values19,Values20,Values21,Values22,Values23", "\nDT1.1,PR,BE,CL,C,,200,0,0,200,0,0,200,0,0,200,0,0,0,200,0,0,200,0,0,200,0,0,200,0", "\nDT1.1,NIC,BE,CL,C,,-33,-33,-33,-33,-33,-33,-33,-33,-33,-33,-33,-33,-33,-33,-33,-33,-33,-33,-33,-33,-33,-33,-33,-33", - "\nDT1.1,,CU,CL,C,,-719,-71,-70,-70,-69,-69,-68,-68,-67,-67,-66,-66,-65,-65,-64,-64,-63,-63,-62,-62,-61,-61,-60,-60", + "\nDT1.1,CU,P,CL,C,,-719,-71,-70,-70,-69,-69,-68,-68,-67,-67,-66,-66,-65,-65,-64,-64,-63,-63,-62,-62,-61,-61,-60,-60", "\nDT1.1,,RA,CL,C,,-45,-45,-45,-45,-45,-45,-45,-45,-45,-45,-45,-45,-45,-45,-45,-45,-45,-45,-45,-45,-45,-45,-45,-45\";" ], "metadata": {}, diff --git a/ifrs17-template/Test/ScenarioParametersImportTest.ipynb b/ifrs17-template/Test/ScenarioParametersImportTest.ipynb index 5dd27700..ff8fd02e 100644 --- a/ifrs17-template/Test/ScenarioParametersImportTest.ipynb +++ b/ifrs17-template/Test/ScenarioParametersImportTest.ipynb @@ -114,11 +114,11 @@ "\nDataNode,AmountType,EstimateType,AocType,Novelty,AccidentYear,Values0,Values1,Values2,Values3,Values4,Values5,Values6,Values7,Values8,Values9,Values10,Values11,Values12,Values13,Values14,Values15,Values16,Values17,Values18,Values19,Values20,Values21,Values22,Values23", "\nDT1.1,PR,BE,CL,C,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0", "\nDT1.1,NIC,BE,CL,C,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25", - "\nDT1.1,,CU,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3", + "\nDT1.1,CU,P,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3", "\nDT1.1,,RA,CL,C,,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5", "\nDTR1.1,PR,BE,CL,C,,50,0,0,50,0,0,50,0,0,50,0,0,50,0,0,50,0,0,50,0,0,50,0,0", "\nDTR1.1,NIC,BE,CL,C,,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5", - "\nDTR1.1,,CU,CL,C,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5", + "\nDTR1.1,CU,P,CL,C,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5", "\nDTR1.1,,RA,CL,C,,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25\";" ], "metadata": {}, @@ -314,11 +314,11 @@ "\nDataNode,AmountType,EstimateType,AocType,Novelty,AccidentYear,Values0,Values1,Values2,Values3,Values4,Values5,Values6,Values7,Values8,Values9,Values10,Values11,Values12,Values13,Values14,Values15,Values16,Values17,Values18,Values19,Values20,Values21,Values22,Values23", "\nDT1.1,PR,BE,CL,C,,131,0,0,111,0,0,111,0,0,111,0,0,0,111,0,0,111,0,0,111,0,0,111,0", "\nDT1.1,NIC,BE,CL,C,,-31,-31,-31,-31,-31,-31,-31,-31,-31,-31,-31,-31,-31,-31,-31,-31,-31,-31,-31,-31,-31,-31,-31,-31", - "\nDT1.1,,CU,CL,C,,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3", + "\nDT1.1,CU,P,CL,C,,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3", "\nDT1.1,,RA,CL,C,,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6", "\nDTR1.1,PR,BE,CL,C,,51,0,0,51,0,0,51,0,0,51,0,0,51,0,0,51,0,0,51,0,0,51,0,0", "\nDTR1.1,NIC,BE,CL,C,,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13", - "\nDTR1.1,,CU,CL,C,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5", + "\nDTR1.1,CU,P,CL,C,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5", "\nDTR1.1,,RA,CL,C,,1.31,1.31,1.31,1.31,1.31,1.31,1.31,1.31,1.31,1.31,1.31,1.31,1.31,1.31,1.31,1.31,1.31,1.31,1.31,1.31,1.31,1.31,1.31,1.31\";" ], "metadata": {}, diff --git a/ifrs17-template/Test/ScenarioYieldCurveImportTest.ipynb b/ifrs17-template/Test/ScenarioYieldCurveImportTest.ipynb index a356e39d..f5f92327 100644 --- a/ifrs17-template/Test/ScenarioYieldCurveImportTest.ipynb +++ b/ifrs17-template/Test/ScenarioYieldCurveImportTest.ipynb @@ -141,11 +141,11 @@ "\nDataNode,AmountType,EstimateType,AocType,Novelty,AccidentYear,Values0,Values1,Values2,Values3,Values4,Values5,Values6,Values7,Values8,Values9,Values10,Values11,Values12,Values13,Values14,Values15,Values16,Values17,Values18,Values19,Values20,Values21,Values22,Values23", "\nDT1.1,PR,BE,CL,C,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0", "\nDT1.1,NIC,BE,CL,C,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25", - "\nDT1.1,,CU,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3", + "\nDT1.1,CU,P,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3", "\nDT1.1,,RA,CL,C,,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5", "\nDTR1.1,PR,BE,CL,C,,50,0,0,50,0,0,50,0,0,50,0,0,50,0,0,50,0,0,50,0,0,50,0,0", "\nDTR1.1,NIC,BE,CL,C,,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5", - "\nDTR1.1,,CU,CL,C,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5", + "\nDTR1.1,CU,P,CL,C,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5", "\nDTR1.1,,RA,CL,C,,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25\";" ], "metadata": {}, From 41b4ed074e326789828f18d50dde4794342344c4 Mon Sep 17 00:00:00 2001 From: Davide Colleoni Date: Mon, 22 May 2023 14:40:45 +0200 Subject: [PATCH 28/55] clean up --- .../Test/MapTemplateAndImportTest.ipynb | 138 +----------------- 1 file changed, 1 insertion(+), 137 deletions(-) diff --git a/ifrs17-template/Test/MapTemplateAndImportTest.ipynb b/ifrs17-template/Test/MapTemplateAndImportTest.ipynb index 14649308..d87aad73 100644 --- a/ifrs17-template/Test/MapTemplateAndImportTest.ipynb +++ b/ifrs17-template/Test/MapTemplateAndImportTest.ipynb @@ -569,146 +569,10 @@ "execution_count": 0, "outputs": [] }, - { - "cell_type": "markdown", - "source": [ - "## Data Node Parameters : Validations" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "public async Task CheckErrors(string inputFileName, List errorBms, IWorkspace workspace)", - "\n{", - "\n Activity.Start();", - "\n var log = await Import.FromFile(inputFileName).WithFormat(ImportFormats.DataNodeParameter).WithTarget(workspace).ExecuteAsync();", - "\n log.Errors.Count().Should().Be(errorBms.Count());", - "\n errorBms.Intersect(log.Errors.Select(x => x.ToString().Substring(0,x.ToString().Length-2).Substring(40)).ToArray()).Count().Should().Be(errorBms.Count());", - "\n return Activity.Finish();", - "\n}" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "var ws1 = Workspace.CreateNew();", - "\nws1.InitializeFrom(DataSource);" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "var inputFileName = \"Data/DataNodeParameter_InvalidDataNode.csv\";", - "\nvar errorsBm = new List(){Get(Error.InvalidDataNode, \"DataNodeInvalid0\"),", - "\n Get(Error.InvalidDataNode, \"DataNodeInvalid1\"),", - "\n Get(Error.InvalidDataNode, \"DataNodeInvalid2\")};", - "\nvar activity = await CheckErrors(inputFileName, errorsBm, ws1);", - "\nactivity" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "var ws2 = Workspace.CreateNew();", - "\nws2.InitializeFrom(DataSource);" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "var inputFileName = \"Data/DataNodeParameter_Duplicate.csv\";", - "\nvar errorsBm = new List(){Get(Error.DuplicateSingleDataNode, \"DT1.1\"),", - "\n Get(Error.DuplicateInterDataNode, \"DT1.1\",\"DTR1.1\"),};", - "\nvar activity = await CheckErrors(inputFileName, errorsBm, ws2);", - "\nactivity" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "var ws3 = Workspace.CreateNew();", - "\nws3.InitializeFrom(DataSource);" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "var inputFileName = \"Data/DataNodeParameter_InvalidReinsCov.csv\";", - "\nvar errorsBm = new List(){Get(Error.ReinsuranceCoverageDataNode, \"DT1.1\",\"DT1.1\")};", - "\nvar activity = await CheckErrors(inputFileName, errorsBm, ws3);" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "var ws4 = Workspace.CreateNew();", - "\nws4.InitializeFrom(DataSource);" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "var inputFileName = \"Data/DataNodeParameter_MissingNonRequiredColumns.csv\";", - "\nvar errorsBm = new List(){};", - "\nvar activity = await CheckErrors(inputFileName, errorsBm, ws4);", - "\nactivity" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "var ws5 = Workspace.CreateNew();", - "\nws5.InitializeFrom(DataSource);" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, { "cell_type": "code", "source": [ - "var inputFileName = \"Data/DataNodeParameter_InvalidParameters.csv\";", - "\nvar errorsBm = new List(){Get(Error.InvalidInterpolationMethod, \"DT1.1\"), ", - "\n Get(Error.InvalidCashFlowPeriodicity, \"DT1.2\"),", - "\n Get(Error.InvalidCashFlowPeriodicity, \"DT1.3\"),", - "\n Get(Error.InvalidInterpolationMethod, \"DT1.4\"),", - "\n Get(Error.InvalidInterpolationMethod, \"DT1.5\"),", - "\n Get(Error.InvalidEconomicBasisDriver, \"DT1.6\"),", - "\n Get(Error.InvalidEconomicBasisDriver, \"DT1.7\"),", - "\n ", - "\n };", - "\nvar activity = await CheckErrors(inputFileName, errorsBm, ws5);", - "\nactivity" + "" ], "metadata": {}, "execution_count": 0, From 59522417ed01bfd7a4eb1133de7f21555ece9ad6 Mon Sep 17 00:00:00 2001 From: Slavomir Batka Date: Mon, 22 May 2023 17:58:23 +0200 Subject: [PATCH 29/55] allow CashFlowPeriodicity and InterpolationMethod in cashflow importer --- ifrs17/Import/Importers.ipynb | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index 9d475348..b0dd1c15 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -1372,6 +1372,8 @@ "\n if(Activity.HasErrors()) return Activity.Finish();", "\n ", "\n var hasAccidentYearColumn = dataSet.Tables[ImportFormats.Cashflow].Columns.Any(x => x.ColumnName == nameof(RawVariable.AccidentYear));", + "\n var hasPeriodicityColumn = dataSet.Tables[ImportFormats.Cashflow].Columns.Any(x => x.ColumnName == nameof(CashFlowPeriodicity));", + "\n var hasInterpolationMethod = dataSet.Tables[ImportFormats.Cashflow].Columns.Any(x => x.ColumnName == nameof(InterpolationMethod));", "\n ", "\n var importLog = await Import.FromDataSet(dataSet)", "\n .WithType ( (dataset, datarow) => {", @@ -1379,6 +1381,17 @@ "\n var novelty = datarow.Field(nameof(RawVariable.Novelty));", "\n var dataNode = datarow.Field(nameof(DataNode));", "\n ", + "\n // CashflowPeriodicity given by the Cashflows or else taken from the SingleDataNodeParameters", + "\n var cashFlowPeriodicity = hasPeriodicityColumn && (Enum.TryParse(datarow.Field(nameof(CashFlowPeriodicity)), out CashFlowPeriodicity cfp))", + "\n ? cfp", + "\n : parsingStorage.GetCashFlowPeriodicity(dataNode);", + "\n", + "\n // InterpolationMethod given by the Cashflows or else taken from the SingleDataNodeParameters", + "\n var interpolationMethod = hasInterpolationMethod && (Enum.TryParse(datarow.Field(nameof(InterpolationMethod)), out InterpolationMethod ip))", + "\n ? ip", + "\n : parsingStorage.GetInterpolationMethod(dataNode);", + "\n ", + "\n", "\n if(!parsingStorage.DataNodeDataBySystemName.TryGetValue(dataNode, out var dataNodeData)) {", "\n ApplicationMessage.Log(Error.InvalidDataNode, dataNode);", "\n return null;", @@ -1417,7 +1430,7 @@ "\n : (int?)null,", "\n Partition = parsingStorage.TargetPartitionByReportingNodeAndPeriod.Id,", "\n Values = Multiply(GetSign(ImportFormats.Cashflow, (aocType, valueType.AmountType, valueType.EstimateType, dataNodeData.IsReinsurance), parsingStorage.HierarchyCache), values)", - "\n .Interpolate(parsingStorage.GetCashFlowPeriodicity(dataNode), parsingStorage.GetInterpolationMethod(dataNode))", + "\n .Interpolate(cashFlowPeriodicity, interpolationMethod)", "\n };", "\n return item;", "\n }, ImportFormats.Cashflow", From be46b8404f4063836b359928a32e10e8bb9f89a4 Mon Sep 17 00:00:00 2001 From: Davide Colleoni Date: Mon, 22 May 2023 22:06:30 +0200 Subject: [PATCH 30/55] fix tests --- ifrs17/Test/DataNodeParameterTest.ipynb | 5 ++--- ifrs17/Test/ReportStorageTest.ipynb | 21 ++------------------- ifrs17/Test/TestData.ipynb | 7 +++---- 3 files changed, 7 insertions(+), 26 deletions(-) diff --git a/ifrs17/Test/DataNodeParameterTest.ipynb b/ifrs17/Test/DataNodeParameterTest.ipynb index c4fe710f..1567634a 100644 --- a/ifrs17/Test/DataNodeParameterTest.ipynb +++ b/ifrs17/Test/DataNodeParameterTest.ipynb @@ -66,7 +66,7 @@ { "cell_type": "code", "source": [ - "await DataSource.UpdateAsync(reportingNodeG.RepeatOnce());", + "await DataSource.UpdateAsync(reportingNodes);", "\nawait DataSource.UpdateAsync(dt1.RepeatOnce());", "\nawait DataSource.UpdateAsync(dtr1.RepeatOnce());", "\nawait DataSource.UpdateAsync(new [] {dt11});", @@ -79,8 +79,7 @@ { "cell_type": "code", "source": [ - "await DataSource.UpdateAsync(new [ ] {dt11State,dtr11State});", - "\n// await DataSource.UpdateAsync(new [ ] {dt11Inter});" + "await DataSource.UpdateAsync(new [ ] {dt11State,dtr11State});" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17/Test/ReportStorageTest.ipynb b/ifrs17/Test/ReportStorageTest.ipynb index 8d2c9414..db77027a 100644 --- a/ifrs17/Test/ReportStorageTest.ipynb +++ b/ifrs17/Test/ReportStorageTest.ipynb @@ -38,7 +38,8 @@ { "cell_type": "code", "source": [ - "await DataSource.UpdateAsync(reportingNodeG.RepeatOnce());" + "await DataSource.UpdateAsync(reportingNodes);", + "\nawait DataSource.UpdateAsync(new[]{partition, previousPeriodPartition});" ], "metadata": {}, "execution_count": 0, @@ -119,24 +120,6 @@ "execution_count": 0, "outputs": [] }, - { - "cell_type": "code", - "source": [ - "activity.Status.Should().Be(ActivityLogStatus.Succeeded);" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "Workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, { "cell_type": "code", "source": [ diff --git a/ifrs17/Test/TestData.ipynb b/ifrs17/Test/TestData.ipynb index 682273b3..8b5f8e0f 100644 --- a/ifrs17/Test/TestData.ipynb +++ b/ifrs17/Test/TestData.ipynb @@ -220,10 +220,9 @@ { "cell_type": "code", "source": [ - "var reportingNodeG = new ReportingNode() {", - "\n SystemName = \"CH\",", - "\n DisplayName = \"Switzerland\",", - "\n Currency = \"CHF\"", + "var reportingNodes = new ReportingNode[] {", + "\n new ReportingNode() {SystemName = \"CH\",DisplayName = \"Switzerland\",Currency = \"CHF\"},", + "\n new ReportingNode() {SystemName = \"G\",DisplayName = \"Group\",Currency = \"CHF\"},", "\n};" ], "metadata": {}, From 9d4200347c019c4c7585c93fe3f9676ca19a733e Mon Sep 17 00:00:00 2001 From: Slavomir Batka Date: Tue, 23 May 2023 09:38:30 +0200 Subject: [PATCH 31/55] renaming --- ifrs17/Constants/Validations.ipynb | 2 +- ifrs17/DataModel/DataStructure.ipynb | 6 +++--- ifrs17/Import/ImportStorage.ipynb | 4 ++-- ifrs17/Import/Importers.ipynb | 19 +++++++------------ 4 files changed, 13 insertions(+), 18 deletions(-) diff --git a/ifrs17/Constants/Validations.ipynb b/ifrs17/Constants/Validations.ipynb index 5b85122f..e91c6e17 100644 --- a/ifrs17/Constants/Validations.ipynb +++ b/ifrs17/Constants/Validations.ipynb @@ -157,7 +157,7 @@ "\n (Error.InvalidCashFlowPeriodicity , 1) => $\"Invalid CashFlowPeriodicity parameter for Data Node {s[0]}.\",", "\n (Error.InvalidInterpolationMethod , 1) => $\"Invalid InterpolationMethod parameter for Data Node {s[0]}.\",", "\n (Error.InvalidEconomicBasisDriver , 1) => $\"Invalid EconomicBasisDriver parameter for Data Node {s[0]}.\",", - "\n (Error.InvalidAmortizationFactors , 1) => $\"Invalid AmortizationFactor parameters for Data Node {s[0]}.\",", + "\n (Error.InvalidReleasePattern , 1) => $\"Invalid ReleasePattern parameters for Data Node {s[0]}.\",", "\n ", "\n // Storage", "\n (Error.DataNodeNotFound , 1) => $\"DataNode {s[0]} not found.\",", diff --git a/ifrs17/DataModel/DataStructure.ipynb b/ifrs17/DataModel/DataStructure.ipynb index 1391da26..7478c970 100644 --- a/ifrs17/DataModel/DataStructure.ipynb +++ b/ifrs17/DataModel/DataStructure.ipynb @@ -1566,9 +1566,9 @@ "\n", "\n
InterpolationMethod : defines the interpolation method to be applied to interpolate the cash flow to the monthly granularity, it is not a mandatory input. Supported values can be found [here](../Constants/Enums#interpolation-method). When the *InterpolationMethod* is not present in the input file or the *CashFlowPeriodicity* has the default value, then the default value for the *InterpolationMethod* is applied. The default value is Not Applicable. ", "\n", - "\n
Amortization Pattern : defines the pattern of factors that will be used to defer and amortize any AmountType over the course of contract term. It is not a mandatory input. Note this pattern is the fallback if no *Amortizaltion Pattern* is provided in the Cashflows, specified by AmountType and EstimateType.", + "\n
Release Pattern : defines the pattern of factors that will be used to defer and amortize any AmountType over the course of contract term. It is not a mandatory input. Note, this pattern is used, if no *Release Pattern* is provided in the Cashflows (which is specified for combinations of AmountType, EstimateType and AocType). Note that the Release Pattern needs at least a column with 'Value0' corresponding to the first value of annual cohort.", "\n", - "\n
EconomicBasisDriver : defines the economic basis that will be used in discounting any Amortization Pattern. It is not a mandatory input. Supported values are the defined values for [EconomicBasis](#economic-basis). When the *EconomicBasisDriver* is not present in the input file, then the default value for the *EconomicBasisDriver* is applied. The default value is *Locked-in* rates for Building Block Approach, *Current* rates for Variable Fee Approach and Premium Allocation Approach for liabilities of incurred claims and *Nominal* for Premium Allocation Approach for liabilities of remaining coverage.", + "\n
EconomicBasisDriver : defines the economic basis that will be used in discounting any Release Pattern. It is not a mandatory input. Supported values are the defined values for [EconomicBasis](#economic-basis). When the *EconomicBasisDriver* is not present in the input file, then the default value for the *EconomicBasisDriver* is applied. The default value is *Locked-in* rates for Building Block Approach, *Current* rates for Variable Fee Approach and Premium Allocation Approach for liabilities of incurred claims and *Nominal* for Premium Allocation Approach for liabilities of remaining coverage.", "\n", "\n
ReinsuranceCoverage : defines the weight of the underlying gross business to be considered in the computation of the allocation of the Technical Margin in a Reinsurance case. In other words, it represents the percentage to which claims in the underlying GICs are expected to be reinboursed by the Reinsurance Contracts belonging to the GRIC. For proportional contracts, this factor is given by the cession while for other contracts it should be estimated. ", "\n", @@ -1640,7 +1640,7 @@ "\n", "\n [Conversion(typeof(PrimitiveArrayConverter))]", "\n [Display(Order = 60)]", - "\n public double[] AmortizationFactor {get; init;}", + "\n public double[] ReleasePattern {get; init;}", "\n", "\n}", "\n", diff --git a/ifrs17/Import/ImportStorage.ipynb b/ifrs17/Import/ImportStorage.ipynb index 91b6f945..cfd3bbaa 100644 --- a/ifrs17/Import/ImportStorage.ipynb +++ b/ifrs17/Import/ImportStorage.ipynb @@ -370,8 +370,8 @@ "\n public double GetPremiumAllocationFactor(ImportIdentity id) => SingleDataNodeParametersByGoc.TryGetValue(id.DataNode, out var singleDataNodeParameter) ", "\n ? singleDataNodeParameter[CurrentPeriod].PremiumAllocation : DefaultPremiumExperienceAdjustmentFactor;", "\n", - "\n public double[] GetAmortizationFactor(ImportIdentity id, string amountType) => SingleDataNodeParametersByGoc.TryGetValue(id.DataNode, out var singleDataNodeParameter) ", - "\n ? singleDataNodeParameter[CurrentPeriod].AmortizationFactor : default;", + "\n public double[] GetReleasePattern(ImportIdentity id, string amountType) => SingleDataNodeParametersByGoc.TryGetValue(id.DataNode, out var singleDataNodeParameter) ", + "\n ? singleDataNodeParameter[CurrentPeriod].ReleasePattern : default;", "\n", "\n ", "\n // Data Node relationships", diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index b0dd1c15..3a5263db 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -1182,7 +1182,7 @@ "\n var hasCashFlowPeriodicityColumn = dataSet.Tables[nameof(SingleDataNodeParameter)].Columns.Any(x => x.ColumnName == nameof(SingleDataNodeParameter.CashFlowPeriodicity));", "\n var hasInterpolationMethodColumn = dataSet.Tables[nameof(SingleDataNodeParameter)].Columns.Any(x => x.ColumnName == nameof(SingleDataNodeParameter.InterpolationMethod));", "\n var hasEconomicBasisDriver = dataSet.Tables[nameof(SingleDataNodeParameter)].Columns.Any(x => x.ColumnName == nameof(SingleDataNodeParameter.EconomicBasisDriver));", - "\n var hasAmortizationFactors = dataSet.Tables[nameof(SingleDataNodeParameter)].Columns.Any(x => x.ColumnName.StartsWith(nameof(SingleDataNodeParameter.AmortizationFactor)));", + "\n var hasReleasePattern = dataSet.Tables[nameof(SingleDataNodeParameter)].Columns.Any(x => x.ColumnName.StartsWith(nameof(SingleDataNodeParameter.ReleasePattern)));", "\n", "\n var importLog = await Import.FromDataSet(dataSet)", "\n .WithType( (dataset, datarow) => {", @@ -1213,16 +1213,11 @@ "\n string economicBasisDriver = default;", "\n if(hasEconomicBasisDriver)", "\n economicBasisDriver = storage.ValidateEconomicBasisDriver(datarow.Field(nameof(SingleDataNodeParameter.EconomicBasisDriver)), dataNode);", - "\n // var economicBasisDriverInput = datarow.Field(nameof(SingleDataNodeParameter.EconomicBasisDriver));", - "\n // if (string.IsNullOrEmpty(economicBasisDriverInput) && S)", - "\n // economicBasisDriver = economicBasisDriverInput;", - "\n // else { ApplicationMessage.Log(Error.InvalidEconomicBasisDriver, dataNode); return null; }", - "\n ", - "\n ", - "\n double[] amortizationFactors = default;", - "\n if(hasAmortizationFactors)", - "\n amortizationFactors = datarow.Table.Columns", - "\n .Where(c => c.ColumnName.StartsWith(nameof(SingleDataNodeParameter.AmortizationFactor)))", + "\n ", + "\n double[] releasePattern = default;", + "\n if(hasReleasePattern)", + "\n releasePattern = datarow.Table.Columns", + "\n .Where(c => c.ColumnName.StartsWith(nameof(SingleDataNodeParameter.ReleasePattern)))", "\n .OrderBy(c => c.ColumnName.Length).ThenBy(c => c.ColumnName)", "\n .Select(x => datarow.Field(x.ColumnName).CheckStringForExponentialAndConvertToDouble())", "\n .ToArray().Prune();", @@ -1237,7 +1232,7 @@ "\n CashFlowPeriodicity = periodicity,", "\n InterpolationMethod = interpolationMethod,", "\n EconomicBasisDriver = economicBasisDriver,", - "\n AmortizationFactor = amortizationFactors,", + "\n ReleasePattern = releasePattern,", "\n PremiumAllocation = (datarow.Field(nameof(SingleDataNodeParameter.PremiumAllocation)))", "\n .ToString().CheckStringForExponentialAndConvertToDouble(),", "\n };", From cb180d12e70e9f4b3b9ac38c092cc65d5f6c4a8e Mon Sep 17 00:00:00 2001 From: Slavomir Batka Date: Tue, 23 May 2023 09:40:27 +0200 Subject: [PATCH 32/55] fix validations --- ifrs17/Constants/Validations.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ifrs17/Constants/Validations.ipynb b/ifrs17/Constants/Validations.ipynb index e91c6e17..df111dfa 100644 --- a/ifrs17/Constants/Validations.ipynb +++ b/ifrs17/Constants/Validations.ipynb @@ -76,7 +76,7 @@ "\n // Data Note State", "\n ChangeDataNodeState, InactiveDataNodeState,", "\n // Parameters", - "\n ReinsuranceCoverageDataNode, DuplicateInterDataNode, DuplicateSingleDataNode, InvalidDataNode, InvalidDataNodeForOpening, InvalidCashFlowPeriodicity, InvalidInterpolationMethod, InvalidEconomicBasisDriver, InvalidAmortizationFactors,", + "\n ReinsuranceCoverageDataNode, DuplicateInterDataNode, DuplicateSingleDataNode, InvalidDataNode, InvalidDataNodeForOpening, InvalidCashFlowPeriodicity, InvalidInterpolationMethod, InvalidEconomicBasisDriver, InvalidReleasePattern,", "\n // Storage", "\n DataNodeNotFound, PartnerNotFound, RatingNotFound, CreditDefaultRateNotFound, MissingPremiumAllocation, ReinsuranceCoverage, ", "\n YieldCurveNotFound, YieldCurvePeriodNotApplicable, EconomicBasisNotFound, AccountingVariableTypeNotFound,", From f6dbd76e7ae9dcb13fd835fc9b748ef15e12e515 Mon Sep 17 00:00:00 2001 From: Slavomir Batka Date: Tue, 23 May 2023 13:32:55 +0200 Subject: [PATCH 33/55] more importer changes --- ifrs17/Import/Importers.ipynb | 47 +++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index 3a5263db..aa5f0a23 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -1181,7 +1181,7 @@ "\n", "\n var hasCashFlowPeriodicityColumn = dataSet.Tables[nameof(SingleDataNodeParameter)].Columns.Any(x => x.ColumnName == nameof(SingleDataNodeParameter.CashFlowPeriodicity));", "\n var hasInterpolationMethodColumn = dataSet.Tables[nameof(SingleDataNodeParameter)].Columns.Any(x => x.ColumnName == nameof(SingleDataNodeParameter.InterpolationMethod));", - "\n var hasEconomicBasisDriver = dataSet.Tables[nameof(SingleDataNodeParameter)].Columns.Any(x => x.ColumnName == nameof(SingleDataNodeParameter.EconomicBasisDriver));", + "\n var hasEconomicBasisDriverColumn = dataSet.Tables[nameof(SingleDataNodeParameter)].Columns.Any(x => x.ColumnName == nameof(SingleDataNodeParameter.EconomicBasisDriver));", "\n var hasReleasePattern = dataSet.Tables[nameof(SingleDataNodeParameter)].Columns.Any(x => x.ColumnName.StartsWith(nameof(SingleDataNodeParameter.ReleasePattern)));", "\n", "\n var importLog = await Import.FromDataSet(dataSet)", @@ -1209,11 +1209,12 @@ "\n interpolationMethod = ipm;", "\n else if ( !(periodicity == (CashFlowPeriodicity)default && string.IsNullOrEmpty(interpolationMethodInput)) ) { ApplicationMessage.Log(Error.InvalidInterpolationMethod, dataNode); return null; }", "\n }", + "\n ", + "\n string economicBasisDriverInput = default;", + "\n if(hasEconomicBasisDriverColumn)", + "\n economicBasisDriverInput = datarow.Field(nameof(SingleDataNodeParameter.EconomicBasisDriver));", + "\n var economicBasisDriver = storage.ValidateEconomicBasisDriver(economicBasisDriverInput, dataNode);", "\n", - "\n string economicBasisDriver = default;", - "\n if(hasEconomicBasisDriver)", - "\n economicBasisDriver = storage.ValidateEconomicBasisDriver(datarow.Field(nameof(SingleDataNodeParameter.EconomicBasisDriver)), dataNode);", - "\n ", "\n double[] releasePattern = default;", "\n if(hasReleasePattern)", "\n releasePattern = datarow.Table.Columns", @@ -1367,31 +1368,41 @@ "\n if(Activity.HasErrors()) return Activity.Finish();", "\n ", "\n var hasAccidentYearColumn = dataSet.Tables[ImportFormats.Cashflow].Columns.Any(x => x.ColumnName == nameof(RawVariable.AccidentYear));", - "\n var hasPeriodicityColumn = dataSet.Tables[ImportFormats.Cashflow].Columns.Any(x => x.ColumnName == nameof(CashFlowPeriodicity));", - "\n var hasInterpolationMethod = dataSet.Tables[ImportFormats.Cashflow].Columns.Any(x => x.ColumnName == nameof(InterpolationMethod));", + "\n var hasCashFlowPeriodicityColumn = dataSet.Tables[ImportFormats.Cashflow].Columns.Any(x => x.ColumnName == nameof(CashFlowPeriodicity));", + "\n var hasInterpolationMethodColumn = dataSet.Tables[ImportFormats.Cashflow].Columns.Any(x => x.ColumnName == nameof(InterpolationMethod));", "\n ", "\n var importLog = await Import.FromDataSet(dataSet)", "\n .WithType ( (dataset, datarow) => {", "\n var aocType = datarow.Field(nameof(RawVariable.AocType));", "\n var novelty = datarow.Field(nameof(RawVariable.Novelty));", "\n var dataNode = datarow.Field(nameof(DataNode));", - "\n ", + "\n", "\n // CashflowPeriodicity given by the Cashflows or else taken from the SingleDataNodeParameters", - "\n var cashFlowPeriodicity = hasPeriodicityColumn && (Enum.TryParse(datarow.Field(nameof(CashFlowPeriodicity)), out CashFlowPeriodicity cfp))", - "\n ? cfp", - "\n : parsingStorage.GetCashFlowPeriodicity(dataNode);", - "\n", - "\n // InterpolationMethod given by the Cashflows or else taken from the SingleDataNodeParameters", - "\n var interpolationMethod = hasInterpolationMethod && (Enum.TryParse(datarow.Field(nameof(InterpolationMethod)), out InterpolationMethod ip))", - "\n ? ip", - "\n : parsingStorage.GetInterpolationMethod(dataNode);", - "\n ", + "\n CashFlowPeriodicity cashFlowPeriodicity = default;", + "\n if (hasCashFlowPeriodicityColumn)", + "\n {", + "\n var cashFlowPeriodicityInput = datarow.Field(nameof(SingleDataNodeParameter.CashFlowPeriodicity)); ", + "\n if (Enum.TryParse(cashFlowPeriodicityInput, out CashFlowPeriodicity cfp))", + "\n cashFlowPeriodicity = cfp;", + "\n //else if (!string.IsNullOrEmpty(cashFlowPeriodicityInput)) {ApplicationMessage.Log(Error.InvalidCashFlowPeriodicity, dataNode); return null;}", + "\n }", + "\n else parsingStorage.GetCashFlowPeriodicity(dataNode);", + "\n", + "\n InterpolationMethod interpolationMethod = default;", + "\n if(hasInterpolationMethodColumn)", + "\n {", + "\n var interpolationMethodInput = datarow.Field(nameof(SingleDataNodeParameter.InterpolationMethod));", + "\n if ( Enum.TryParse(interpolationMethodInput, out InterpolationMethod ipm)) ", + "\n interpolationMethod = ipm;", + "\n else if ( !(cashFlowPeriodicity == (CashFlowPeriodicity)default && string.IsNullOrEmpty(interpolationMethodInput)) ) { ApplicationMessage.Log(Error.InvalidInterpolationMethod, dataNode); return null; }", + "\n }", + "\n else parsingStorage.GetInterpolationMethod(dataNode);", "\n", "\n if(!parsingStorage.DataNodeDataBySystemName.TryGetValue(dataNode, out var dataNodeData)) {", "\n ApplicationMessage.Log(Error.InvalidDataNode, dataNode);", "\n return null;", "\n }", - "\n ", + "\n", "\n // Error if AocType is not present in the mapping", "\n if(!parsingStorage.AocTypeMap.Contains(new AocStep(aocType, novelty))) {", "\n ApplicationMessage.Log(Error.AocTypeMapNotFound, aocType, novelty);", From 9cfeaa34b1507e50fdf83d3db2960d77245ab380 Mon Sep 17 00:00:00 2001 From: Davide Colleoni Date: Tue, 23 May 2023 14:24:53 +0200 Subject: [PATCH 34/55] normalize and test --- ifrs17/Import/Importers.ipynb | 10 +-- ....ipynb => DoubleArrayExtentionsTest.ipynb} | 66 +++++++++++++++++++ ifrs17/Test/Tests.ipynb | 2 +- ifrs17/Utils/Extensions.ipynb | 13 ++++ 4 files changed, 83 insertions(+), 8 deletions(-) rename ifrs17/Test/{AggregateInterpolateTest.ipynb => DoubleArrayExtentionsTest.ipynb} (77%) diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index b0dd1c15..351a86b5 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -1210,14 +1210,10 @@ "\n else if ( !(periodicity == (CashFlowPeriodicity)default && string.IsNullOrEmpty(interpolationMethodInput)) ) { ApplicationMessage.Log(Error.InvalidInterpolationMethod, dataNode); return null; }", "\n }", "\n", - "\n string economicBasisDriver = default;", + "\n string economicBasisDriverInput = default;", "\n if(hasEconomicBasisDriver)", - "\n economicBasisDriver = storage.ValidateEconomicBasisDriver(datarow.Field(nameof(SingleDataNodeParameter.EconomicBasisDriver)), dataNode);", - "\n // var economicBasisDriverInput = datarow.Field(nameof(SingleDataNodeParameter.EconomicBasisDriver));", - "\n // if (string.IsNullOrEmpty(economicBasisDriverInput) && S)", - "\n // economicBasisDriver = economicBasisDriverInput;", - "\n // else { ApplicationMessage.Log(Error.InvalidEconomicBasisDriver, dataNode); return null; }", - "\n ", + "\n economicBasisDriverInput = datarow.Field(nameof(SingleDataNodeParameter.EconomicBasisDriver));", + "\n var economicBasisDriver = storage.ValidateEconomicBasisDriver(economicBasisDriverInput, dataNode); ", "\n ", "\n double[] amortizationFactors = default;", "\n if(hasAmortizationFactors)", diff --git a/ifrs17/Test/AggregateInterpolateTest.ipynb b/ifrs17/Test/DoubleArrayExtentionsTest.ipynb similarity index 77% rename from ifrs17/Test/AggregateInterpolateTest.ipynb rename to ifrs17/Test/DoubleArrayExtentionsTest.ipynb index c21656c2..d0ac5cf5 100644 --- a/ifrs17/Test/AggregateInterpolateTest.ipynb +++ b/ifrs17/Test/DoubleArrayExtentionsTest.ipynb @@ -214,6 +214,72 @@ "metadata": {}, "execution_count": 0, "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Normalize" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public void CheckNormalizedArray(IEnumerable source, double[] benchmark)", + "\n{", + "\n var res = source.Normalize();", + "\n res.Should().BeEquivalentTo(benchmark);", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var array = new double[]{1,1,1};", + "\nvar benchmark = new double[]{1d/3d,1d/3d,1d/3d};", + "\nCheckNormalizedArray(array, benchmark);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var array = new double[]{-1,-1,-1};", + "\nvar benchmark = new double[]{1d/3d,1d/3d,1d/3d};", + "\nCheckNormalizedArray(array, benchmark);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var array = new double[]{-1,+1,-1,+1};", + "\nvar benchmark = (double[])null;", + "\nCheckNormalizedArray(array, benchmark);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var array = new double[]{};", + "\nvar benchmark = (double[])null;", + "\nCheckNormalizedArray(array, benchmark);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/ifrs17/Test/Tests.ipynb b/ifrs17/Test/Tests.ipynb index 99916537..5cb3f2c1 100644 --- a/ifrs17/Test/Tests.ipynb +++ b/ifrs17/Test/Tests.ipynb @@ -57,7 +57,7 @@ { "cell_type": "code", "source": [ - "#!eval-notebook \"AggregateInterpolateTest\"" + "#!eval-notebook \"DoubleArrayExtentionsTest\"" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17/Utils/Extensions.ipynb b/ifrs17/Utils/Extensions.ipynb index 58b71330..eb8ae6dc 100644 --- a/ifrs17/Utils/Extensions.ipynb +++ b/ifrs17/Utils/Extensions.ipynb @@ -140,6 +140,19 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "code", + "source": [ + "public static double[] Normalize(this IEnumerable source) {", + "\n var norm = source.Sum();", + "\n if(Math.Abs(norm) < 10E-12)", + "\n return default;", + "\n return source.Select(v => v / norm).ToArray();}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "markdown", "source": [ From 733c7af6b3326c254a83dd47aaac7681ab80ec38 Mon Sep 17 00:00:00 2001 From: Davide Colleoni Date: Tue, 23 May 2023 14:25:56 +0200 Subject: [PATCH 35/55] refactor the amortization factor calc --- ifrs17/Import/2ImportScope-PresentValue.ipynb | 33 +++++++++---------- ifrs17/Import/3ImportScope-Actuals.ipynb | 2 +- .../Import/4ImportScope-TechnicalMargin.ipynb | 2 +- ifrs17/Import/5ImportScope-ToIfrsVar.ipynb | 11 ++++--- ifrs17/Import/ImportStorage.ipynb | 26 ++++++++++++--- 5 files changed, 45 insertions(+), 29 deletions(-) diff --git a/ifrs17/Import/2ImportScope-PresentValue.ipynb b/ifrs17/Import/2ImportScope-PresentValue.ipynb index dc8994f1..2c2b4ee8 100644 --- a/ifrs17/Import/2ImportScope-PresentValue.ipynb +++ b/ifrs17/Import/2ImportScope-PresentValue.ipynb @@ -793,17 +793,14 @@ { "cell_type": "code", "source": [ - "public interface CoverageUnitCashflow : IScope", + "public interface PatternPv : IScope<(ImportIdentity Id, string AmountType), ImportStorage>", "\n{ ", "\n [NotVisible] string EconomicBasis => GetContext();", "\n ", - "\n [IdentityProperty][NotVisible][Dimension(typeof(AmountType))]", - "\n string AmountType => AmountTypes.CU;", - "\n ", "\n [IdentityProperty][NotVisible][Dimension(typeof(EstimateType))]", "\n string EstimateType => EstimateTypes.P; ", "\n", - "\n double[] Values => GetScope((Identity, AmountType, EstimateType, (int?)null)).Values;", + "\n double[] Values => GetScope((Identity.Id, Identity.AmountType, EstimateType, (int?)null)).Values;", "\n}" ], "metadata": {}, @@ -849,15 +846,18 @@ { "cell_type": "code", "source": [ - "public interface MonthlyAmortizationFactorCashflow : IScope", + "public interface MonthlyAmortizationFactorCashflow : IScope<(ImportIdentity Id, string AmountType), ImportStorage>", "\n{", - "\n private double[] NominalCuCashflow => GetScope((Identity with {AocType = AocTypes.CL}, AmountTypes.CU, EstimateTypes.P, (int?)null)).Values;", - "\n private double[] DiscountedCuCashflow => Multiply(-1d, GetScope(Identity with {AocType = AocTypes.CL}, o => o.WithContext(EconomicBasis)).Values);", + "\n private double[] releasePattern => GetStorage().GetReleasePattern(Identity.Id, Identity.AmountType);", + "\n", + "\n private PeriodType periodType => GetStorage().GetPeriodType(Identity.AmountType, EstimateTypes.P);", + "\n private double[] monthlyDiscounting => GetScope(Identity.Id).Discount;", + "\n private double[] cdcPattern => Multiply(-1d, releasePattern.ComputeDiscountAndCumulate(monthlyDiscounting, periodType)); ", "\n ", "\n [NotVisible] string EconomicBasis => GetContext();", "\n ", - "\n double[] MonthlyAmortizationFactors => Identity.AocType switch {", - "\n AocTypes.AM when NominalCuCashflow.Any() => NominalCuCashflow.Zip(DiscountedCuCashflow, //Extract to an other scope with month in the identity to avoid Zip?", + "\n double[] MonthlyAmortizationFactors => Identity.Id.AocType switch {", + "\n AocTypes.AM when releasePattern.Any() => releasePattern.Zip(cdcPattern, //Extract to an other scope with month in the identity to avoid Zip?", "\n (nominal, discountedCumulated) => Math.Abs(discountedCumulated) >= Precision ? Math.Max(0, 1 - nominal / discountedCumulated) : 0).ToArray(),", "\n _ => Enumerable.Empty().ToArray(),", "\n };", @@ -887,15 +887,15 @@ { "cell_type": "code", "source": [ - "public interface CurrentPeriodAmortizationFactor : IScope", + "public interface CurrentPeriodAmortizationFactor : IScope<(ImportIdentity Id, string AmountType), ImportStorage>", "\n{", "\n static ApplicabilityBuilder ScopeApplicabilityBuilder(ApplicabilityBuilder builder) =>", "\n builder.ForScope(s => ", "\n s.WithApplicability(x => x.GetStorage().ImportFormat != ImportFormats.Cashflow", - "\n || x.GetStorage().IsSecondaryScope(x.Identity.DataNode)));", + "\n || x.GetStorage().IsSecondaryScope(x.Identity.Id.DataNode)));", "\n", - "\n private int shift => GetStorage().GetShift(Identity.ProjectionPeriod);", - "\n private int timeStep => GetStorage().GetTimeStep(Identity.ProjectionPeriod);", + "\n private int shift => GetStorage().GetShift(Identity.Id.ProjectionPeriod);", + "\n private int timeStep => GetStorage().GetTimeStep(Identity.Id.ProjectionPeriod);", "\n private double amortizedFactor => GetScope(Identity)", "\n .MonthlyAmortizationFactors", "\n .Skip(shift)", @@ -909,9 +909,8 @@ "\n double Value => 1d - amortizedFactor;", "\n}", "\n", - "\npublic interface AmfFromIfrsVariable : CurrentPeriodAmortizationFactor", - "\n{", - "\n double CurrentPeriodAmortizationFactor.Value => GetStorage().GetValue(Identity, (string)null, EstimateType, EconomicBasis, (int?)null, Identity.ProjectionPeriod);", + "\npublic interface AmfFromIfrsVariable : CurrentPeriodAmortizationFactor{", + "\n double CurrentPeriodAmortizationFactor.Value => GetStorage().GetValue(Identity.Id, Identity.AmountType, EstimateType, EconomicBasis, (int?)null, Identity.Id.ProjectionPeriod);", "\n}" ], "metadata": {}, diff --git a/ifrs17/Import/3ImportScope-Actuals.ipynb b/ifrs17/Import/3ImportScope-Actuals.ipynb index 35c5d9d3..4cbe071d 100644 --- a/ifrs17/Import/3ImportScope-Actuals.ipynb +++ b/ifrs17/Import/3ImportScope-Actuals.ipynb @@ -315,7 +315,7 @@ "\n", "\npublic interface AmortizationDeferrable : DeferrableActual", "\n{", - "\n private double AmortizationFactor => GetScope(Identity, o => o.WithContext(EconomicBasis)).Value;", + "\n private double AmortizationFactor => GetScope((Identity, AmountTypes.CU), o => o.WithContext(EconomicBasis)).Value;", "\n private double AggregatedDeferrable => GetScope((Identity, InputSource.Actual)).Values", "\n .Sum(aocStep => GetScope(Identity with {AocType = aocStep.AocType, Novelty = aocStep.Novelty}).Value);", "\n double DeferrableActual.Value => -1d * AggregatedDeferrable * AmortizationFactor;", diff --git a/ifrs17/Import/4ImportScope-TechnicalMargin.ipynb b/ifrs17/Import/4ImportScope-TechnicalMargin.ipynb index 76305353..603ddf28 100644 --- a/ifrs17/Import/4ImportScope-TechnicalMargin.ipynb +++ b/ifrs17/Import/4ImportScope-TechnicalMargin.ipynb @@ -304,7 +304,7 @@ "\n static ApplicabilityBuilder ScopeApplicabilityBuilder(ApplicabilityBuilder builder) =>", "\n builder.ForScope(s => s.WithApplicability(x => x.Identity.ValuationApproach == ValuationApproaches.PAA)); ", "\n ", - "\n double TechnicalMargin.Value => -1d * AggregatedValue * GetScope(Identity, o => o.WithContext(EconomicBasis)).Value;", + "\n double TechnicalMargin.Value => -1d * AggregatedValue * GetScope((Identity, AmountTypes.CU), o => o.WithContext(EconomicBasis)).Value;", "\n}", "\n", "\npublic interface TechnicalMarginForAmForPaa : TechnicalMargin", diff --git a/ifrs17/Import/5ImportScope-ToIfrsVar.ipynb b/ifrs17/Import/5ImportScope-ToIfrsVar.ipynb index 94dd2b44..e76faf03 100644 --- a/ifrs17/Import/5ImportScope-ToIfrsVar.ipynb +++ b/ifrs17/Import/5ImportScope-ToIfrsVar.ipynb @@ -266,14 +266,15 @@ "\n{", "\n private string EconomicBasis => Identity.ValuationApproach == ValuationApproaches.VFA ? EconomicBases.C : EconomicBases.L;", "\n IEnumerable AmortizationFactor => Identity.AocType == AocTypes.AM", - "\n ? GetScope(Identity, o => o.WithContext(EconomicBasis))", + "\n ? GetScope((Identity, AmountTypes.CU), o => o.WithContext(EconomicBasis))", "\n .RepeatOnce()", "\n .Select(x => new IfrsVariable{ EstimateType = x.EstimateType,", - "\n DataNode = x.Identity.DataNode,", - "\n AocType = x.Identity.AocType,", - "\n Novelty = x.Identity.Novelty,", + "\n DataNode = x.Identity.Id.DataNode,", + "\n AocType = x.Identity.Id.AocType,", + "\n Novelty = x.Identity.Id.Novelty,", + "\n AmountType = x.Identity.AmountType,", "\n EconomicBasis = x.EconomicBasis,", - "\n Values = SetProjectionValue(x.Value, x.Identity.ProjectionPeriod),", + "\n Values = SetProjectionValue(x.Value, x.Identity.Id.ProjectionPeriod),", "\n Partition = GetStorage().TargetPartition", "\n })", "\n : Enumerable.Empty();", diff --git a/ifrs17/Import/ImportStorage.ipynb b/ifrs17/Import/ImportStorage.ipynb index 91b6f945..b32b8ae7 100644 --- a/ifrs17/Import/ImportStorage.ipynb +++ b/ifrs17/Import/ImportStorage.ipynb @@ -367,13 +367,29 @@ "\n return Math.Pow(1d + rate[period].Values[0], 1d / 12d) - 1d;", "\n }", "\n ", - "\n public double GetPremiumAllocationFactor(ImportIdentity id) => SingleDataNodeParametersByGoc.TryGetValue(id.DataNode, out var singleDataNodeParameter) ", - "\n ? singleDataNodeParameter[CurrentPeriod].PremiumAllocation : DefaultPremiumExperienceAdjustmentFactor;", + "\n public double[] GetReleasePattern (ImportIdentity identity, string amountType)", + "\n {", + "\n var patternFromCashflow = GetValues(identity with {AocType = AocTypes.CL, Novelty = Novelties.C}, amountType, EstimateTypes.P, (int?)null);", + "\n if (patternFromCashflow.Any())", + "\n return patternFromCashflow;", + "\n ", + "\n double[] patternFromParameter = default;", + "\n if(!SingleDataNodeParametersByGoc.TryGetValue(identity.DataNode, out var dataNodeParameterByPeriod)){", + "\n ApplicationMessage.Log(Error.InvalidAmortizationFactors, identity.DataNode);", + "\n return patternFromParameter;", + "\n }", + "\n ", + "\n var monthlyPattern = dataNodeParameterByPeriod[CurrentPeriod].AmortizationFactor.Interpolate(dataNodeParameterByPeriod[CurrentPeriod].CashFlowPeriodicity, dataNodeParameterByPeriod[CurrentPeriod].InterpolationMethod);", + "\n return monthlyPattern.Normalize();", + "\n }", + "\n public double GetPremiumAllocationFactor(ImportIdentity id) => ", + "\n SingleDataNodeParametersByGoc.TryGetValue(id.DataNode, out var singleDataNodeParameter) ", + "\n ? singleDataNodeParameter[CurrentPeriod].PremiumAllocation : DefaultPremiumExperienceAdjustmentFactor;", "\n", - "\n public double[] GetAmortizationFactor(ImportIdentity id, string amountType) => SingleDataNodeParametersByGoc.TryGetValue(id.DataNode, out var singleDataNodeParameter) ", - "\n ? singleDataNodeParameter[CurrentPeriod].AmortizationFactor : default;", + "\n public string GetEconomicBasisDriver(ImportIdentity id, string amountType) => ", + "\n SingleDataNodeParametersByGoc.TryGetValue(id.DataNode, out var singleDataNodeParameter)", + "\n ? singleDataNodeParameter[CurrentPeriod].EconomicBasisDriver : default;", "\n", - "\n ", "\n // Data Node relationships", "\n public IEnumerable GetUnderlyingGic(ImportIdentity id) => !InterDataNodeParametersByGoc.TryGetValue(id.DataNode, out var interDataNodeParameters)", "\n ? Enumerable.Empty()", From a047f48a3df00a4ba9729e33ab6333d33944b18d Mon Sep 17 00:00:00 2001 From: Davide Colleoni Date: Tue, 23 May 2023 14:26:17 +0200 Subject: [PATCH 36/55] fix test --- ifrs17/Test/TechnicalMarginTest.ipynb | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/ifrs17/Test/TechnicalMarginTest.ipynb b/ifrs17/Test/TechnicalMarginTest.ipynb index 26c3e2b7..bd1ec8e3 100644 --- a/ifrs17/Test/TechnicalMarginTest.ipynb +++ b/ifrs17/Test/TechnicalMarginTest.ipynb @@ -320,7 +320,7 @@ "\n basicIfrsVariable with {AocType = \"IA\", Novelty = \"N\", Values = new double[] {15.0}},", "\n basicIfrsVariable with {AocType = \"EV\", Novelty = \"N\", Values = new double[] {100.0}},", "\n basicIfrsVariable with {AocType = \"CL\", Novelty = \"C\", Values = new double[] {100.0}},", - "\n basicIfrsVariable with {AocType = \"AM\", Novelty = \"C\", Values = new double[] {0.5}, EstimateType = \"F\", AmountType = null},", + "\n basicIfrsVariable with {AocType = \"AM\", Novelty = \"C\", Values = new double[] {0.5}, EstimateType = \"F\", AmountType = \"CU\"},", "\n };", "\n", "\nvar csmLcSwitch_benchmark = new Dictionary()", @@ -369,7 +369,7 @@ "\n basicIfrsVariable with {AocType = \"IA\", Novelty = \"N\", Values = new double[] {15.0}},", "\n basicIfrsVariable with {AocType = \"EV\", Novelty = \"N\", Values = new double[] {100.0}},", "\n basicIfrsVariable with {AocType = \"CL\", Novelty = \"C\", Values = new double[] {-500.0}},", - "\n basicIfrsVariable with {AocType = \"AM\", Novelty = \"C\", Values = new double[] {0.5}, EstimateType = \"F\", AmountType = null},", + "\n basicIfrsVariable with {AocType = \"AM\", Novelty = \"C\", Values = new double[] {0.5}, EstimateType = \"F\", AmountType = \"CU\"},", "\n };", "\n", "\nvar csmLcSwitch_benchmark = new Dictionary()", @@ -416,7 +416,7 @@ "\n basicIfrsVariable with {AocType = \"BOP\", Novelty = \"N\", Values = new double[] {100.0}},", "\n basicIfrsVariable with {AocType = \"CF\", Novelty = \"N\", Values = new double[] {-10.0}},", "\n basicIfrsVariable with {AocType = \"IA\", Novelty = \"N\", Values = new double[] {-150.0}},", - "\n basicIfrsVariable with {AocType = \"AM\", Novelty = \"C\", Values = new double[] {0.5}, EstimateType = \"F\", AmountType = null},", + "\n basicIfrsVariable with {AocType = \"AM\", Novelty = \"C\", Values = new double[] {0.5}, EstimateType = \"F\", AmountType = \"CU\"},", "\n };", "\n", "\nvar csmLcSwitch_benchmark = new Dictionary()", @@ -468,7 +468,7 @@ "\n basicIfrsVariable with {AocType = \"IA\", Novelty = \"N\", Values = new double[] {150.0}},", "\n basicIfrsVariable with {AocType = \"EV\", Novelty = \"N\", Values = new double[] {-45.0}},", "\n basicIfrsVariable with {AocType = \"CL\", Novelty = \"C\", Values = new double[] {-30.0}},", - "\n basicIfrsVariable with {AocType = \"AM\", Novelty = \"C\", Values = new double[] {0.5}, EstimateType = \"F\", AmountType = null},", + "\n basicIfrsVariable with {AocType = \"AM\", Novelty = \"C\", Values = new double[] {0.5}, EstimateType = \"F\", AmountType = \"CU\"},", "\n };", "\n", "\nvar csmLcSwitch_benchmark = new Dictionary()", @@ -524,12 +524,12 @@ "\n grossBasicIfrsVariable with {AocType = \"IA\", Novelty = \"N\", Values = new double[] {-15.0}},", "\n grossBasicIfrsVariable with {AocType = \"EV\", Novelty = \"N\", Values = new double[] {-100.0}},", "\n grossBasicIfrsVariable with {AocType = \"CL\", Novelty = \"C\", Values = new double[] {+100.0}},", - "\n grossBasicIfrsVariable with {AocType = \"AM\", Novelty = \"C\", Values = new double[] {0.5}, EstimateType = \"F\", AmountType = null},", + "\n grossBasicIfrsVariable with {AocType = \"AM\", Novelty = \"C\", Values = new double[] {0.5}, EstimateType = \"F\", AmountType = \"CU\"},", "\n", "\n reinsBasicIfrsVariable with {AocType = \"BOP\", Novelty = \"N\", Values = new double[] {100.0}},", "\n reinsBasicIfrsVariable with {AocType = \"IA\", Novelty = \"N\", Values = new double[] {-10.0}},", "\n reinsBasicIfrsVariable with {AocType = \"CL\", Novelty = \"C\", Values = new double[] {-30.0}},", - "\n reinsBasicIfrsVariable with {AocType = \"AM\", Novelty = \"C\", Values = new double[] {0.5}, EstimateType = \"F\", AmountType = null},", + "\n reinsBasicIfrsVariable with {AocType = \"AM\", Novelty = \"C\", Values = new double[] {0.5}, EstimateType = \"F\", AmountType = \"CU\"},", "\n };", "\n", "\nvar csmLcSwitch_benchmark = new Dictionary()", @@ -594,12 +594,12 @@ "\n grossBasicIfrsVariable with {AocType = \"BOP\", Novelty = \"N\", Values = new double[] {100.0}},", "\n grossBasicIfrsVariable with {AocType = \"CF\", Novelty = \"N\", Values = new double[] {-10.0}},", "\n grossBasicIfrsVariable with {AocType = \"IA\", Novelty = \"N\", Values = new double[] {-150.0}}, ", - "\n grossBasicIfrsVariable with {AocType = \"AM\", Novelty = \"C\", Values = new double[] {0.5}, EstimateType = \"F\", AmountType = null},", + "\n grossBasicIfrsVariable with {AocType = \"AM\", Novelty = \"C\", Values = new double[] {0.5}, EstimateType = \"F\", AmountType = \"CU\"},", "\n", "\n reinsBasicIfrsVariable with {AocType = \"BOP\", Novelty = \"N\", Values = new double[] {-100.0}},", "\n reinsBasicIfrsVariable with {AocType = \"IA\", Novelty = \"N\", Values = new double[] {-10.0}},", "\n reinsBasicIfrsVariable with {AocType = \"CL\", Novelty = \"C\", Values = new double[] {-30.0}},", - "\n reinsBasicIfrsVariable with {AocType = \"AM\", Novelty = \"C\", Values = new double[] {0.5}, EstimateType = \"F\", AmountType = null},", + "\n reinsBasicIfrsVariable with {AocType = \"AM\", Novelty = \"C\", Values = new double[] {0.5}, EstimateType = \"F\", AmountType = \"CU\"},", "\n };", "\n", "\n//Gross CSM-LC", @@ -661,12 +661,12 @@ "\nvar inputDataSet = new IfrsVariable[]{", "\n grossBasicIfrsVariable with {AocType = \"BOP\", Novelty = \"N\", Values = new double[] {100.0}},", "\n grossBasicIfrsVariable with {AocType = \"IA\", Novelty = \"N\", Values = new double[] {-50.0}}, ", - "\n grossBasicIfrsVariable with {AocType = \"AM\", Novelty = \"C\", Values = new double[] {0.5}, EstimateType = \"F\", AmountType = null},", + "\n grossBasicIfrsVariable with {AocType = \"AM\", Novelty = \"C\", Values = new double[] {0.5}, EstimateType = \"F\", AmountType = \"CU\"},", "\n", "\n reinsBasicIfrsVariable with {AocType = \"BOP\", Novelty = \"N\", Values = new double[] {-100.0}},", "\n reinsBasicIfrsVariable with {AocType = \"IA\", Novelty = \"N\", Values = new double[] {-10.0}},", "\n reinsBasicIfrsVariable with {AocType = \"CL\", Novelty = \"C\", Values = new double[] {-30.0}},", - "\n reinsBasicIfrsVariable with {AocType = \"AM\", Novelty = \"C\", Values = new double[] {0.5}, EstimateType = \"F\", AmountType = null},", + "\n reinsBasicIfrsVariable with {AocType = \"AM\", Novelty = \"C\", Values = new double[] {0.5}, EstimateType = \"F\", AmountType = \"CU\"},", "\n };", "\n", "\n//Gross CSM-LC", @@ -729,12 +729,12 @@ "\n grossBasicIfrsVariable with {AocType = \"IA\", Novelty = \"I\", Values = new double[] {10.0}}, ", "\n grossBasicIfrsVariable with {AocType = \"BOP\", Novelty = \"N\", Values = new double[] {50.0}},", "\n grossBasicIfrsVariable with {AocType = \"IA\", Novelty = \"N\", Values = new double[] {-10.0}}, ", - "\n grossBasicIfrsVariable with {AocType = \"AM\", Novelty = \"C\", Values = new double[] {0.5}, EstimateType = \"F\", AmountType = null},", + "\n grossBasicIfrsVariable with {AocType = \"AM\", Novelty = \"C\", Values = new double[] {0.5}, EstimateType = \"F\", AmountType = \"CU\"},", "\n", "\n reinsBasicIfrsVariable with {AocType = \"BOP\", Novelty = \"N\", Values = new double[] {-100.0}},", "\n reinsBasicIfrsVariable with {AocType = \"IA\", Novelty = \"N\", Values = new double[] {-10.0}},", "\n reinsBasicIfrsVariable with {AocType = \"CL\", Novelty = \"C\", Values = new double[] {-30.0}},", - "\n reinsBasicIfrsVariable with {AocType = \"AM\", Novelty = \"C\", Values = new double[] {0.5}, EstimateType = \"F\", AmountType = null},", + "\n reinsBasicIfrsVariable with {AocType = \"AM\", Novelty = \"C\", Values = new double[] {0.5}, EstimateType = \"F\", AmountType = \"CU\"},", "\n };", "\n", "\n//Gross CSM-LC", From e587885071b1e1e6632e3c9fc060397c6e8f2cf0 Mon Sep 17 00:00:00 2001 From: Davide Colleoni Date: Tue, 23 May 2023 17:30:07 +0200 Subject: [PATCH 37/55] fix tests --- ifrs17/Import/2ImportScope-PresentValue.ipynb | 4 ++-- ifrs17/Import/5ImportScope-ToIfrsVar.ipynb | 6 ++++-- ifrs17/Import/ImportStorage.ipynb | 10 ++++------ ifrs17/Utils/Extensions.ipynb | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ifrs17/Import/2ImportScope-PresentValue.ipynb b/ifrs17/Import/2ImportScope-PresentValue.ipynb index 2c2b4ee8..555133ea 100644 --- a/ifrs17/Import/2ImportScope-PresentValue.ipynb +++ b/ifrs17/Import/2ImportScope-PresentValue.ipynb @@ -852,12 +852,12 @@ "\n", "\n private PeriodType periodType => GetStorage().GetPeriodType(Identity.AmountType, EstimateTypes.P);", "\n private double[] monthlyDiscounting => GetScope(Identity.Id).Discount;", - "\n private double[] cdcPattern => Multiply(-1d, releasePattern.ComputeDiscountAndCumulate(monthlyDiscounting, periodType)); ", + "\n private double[] cdcPattern => releasePattern.ComputeDiscountAndCumulate(monthlyDiscounting, periodType); ", "\n ", "\n [NotVisible] string EconomicBasis => GetContext();", "\n ", "\n double[] MonthlyAmortizationFactors => Identity.Id.AocType switch {", - "\n AocTypes.AM when releasePattern.Any() => releasePattern.Zip(cdcPattern, //Extract to an other scope with month in the identity to avoid Zip?", + "\n AocTypes.AM when releasePattern?.Any() ?? false => releasePattern.Zip(cdcPattern, //Extract to an other scope with month in the identity to avoid Zip?", "\n (nominal, discountedCumulated) => Math.Abs(discountedCumulated) >= Precision ? Math.Max(0, 1 - nominal / discountedCumulated) : 0).ToArray(),", "\n _ => Enumerable.Empty().ToArray(),", "\n };", diff --git a/ifrs17/Import/5ImportScope-ToIfrsVar.ipynb b/ifrs17/Import/5ImportScope-ToIfrsVar.ipynb index e76faf03..b057f490 100644 --- a/ifrs17/Import/5ImportScope-ToIfrsVar.ipynb +++ b/ifrs17/Import/5ImportScope-ToIfrsVar.ipynb @@ -205,7 +205,9 @@ "source": [ "public interface DeferrableToIfrsVariable: IScope", "\n{", - "\n IEnumerable DeferrableActual => GetScope(Identity).RepeatOnce().Select(x => ", + "\n IEnumerable DeferrableActual => GetStorage().DataNodeDataBySystemName[Identity.DataNode].LiabilityType == LiabilityTypes.LIC ", + "\n ? Enumerable.Empty()", + "\n : GetScope(Identity).RepeatOnce().Select(x => ", "\n new IfrsVariable{ EstimateType = x.EstimateType,", "\n DataNode = x.Identity.DataNode,", "\n AocType = x.Identity.AocType,", @@ -272,7 +274,7 @@ "\n DataNode = x.Identity.Id.DataNode,", "\n AocType = x.Identity.Id.AocType,", "\n Novelty = x.Identity.Id.Novelty,", - "\n AmountType = x.Identity.AmountType,", + "\n AmountType = x.Identity.AmountType, //??", "\n EconomicBasis = x.EconomicBasis,", "\n Values = SetProjectionValue(x.Value, x.Identity.Id.ProjectionPeriod),", "\n Partition = GetStorage().TargetPartition", diff --git a/ifrs17/Import/ImportStorage.ipynb b/ifrs17/Import/ImportStorage.ipynb index b32b8ae7..d7cb8b6b 100644 --- a/ifrs17/Import/ImportStorage.ipynb +++ b/ifrs17/Import/ImportStorage.ipynb @@ -374,11 +374,9 @@ "\n return patternFromCashflow;", "\n ", "\n double[] patternFromParameter = default;", - "\n if(!SingleDataNodeParametersByGoc.TryGetValue(identity.DataNode, out var dataNodeParameterByPeriod)){", - "\n ApplicationMessage.Log(Error.InvalidAmortizationFactors, identity.DataNode);", + "\n if(!SingleDataNodeParametersByGoc.TryGetValue(identity.DataNode, out var dataNodeParameterByPeriod))", "\n return patternFromParameter;", - "\n }", - "\n ", + "\n ", "\n var monthlyPattern = dataNodeParameterByPeriod[CurrentPeriod].AmortizationFactor.Interpolate(dataNodeParameterByPeriod[CurrentPeriod].CashFlowPeriodicity, dataNodeParameterByPeriod[CurrentPeriod].InterpolationMethod);", "\n return monthlyPattern.Normalize();", "\n }", @@ -386,8 +384,8 @@ "\n SingleDataNodeParametersByGoc.TryGetValue(id.DataNode, out var singleDataNodeParameter) ", "\n ? singleDataNodeParameter[CurrentPeriod].PremiumAllocation : DefaultPremiumExperienceAdjustmentFactor;", "\n", - "\n public string GetEconomicBasisDriver(ImportIdentity id, string amountType) => ", - "\n SingleDataNodeParametersByGoc.TryGetValue(id.DataNode, out var singleDataNodeParameter)", + "\n public string GetEconomicBasisDriver(string dataNode) => ", + "\n SingleDataNodeParametersByGoc.TryGetValue(dataNode, out var singleDataNodeParameter)", "\n ? singleDataNodeParameter[CurrentPeriod].EconomicBasisDriver : default;", "\n", "\n // Data Node relationships", diff --git a/ifrs17/Utils/Extensions.ipynb b/ifrs17/Utils/Extensions.ipynb index eb8ae6dc..1cc77678 100644 --- a/ifrs17/Utils/Extensions.ipynb +++ b/ifrs17/Utils/Extensions.ipynb @@ -144,8 +144,8 @@ "cell_type": "code", "source": [ "public static double[] Normalize(this IEnumerable source) {", - "\n var norm = source.Sum();", - "\n if(Math.Abs(norm) < 10E-12)", + "\n var norm = source?.Sum() ?? 0d;", + "\n if(Math.Abs(norm) < 10E-6)", "\n return default;", "\n return source.Select(v => v / norm).ToArray();}" ], From 0230b2541d3b93496b503f8906a8df8986f2abf8 Mon Sep 17 00:00:00 2001 From: Slavomir Batka Date: Tue, 23 May 2023 18:47:10 +0200 Subject: [PATCH 38/55] update of scaffolding --- .../Database/MigrationAndScaffolding/Initial.ipynb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ifrs17-template/Database/MigrationAndScaffolding/Initial.ipynb b/ifrs17-template/Database/MigrationAndScaffolding/Initial.ipynb index 6bd15990..1701101f 100644 --- a/ifrs17-template/Database/MigrationAndScaffolding/Initial.ipynb +++ b/ifrs17-template/Database/MigrationAndScaffolding/Initial.ipynb @@ -37,7 +37,7 @@ { "cell_type": "code", "source": [ - "[Migration(\"20230517163443_InitialTypes\")]", + "[Migration(\"20230523120744_InitialTypes\")]", "\npublic class InitialTypes : Migration", "\n{", "\n protected override void Up(MigrationBuilder migrationBuilder)", @@ -140,7 +140,6 @@ "\n Portfolio = table.Column(type: \"nvarchar(max)\", nullable: true),", "\n YieldCurveName = table.Column(type: \"nvarchar(max)\", nullable: true),", "\n Partner = table.Column(type: \"nvarchar(max)\", nullable: true),", - "\n ContractDuration = table.Column(type: \"int\", nullable: true),", "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true)", "\n },", "\n constraints: table =>", @@ -165,7 +164,7 @@ "\n CashFlowPeriodicity = table.Column(type: \"int\", nullable: true),", "\n InterpolationMethod = table.Column(type: \"int\", nullable: true),", "\n EconomicBasisDriver = table.Column(type: \"nvarchar(max)\", nullable: true),", - "\n AmortizationFactor = table.Column(type: \"varbinary(max)\", nullable: true)", + "\n ReleasePattern = table.Column(type: \"varbinary(max)\", nullable: true)", "\n },", "\n constraints: table =>", "\n {", From b6817eb442ea8ccc07350872790bac781af4866f Mon Sep 17 00:00:00 2001 From: Slavomir Batka Date: Thu, 25 May 2023 09:02:14 +0200 Subject: [PATCH 39/55] fix test of ReleasePattern values --- ifrs17/Constants/Validations.ipynb | 4 +- ifrs17/Test/DataNodeParameterTest.ipynb | 77 ++++++++++++++++++++++++- ifrs17/Utils/Extensions.ipynb | 2 +- 3 files changed, 79 insertions(+), 4 deletions(-) diff --git a/ifrs17/Constants/Validations.ipynb b/ifrs17/Constants/Validations.ipynb index df111dfa..39af9605 100644 --- a/ifrs17/Constants/Validations.ipynb +++ b/ifrs17/Constants/Validations.ipynb @@ -63,7 +63,7 @@ "source": [ "public enum Error { ", "\n // Import", - "\n NoMainTab, IncompleteMainTab, ParsingScientificNotation, ValueTypeNotFound, ValueTypeNotValid, ", + "\n NoMainTab, IncompleteMainTab, ParsingInvalidOrScientificValue, ValueTypeNotFound, ValueTypeNotValid, ", "\n ReportingNodeInMainNotFound, YearInMainNotFound, MonthInMainNotFound, ScenarioInMainNotAvailable,", "\n AocTypeNotValid, AocTypeCompulsoryNotFound, AocTypePositionNotSupported, AocConfigurationOrderNotUnique,", "\n // Partition", @@ -111,7 +111,7 @@ "\n // Import", "\n (Error.NoMainTab , _) => $\"No Main tab in the parsed file.\",", "\n (Error.IncompleteMainTab , _) => $\"Incomplete Main tab in the parsed file.\",", - "\n (Error.ParsingScientificNotation , 1) => $\"While parsing found real number in scientific notation: {s[0]}.\",", + "\n (Error.ParsingInvalidOrScientificValue, 1) => $\"While parsing found invalid value or real number in scientific notation: {s[0]}.\",", "\n (Error.ValueTypeNotFound , _) => $\"Value Type not found.\",", "\n (Error.ValueTypeNotValid , 1) => $\"The Value Type {s[0]} is invalid.\",", "\n (Error.ReportingNodeInMainNotFound , _) => $\"Reporting Node missing from the Main tab.\",", diff --git a/ifrs17/Test/DataNodeParameterTest.ipynb b/ifrs17/Test/DataNodeParameterTest.ipynb index 1567634a..78532e7e 100644 --- a/ifrs17/Test/DataNodeParameterTest.ipynb +++ b/ifrs17/Test/DataNodeParameterTest.ipynb @@ -657,10 +657,85 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "markdown", + "source": [ + "## Release Pattern" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "### Wrong Value" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ - "" + "var inputFile = ", + "\n@\"@@Main", + "\nReportingNode,Year,Month", + "\nCH,2020,12", + "\n", + "\n@@SingleDataNodeParameter", + "\nDataNode,PremiumAllocation,ReleasePattern0,ReleasePattern1", + "\nDT1.1,0.85,InvalidValue0,InvalidValue1", + "\n\";", + "\nvar errorsBm = new List(){Get(Error.ParsingInvalidOrScientificValue, \"InvalidValue0\"),Get(Error.ParsingInvalidOrScientificValue, \"InvalidValue1\")};" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var activity = await TestValidation(inputFile, errorsBm);", + "\nactivity" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "### Valid or Null Value " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var inputFile = ", + "\n@\"@@Main", + "\nReportingNode,Year,Month", + "\nCH,2020,12", + "\n", + "\n@@SingleDataNodeParameter", + "\nDataNode,PremiumAllocation,ReleasePattern0,ReleasePattern1", + "\nDT1.1,0.1,1,2", + "\nDTR1.1,0.85", + "\n\";", + "\nvar errorsBm = new List(){};" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var activity = await TestValidation(inputFile, errorsBm);", + "\nactivity" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17/Utils/Extensions.ipynb b/ifrs17/Utils/Extensions.ipynb index 58b71330..c048a8c2 100644 --- a/ifrs17/Utils/Extensions.ipynb +++ b/ifrs17/Utils/Extensions.ipynb @@ -165,7 +165,7 @@ "\n{ ", "\n if (s == null) return default;", "\n if (double.TryParse(s, NumberStyles.Number, CultureInfo.InvariantCulture, out var doubleValue)) return doubleValue;", - "\n else { ApplicationMessage.Log(Error.ParsingScientificNotation, s); return 1; }", + "\n else { ApplicationMessage.Log(Error.ParsingInvalidOrScientificValue, s); return 1; }", "\n}" ], "metadata": {}, From d7a59f9b96137f1551ee9cef9579a895fda1546e Mon Sep 17 00:00:00 2001 From: Slavomir Batka Date: Thu, 25 May 2023 09:37:59 +0200 Subject: [PATCH 40/55] documentation --- ifrs17/DataModel/DataStructure.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ifrs17/DataModel/DataStructure.ipynb b/ifrs17/DataModel/DataStructure.ipynb index 7478c970..4519bcce 100644 --- a/ifrs17/DataModel/DataStructure.ipynb +++ b/ifrs17/DataModel/DataStructure.ipynb @@ -1566,7 +1566,7 @@ "\n", "\n
InterpolationMethod : defines the interpolation method to be applied to interpolate the cash flow to the monthly granularity, it is not a mandatory input. Supported values can be found [here](../Constants/Enums#interpolation-method). When the *InterpolationMethod* is not present in the input file or the *CashFlowPeriodicity* has the default value, then the default value for the *InterpolationMethod* is applied. The default value is Not Applicable. ", "\n", - "\n
Release Pattern : defines the pattern of factors that will be used to defer and amortize any AmountType over the course of contract term. It is not a mandatory input. Note, this pattern is used, if no *Release Pattern* is provided in the Cashflows (which is specified for combinations of AmountType, EstimateType and AocType). Note that the Release Pattern needs at least a column with 'Value0' corresponding to the first value of annual cohort.", + "\n
Release Pattern : defines the pattern of factors that will be used to defer and amortize any AmountType over the course of contract term. It is not a mandatory input. Note, this pattern is used, if no *Release Pattern* is provided in the Cashflows (which is specified for combinations of AmountType, EstimateType and AocType).Note that the Release Pattern needs at least a column with 'ReleasePattern0'. 'ReleasePattern0' corresponds to the first value of the AnnualCohort, defined in [GroupOfContracts](#group-of-contracts). Note, that the ReleasePattern is an optional parameter for a given Group of Contracts.", "\n", "\n
EconomicBasisDriver : defines the economic basis that will be used in discounting any Release Pattern. It is not a mandatory input. Supported values are the defined values for [EconomicBasis](#economic-basis). When the *EconomicBasisDriver* is not present in the input file, then the default value for the *EconomicBasisDriver* is applied. The default value is *Locked-in* rates for Building Block Approach, *Current* rates for Variable Fee Approach and Premium Allocation Approach for liabilities of incurred claims and *Nominal* for Premium Allocation Approach for liabilities of remaining coverage.", "\n", From 3d2c3c74d2ef810e5002ae80bad0d7a27b12325f Mon Sep 17 00:00:00 2001 From: Slavomir Batka Date: Thu, 25 May 2023 10:03:33 +0200 Subject: [PATCH 41/55] update documentation and cleanup --- ifrs17/DataModel/DataStructure.ipynb | 8 ++++---- ifrs17/Import/ImportStorage.ipynb | 6 +----- ifrs17/Test/ReportStorageTest.ipynb | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/ifrs17/DataModel/DataStructure.ipynb b/ifrs17/DataModel/DataStructure.ipynb index 4519bcce..00318eaf 100644 --- a/ifrs17/DataModel/DataStructure.ipynb +++ b/ifrs17/DataModel/DataStructure.ipynb @@ -1562,13 +1562,13 @@ "\n", "\n
PremiumAllocation : defines the weight of Premium to be included in the Experience Adjustement AoC Type of the Technical Margin and is valid only for Group of Insurance Contract with LiabilityType : Liability for Remaining Coverage.", "\n", - "\n
CashFlowPeriodicity : defines the periodicity of the provided cash flows, it is not a mandatory input. Supported values can be found [here](../Constants/Enums#cashflowperiodicity). When the column *CashFlowPeriodicity* is missing from the input file it is assumed a monthly periodicity (default value). When the *CashFlowPeriodicity* column is present, a valid value must be entered. ", + "\n
CashFlowPeriodicity : defines the periodicity of the provided cash flows, it is not a mandatory input column. Supported values can be found [here](../Constants/Enums#cashflowperiodicity). When the column *CashFlowPeriodicity* is missing from the input file it is assumed a monthly periodicity (default value). When the *CashFlowPeriodicity* column is present, a valid value must be entered. ", "\n", - "\n
InterpolationMethod : defines the interpolation method to be applied to interpolate the cash flow to the monthly granularity, it is not a mandatory input. Supported values can be found [here](../Constants/Enums#interpolation-method). When the *InterpolationMethod* is not present in the input file or the *CashFlowPeriodicity* has the default value, then the default value for the *InterpolationMethod* is applied. The default value is Not Applicable. ", + "\n
InterpolationMethod : defines the interpolation method to be applied to interpolate the cash flow to the monthly granularity, it is not a mandatory input column. Supported values can be found [here](../Constants/Enums#interpolation-method). When the *InterpolationMethod* is not present in the input file or the *CashFlowPeriodicity* has the default value, then the default value for the *InterpolationMethod* is applied. The default value is 'NotApplicable'.", "\n", - "\n
Release Pattern : defines the pattern of factors that will be used to defer and amortize any AmountType over the course of contract term. It is not a mandatory input. Note, this pattern is used, if no *Release Pattern* is provided in the Cashflows (which is specified for combinations of AmountType, EstimateType and AocType).Note that the Release Pattern needs at least a column with 'ReleasePattern0'. 'ReleasePattern0' corresponds to the first value of the AnnualCohort, defined in [GroupOfContracts](#group-of-contracts). Note, that the ReleasePattern is an optional parameter for a given Group of Contracts.", + "\n
ReleasePattern : defines the pattern of factors that will be used to defer and amortize any AmountType over the course of contract term. It is not a mandatory input column. This pattern is used, if no *ReleasePattern* is provided in the Cashflows, specified for combinations of AmountType, EstimateType and AocType. Note that the ReleasePattern needs at least column with 'ReleasePattern0' header. Several year's can be provided by adding columns 'ReleasePattern1', 'ReleasePattern2' etc. Note 'ReleasePattern0' corresponds to the first value of the AnnualCohort which is defined in [GroupOfContracts](#group-of-contracts). When the ReleasePattern column is provided, the values for any given DataNode are optional.", "\n", - "\n
EconomicBasisDriver : defines the economic basis that will be used in discounting any Release Pattern. It is not a mandatory input. Supported values are the defined values for [EconomicBasis](#economic-basis). When the *EconomicBasisDriver* is not present in the input file, then the default value for the *EconomicBasisDriver* is applied. The default value is *Locked-in* rates for Building Block Approach, *Current* rates for Variable Fee Approach and Premium Allocation Approach for liabilities of incurred claims and *Nominal* for Premium Allocation Approach for liabilities of remaining coverage.", + "\n
EconomicBasisDriver : defines the economic basis that will be used in discounting any Release Pattern. It is not a mandatory input column. Supported values are the defined values for [EconomicBasis](#economic-basis). When the *EconomicBasisDriver* is not present in the input file, then the default value for the *EconomicBasisDriver* is applied. The default value is *Locked-in* rates for Building Block Approach, *Current* rates for Variable Fee Approach and Premium Allocation Approach for liabilities of incurred claims and *Nominal* for Premium Allocation Approach for liabilities of remaining coverage.", "\n", "\n
ReinsuranceCoverage : defines the weight of the underlying gross business to be considered in the computation of the allocation of the Technical Margin in a Reinsurance case. In other words, it represents the percentage to which claims in the underlying GICs are expected to be reinboursed by the Reinsurance Contracts belonging to the GRIC. For proportional contracts, this factor is given by the cession while for other contracts it should be estimated. ", "\n", diff --git a/ifrs17/Import/ImportStorage.ipynb b/ifrs17/Import/ImportStorage.ipynb index cfd3bbaa..ee2947d2 100644 --- a/ifrs17/Import/ImportStorage.ipynb +++ b/ifrs17/Import/ImportStorage.ipynb @@ -369,11 +369,7 @@ "\n ", "\n public double GetPremiumAllocationFactor(ImportIdentity id) => SingleDataNodeParametersByGoc.TryGetValue(id.DataNode, out var singleDataNodeParameter) ", "\n ? singleDataNodeParameter[CurrentPeriod].PremiumAllocation : DefaultPremiumExperienceAdjustmentFactor;", - "\n", - "\n public double[] GetReleasePattern(ImportIdentity id, string amountType) => SingleDataNodeParametersByGoc.TryGetValue(id.DataNode, out var singleDataNodeParameter) ", - "\n ? singleDataNodeParameter[CurrentPeriod].ReleasePattern : default;", - "\n", - "\n ", + "\n ", "\n // Data Node relationships", "\n public IEnumerable GetUnderlyingGic(ImportIdentity id) => !InterDataNodeParametersByGoc.TryGetValue(id.DataNode, out var interDataNodeParameters)", "\n ? Enumerable.Empty()", diff --git a/ifrs17/Test/ReportStorageTest.ipynb b/ifrs17/Test/ReportStorageTest.ipynb index db77027a..0021e4c1 100644 --- a/ifrs17/Test/ReportStorageTest.ipynb +++ b/ifrs17/Test/ReportStorageTest.ipynb @@ -120,6 +120,24 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "code", + "source": [ + "activity.Status.Should().Be(ActivityLogStatus.Succeeded);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "Workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ From 9e1d33e604318c361b1efbd1fea3b8ff3c25c9a8 Mon Sep 17 00:00:00 2001 From: Slavomir Batka Date: Thu, 25 May 2023 10:29:32 +0200 Subject: [PATCH 42/55] cosmetic --- ifrs17/DataModel/DataStructure.ipynb | 2 +- ifrs17/Import/Importers.ipynb | 25 ++++++++++++++----------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/ifrs17/DataModel/DataStructure.ipynb b/ifrs17/DataModel/DataStructure.ipynb index 00318eaf..b4869070 100644 --- a/ifrs17/DataModel/DataStructure.ipynb +++ b/ifrs17/DataModel/DataStructure.ipynb @@ -1566,7 +1566,7 @@ "\n", "\n
InterpolationMethod : defines the interpolation method to be applied to interpolate the cash flow to the monthly granularity, it is not a mandatory input column. Supported values can be found [here](../Constants/Enums#interpolation-method). When the *InterpolationMethod* is not present in the input file or the *CashFlowPeriodicity* has the default value, then the default value for the *InterpolationMethod* is applied. The default value is 'NotApplicable'.", "\n", - "\n
ReleasePattern : defines the pattern of factors that will be used to defer and amortize any AmountType over the course of contract term. It is not a mandatory input column. This pattern is used, if no *ReleasePattern* is provided in the Cashflows, specified for combinations of AmountType, EstimateType and AocType. Note that the ReleasePattern needs at least column with 'ReleasePattern0' header. Several year's can be provided by adding columns 'ReleasePattern1', 'ReleasePattern2' etc. Note 'ReleasePattern0' corresponds to the first value of the AnnualCohort which is defined in [GroupOfContracts](#group-of-contracts). When the ReleasePattern column is provided, the values for any given DataNode are optional.", + "\n
ReleasePattern : defines the pattern of factors that will be used to defer and amortize any AmountType over the course of contract term. It is not a mandatory input. This pattern is used, if no *ReleasePattern* is provided in the Cashflows (which is specific for combinations of AmountType, EstimateType and AocType). If provided, the ReleasePattern needs at least a column with 'ReleasePattern0' header. The 'ReleasePattern0' corresponds to the first value of the AnnualCohort which is defined in [GroupOfContracts](#group-of-contracts). Pattern for multiple years can be provided by adding columns 'ReleasePattern1', 'ReleasePattern2' etc. Even if the ReleasePattern header is present, the values for any given DataNode are still optional.", "\n", "\n
EconomicBasisDriver : defines the economic basis that will be used in discounting any Release Pattern. It is not a mandatory input column. Supported values are the defined values for [EconomicBasis](#economic-basis). When the *EconomicBasisDriver* is not present in the input file, then the default value for the *EconomicBasisDriver* is applied. The default value is *Locked-in* rates for Building Block Approach, *Current* rates for Variable Fee Approach and Premium Allocation Approach for liabilities of incurred claims and *Nominal* for Premium Allocation Approach for liabilities of remaining coverage.", "\n", diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index aa5f0a23..7d25d4dc 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -1195,10 +1195,10 @@ "\n if(singleDataNode.Contains(dataNode)) { ApplicationMessage.Log(Error.DuplicateSingleDataNode, dataNode); return null; }", "\n singleDataNode.Add(dataNode);", "\n ", - "\n CashFlowPeriodicity periodicity = default;", + "\n CashFlowPeriodicity cashFlowPeriodicity = default;", "\n if (hasCashFlowPeriodicityColumn)", "\n if ( Enum.TryParse(datarow.Field(nameof(SingleDataNodeParameter.CashFlowPeriodicity)), out CashFlowPeriodicity cfp))", - "\n periodicity = cfp;", + "\n cashFlowPeriodicity = cfp;", "\n else { ApplicationMessage.Log(Error.InvalidCashFlowPeriodicity, dataNode); return null; }", "\n", "\n InterpolationMethod interpolationMethod = default;", @@ -1207,7 +1207,7 @@ "\n var interpolationMethodInput = datarow.Field(nameof(SingleDataNodeParameter.InterpolationMethod));", "\n if ( Enum.TryParse(interpolationMethodInput, out InterpolationMethod ipm)) ", "\n interpolationMethod = ipm;", - "\n else if ( !(periodicity == (CashFlowPeriodicity)default && string.IsNullOrEmpty(interpolationMethodInput)) ) { ApplicationMessage.Log(Error.InvalidInterpolationMethod, dataNode); return null; }", + "\n else if ( !(cashFlowPeriodicity == (CashFlowPeriodicity)default && string.IsNullOrEmpty(interpolationMethodInput)) ) { ApplicationMessage.Log(Error.InvalidInterpolationMethod, dataNode); return null; }", "\n }", "\n ", "\n string economicBasisDriverInput = default;", @@ -1384,19 +1384,22 @@ "\n var cashFlowPeriodicityInput = datarow.Field(nameof(SingleDataNodeParameter.CashFlowPeriodicity)); ", "\n if (Enum.TryParse(cashFlowPeriodicityInput, out CashFlowPeriodicity cfp))", "\n cashFlowPeriodicity = cfp;", - "\n //else if (!string.IsNullOrEmpty(cashFlowPeriodicityInput)) {ApplicationMessage.Log(Error.InvalidCashFlowPeriodicity, dataNode); return null;}", + "\n else if (!string.IsNullOrEmpty(cashFlowPeriodicityInput)) {ApplicationMessage.Log(Error.InvalidCashFlowPeriodicity, dataNode); return null;}", "\n }", "\n else parsingStorage.GetCashFlowPeriodicity(dataNode);", "\n", + "\n", "\n InterpolationMethod interpolationMethod = default;", "\n if(hasInterpolationMethodColumn)", - "\n {", - "\n var interpolationMethodInput = datarow.Field(nameof(SingleDataNodeParameter.InterpolationMethod));", - "\n if ( Enum.TryParse(interpolationMethodInput, out InterpolationMethod ipm)) ", - "\n interpolationMethod = ipm;", - "\n else if ( !(cashFlowPeriodicity == (CashFlowPeriodicity)default && string.IsNullOrEmpty(interpolationMethodInput)) ) { ApplicationMessage.Log(Error.InvalidInterpolationMethod, dataNode); return null; }", - "\n }", - "\n else parsingStorage.GetInterpolationMethod(dataNode);", + "\n {", + "\n var interpolationMethodInput = datarow.Field(nameof(SingleDataNodeParameter.InterpolationMethod));", + "\n if ( Enum.TryParse(interpolationMethodInput, out InterpolationMethod ipm)) ", + "\n interpolationMethod = ipm;", + "\n else if ( !(cashFlowPeriodicity == (CashFlowPeriodicity)default && string.IsNullOrEmpty(interpolationMethodInput)))", + "\n { ApplicationMessage.Log(Error.InvalidInterpolationMethod, dataNode); return null; }", + "\n }", + "\n else parsingStorage.GetInterpolationMethod(dataNode);", + "\n", "\n", "\n if(!parsingStorage.DataNodeDataBySystemName.TryGetValue(dataNode, out var dataNodeData)) {", "\n ApplicationMessage.Log(Error.InvalidDataNode, dataNode);", From 9f24a8d70c9778c5a118e9e440ae6f2fc8070861 Mon Sep 17 00:00:00 2001 From: Slavomir Batka Date: Thu, 25 May 2023 12:45:22 +0200 Subject: [PATCH 43/55] fix the parser special cases & documentation --- ifrs17/DataModel/DataStructure.ipynb | 5 +++-- ifrs17/Import/Importers.ipynb | 25 +++++++++++++++---------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/ifrs17/DataModel/DataStructure.ipynb b/ifrs17/DataModel/DataStructure.ipynb index b4869070..81e76ccd 100644 --- a/ifrs17/DataModel/DataStructure.ipynb +++ b/ifrs17/DataModel/DataStructure.ipynb @@ -505,7 +505,8 @@ "\n- It is a mandatory AoC Type as it is used to trigger the Run off of the cash flow. This is achieved by providing a cash flow of 0s. ", "\n- It is the first AoC Type for the Combined Novelty and therefore it carries the contribution of combining In force and New business.", "\n- Its present value is computed as telescoping difference with the last AoC Step for the In-Force novelty and the New Business novelty.", - "\n- In the technical margin calculation it is used to merge the profitability of the In-Force and New business components, which may result in a forced switch." + "\n- In the technical margin calculation it is used to merge the profitability of the In-Force and New business components, which may result in a forced switch.", + "\n- If ReleasePattern is provided in the Cash Flows it must be provided for this AocType." ], "metadata": {}, "execution_count": 0, @@ -1566,7 +1567,7 @@ "\n", "\n
InterpolationMethod : defines the interpolation method to be applied to interpolate the cash flow to the monthly granularity, it is not a mandatory input column. Supported values can be found [here](../Constants/Enums#interpolation-method). When the *InterpolationMethod* is not present in the input file or the *CashFlowPeriodicity* has the default value, then the default value for the *InterpolationMethod* is applied. The default value is 'NotApplicable'.", "\n", - "\n
ReleasePattern : defines the pattern of factors that will be used to defer and amortize any AmountType over the course of contract term. It is not a mandatory input. This pattern is used, if no *ReleasePattern* is provided in the Cashflows (which is specific for combinations of AmountType, EstimateType and AocType). If provided, the ReleasePattern needs at least a column with 'ReleasePattern0' header. The 'ReleasePattern0' corresponds to the first value of the AnnualCohort which is defined in [GroupOfContracts](#group-of-contracts). Pattern for multiple years can be provided by adding columns 'ReleasePattern1', 'ReleasePattern2' etc. Even if the ReleasePattern header is present, the values for any given DataNode are still optional.", + "\n
ReleasePattern : defines the pattern of factors that will be used to defer and amortize any AmountType over the course of contract term. It is not a mandatory input. This pattern is used, if no *ReleasePattern* is provided in the Cashflows (which is specific for combinations of AmountType and EstimateType). If provided, the ReleasePattern needs at least a column with 'ReleasePattern0' header. The 'ReleasePattern0' corresponds to the first value of the AnnualCohort which is defined in [GroupOfContracts](#group-of-contracts). Pattern for multiple years can be provided by adding columns 'ReleasePattern1', 'ReleasePattern2' etc. Even if the ReleasePattern header is present, the values for any given DataNode are still optional.", "\n", "\n
EconomicBasisDriver : defines the economic basis that will be used in discounting any Release Pattern. It is not a mandatory input column. Supported values are the defined values for [EconomicBasis](#economic-basis). When the *EconomicBasisDriver* is not present in the input file, then the default value for the *EconomicBasisDriver* is applied. The default value is *Locked-in* rates for Building Block Approach, *Current* rates for Variable Fee Approach and Premium Allocation Approach for liabilities of incurred claims and *Nominal* for Premium Allocation Approach for liabilities of remaining coverage.", "\n", diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index 7d25d4dc..14102ab4 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -1230,7 +1230,7 @@ "\n Scenario = args.Scenario,", "\n Partition = storage.TargetPartitionByReportingNode.Id,", "\n DataNode = dataNode,", - "\n CashFlowPeriodicity = periodicity,", + "\n CashFlowPeriodicity = cashFlowPeriodicity,", "\n InterpolationMethod = interpolationMethod,", "\n EconomicBasisDriver = economicBasisDriver,", "\n ReleasePattern = releasePattern,", @@ -1386,19 +1386,24 @@ "\n cashFlowPeriodicity = cfp;", "\n else if (!string.IsNullOrEmpty(cashFlowPeriodicityInput)) {ApplicationMessage.Log(Error.InvalidCashFlowPeriodicity, dataNode); return null;}", "\n }", - "\n else parsingStorage.GetCashFlowPeriodicity(dataNode);", - "\n", + "\n else cashFlowPeriodicity = parsingStorage.GetCashFlowPeriodicity(dataNode);", "\n", + "\n // InterpolationMethod, if neede by CashflowPeriodicity, given by the Cashflows or else taken from the SingleDataNodeParameters", "\n InterpolationMethod interpolationMethod = default;", - "\n if(hasInterpolationMethodColumn)", + "\n if(cashFlowPeriodicity != new CashFlowPeriodicity()) ", "\n {", - "\n var interpolationMethodInput = datarow.Field(nameof(SingleDataNodeParameter.InterpolationMethod));", - "\n if ( Enum.TryParse(interpolationMethodInput, out InterpolationMethod ipm)) ", - "\n interpolationMethod = ipm;", - "\n else if ( !(cashFlowPeriodicity == (CashFlowPeriodicity)default && string.IsNullOrEmpty(interpolationMethodInput)))", - "\n { ApplicationMessage.Log(Error.InvalidInterpolationMethod, dataNode); return null; }", + "\n if(hasInterpolationMethodColumn)", + "\n {", + "\n var interpolationMethodInput = datarow.Field(nameof(SingleDataNodeParameter.InterpolationMethod));", + "\n if ( Enum.TryParse(interpolationMethodInput, out InterpolationMethod ipm)) ", + "\n interpolationMethod = ipm;", + "\n else if(!string.IsNullOrEmpty(interpolationMethodInput))", + "\n {ApplicationMessage.Log(Error.InvalidInterpolationMethod, dataNode); return null;}", + "\n else ", + "\n interpolationMethod = parsingStorage.GetInterpolationMethod(dataNode);", + "\n }", + "\n else interpolationMethod = parsingStorage.GetInterpolationMethod(dataNode);", "\n }", - "\n else parsingStorage.GetInterpolationMethod(dataNode);", "\n", "\n", "\n if(!parsingStorage.DataNodeDataBySystemName.TryGetValue(dataNode, out var dataNodeData)) {", From 1af7594bc2affd055afdc8f39397064ebc3f528e Mon Sep 17 00:00:00 2001 From: Slavomir Batka Date: Thu, 25 May 2023 13:19:58 +0200 Subject: [PATCH 44/55] new Validation --- ifrs17/Constants/Validations.ipynb | 3 ++- ifrs17/DataModel/DataStructure.ipynb | 4 ++-- ifrs17/Import/Importers.ipynb | 4 +++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ifrs17/Constants/Validations.ipynb b/ifrs17/Constants/Validations.ipynb index 39af9605..f049c9d0 100644 --- a/ifrs17/Constants/Validations.ipynb +++ b/ifrs17/Constants/Validations.ipynb @@ -76,7 +76,7 @@ "\n // Data Note State", "\n ChangeDataNodeState, InactiveDataNodeState,", "\n // Parameters", - "\n ReinsuranceCoverageDataNode, DuplicateInterDataNode, DuplicateSingleDataNode, InvalidDataNode, InvalidDataNodeForOpening, InvalidCashFlowPeriodicity, InvalidInterpolationMethod, InvalidEconomicBasisDriver, InvalidReleasePattern,", + "\n ReinsuranceCoverageDataNode, DuplicateInterDataNode, DuplicateSingleDataNode, InvalidDataNode, InvalidDataNodeForOpening, InvalidCashFlowPeriodicity, MissingInterpolationMethod, InvalidInterpolationMethod, InvalidEconomicBasisDriver, InvalidReleasePattern,", "\n // Storage", "\n DataNodeNotFound, PartnerNotFound, RatingNotFound, CreditDefaultRateNotFound, MissingPremiumAllocation, ReinsuranceCoverage, ", "\n YieldCurveNotFound, YieldCurvePeriodNotApplicable, EconomicBasisNotFound, AccountingVariableTypeNotFound,", @@ -155,6 +155,7 @@ "\n (Error.InvalidDataNode , 1) => $\"Data imported for invalid Data Node {s[0]}.\",", "\n (Error.InvalidDataNodeForOpening , 1) => $\"Data imported for invalid Data Node or for a Data Node after its inception year {s[0]}.\",", "\n (Error.InvalidCashFlowPeriodicity , 1) => $\"Invalid CashFlowPeriodicity parameter for Data Node {s[0]}.\",", + "\n (Error.MissingInterpolationMethod , 1) => $\"Missing InterpolationMethod parameter for Data Node {s[0]}.\",", "\n (Error.InvalidInterpolationMethod , 1) => $\"Invalid InterpolationMethod parameter for Data Node {s[0]}.\",", "\n (Error.InvalidEconomicBasisDriver , 1) => $\"Invalid EconomicBasisDriver parameter for Data Node {s[0]}.\",", "\n (Error.InvalidReleasePattern , 1) => $\"Invalid ReleasePattern parameters for Data Node {s[0]}.\",", diff --git a/ifrs17/DataModel/DataStructure.ipynb b/ifrs17/DataModel/DataStructure.ipynb index 81e76ccd..337eb9de 100644 --- a/ifrs17/DataModel/DataStructure.ipynb +++ b/ifrs17/DataModel/DataStructure.ipynb @@ -1563,9 +1563,9 @@ "\n", "\n
PremiumAllocation : defines the weight of Premium to be included in the Experience Adjustement AoC Type of the Technical Margin and is valid only for Group of Insurance Contract with LiabilityType : Liability for Remaining Coverage.", "\n", - "\n
CashFlowPeriodicity : defines the periodicity of the provided cash flows, it is not a mandatory input column. Supported values can be found [here](../Constants/Enums#cashflowperiodicity). When the column *CashFlowPeriodicity* is missing from the input file it is assumed a monthly periodicity (default value). When the *CashFlowPeriodicity* column is present, a valid value must be entered. ", + "\n
CashFlowPeriodicity : defines the periodicity of the provided cash flows, it is not a mandatory input column. Supported values can be found [here](../Constants/Enums#cashflowperiodicity). When the column *CashFlowPeriodicity* is missing from the input file it is assumed a monthly periodicity (default value). When the *CashFlowPeriodicity* column is present, a valid value must be entered. If the Cashflow file does not contain a specific CashflowPeriodicity, this parameter value is used for the whole of DataNode.", "\n", - "\n
InterpolationMethod : defines the interpolation method to be applied to interpolate the cash flow to the monthly granularity, it is not a mandatory input column. Supported values can be found [here](../Constants/Enums#interpolation-method). When the *InterpolationMethod* is not present in the input file or the *CashFlowPeriodicity* has the default value, then the default value for the *InterpolationMethod* is applied. The default value is 'NotApplicable'.", + "\n
InterpolationMethod : defines the interpolation method to be applied to interpolate the cash flow from non-default (monthly) periodicity. It is not a mandatory input column, unless CashflowPeriodicity column is provided. Supported values can be found [here](../Constants/Enums#interpolation-method). When the *InterpolationMethod* is not present in the input file and it is required because *CashFlowPeriodicity* is not monthly, then the default value for the *InterpolationMethod* is applied. The default value is 'NotApplicable'.", "\n", "\n
ReleasePattern : defines the pattern of factors that will be used to defer and amortize any AmountType over the course of contract term. It is not a mandatory input. This pattern is used, if no *ReleasePattern* is provided in the Cashflows (which is specific for combinations of AmountType and EstimateType). If provided, the ReleasePattern needs at least a column with 'ReleasePattern0' header. The 'ReleasePattern0' corresponds to the first value of the AnnualCohort which is defined in [GroupOfContracts](#group-of-contracts). Pattern for multiple years can be provided by adding columns 'ReleasePattern1', 'ReleasePattern2' etc. Even if the ReleasePattern header is present, the values for any given DataNode are still optional.", "\n", diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index 14102ab4..f7eca041 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -1377,6 +1377,8 @@ "\n var novelty = datarow.Field(nameof(RawVariable.Novelty));", "\n var dataNode = datarow.Field(nameof(DataNode));", "\n", + "\n if(hasCashFlowPeriodicityColumn && !hasInterpolationMethodColumn) { ApplicationMessage.Log(Error.MissingInterpolationMethod, dataNode); return null; };", + "\n", "\n // CashflowPeriodicity given by the Cashflows or else taken from the SingleDataNodeParameters", "\n CashFlowPeriodicity cashFlowPeriodicity = default;", "\n if (hasCashFlowPeriodicityColumn)", @@ -1388,7 +1390,7 @@ "\n }", "\n else cashFlowPeriodicity = parsingStorage.GetCashFlowPeriodicity(dataNode);", "\n", - "\n // InterpolationMethod, if neede by CashflowPeriodicity, given by the Cashflows or else taken from the SingleDataNodeParameters", + "\n // InterpolationMethod, if needed by CashflowPeriodicity, given by the Cashflows or else taken from the SingleDataNodeParameters", "\n InterpolationMethod interpolationMethod = default;", "\n if(cashFlowPeriodicity != new CashFlowPeriodicity()) ", "\n {", From 3137b9d9c2deef6e045b50f55cc01bc8f77d9d77 Mon Sep 17 00:00:00 2001 From: Davide Colleoni Date: Thu, 25 May 2023 14:50:59 +0200 Subject: [PATCH 45/55] calculation --- ifrs17/Import/2ImportScope-PresentValue.ipynb | 28 ++-- ifrs17/Import/3ImportScope-Actuals.ipynb | 124 +++++++++++++++++- .../Import/4ImportScope-TechnicalMargin.ipynb | 2 +- ifrs17/Import/5ImportScope-ToIfrsVar.ipynb | 26 +++- ifrs17/Import/ImportStorage.ipynb | 14 +- 5 files changed, 169 insertions(+), 25 deletions(-) diff --git a/ifrs17/Import/2ImportScope-PresentValue.ipynb b/ifrs17/Import/2ImportScope-PresentValue.ipynb index 555133ea..43a2940b 100644 --- a/ifrs17/Import/2ImportScope-PresentValue.ipynb +++ b/ifrs17/Import/2ImportScope-PresentValue.ipynb @@ -793,7 +793,8 @@ { "cell_type": "code", "source": [ - "public interface PatternPv : IScope<(ImportIdentity Id, string AmountType), ImportStorage>", + "//TODO - OBSOLETE : Remove", + "\npublic interface PatternPv : IScope<(ImportIdentity Id, string AmountType), ImportStorage>", "\n{ ", "\n [NotVisible] string EconomicBasis => GetContext();", "\n ", @@ -834,30 +835,21 @@ "execution_count": 0, "outputs": [] }, - { - "cell_type": "markdown", - "source": [ - "" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, { "cell_type": "code", "source": [ - "public interface MonthlyAmortizationFactorCashflow : IScope<(ImportIdentity Id, string AmountType), ImportStorage>", + "public interface MonthlyAmortizationFactorCashflow : IScope<(ImportIdentity Id, string AmountType, int patternShift), ImportStorage>", "\n{", - "\n private double[] releasePattern => GetStorage().GetReleasePattern(Identity.Id, Identity.AmountType);", + "\n (string EffectiveAmountType, double[] Values) releasePattern => GetStorage().GetReleasePattern(Identity.Id, Identity.AmountType, Identity.patternShift);", "\n", "\n private PeriodType periodType => GetStorage().GetPeriodType(Identity.AmountType, EstimateTypes.P);", "\n private double[] monthlyDiscounting => GetScope(Identity.Id).Discount;", - "\n private double[] cdcPattern => releasePattern.ComputeDiscountAndCumulate(monthlyDiscounting, periodType); ", + "\n private double[] cdcPattern => releasePattern.Values.ComputeDiscountAndCumulate(monthlyDiscounting, periodType); ", "\n ", "\n [NotVisible] string EconomicBasis => GetContext();", "\n ", "\n double[] MonthlyAmortizationFactors => Identity.Id.AocType switch {", - "\n AocTypes.AM when releasePattern?.Any() ?? false => releasePattern.Zip(cdcPattern, //Extract to an other scope with month in the identity to avoid Zip?", + "\n AocTypes.AM when releasePattern.Values?.Any() ?? false => releasePattern.Values.Zip(cdcPattern, //Extract to an other scope with month in the identity to avoid Zip?", "\n (nominal, discountedCumulated) => Math.Abs(discountedCumulated) >= Precision ? Math.Max(0, 1 - nominal / discountedCumulated) : 0).ToArray(),", "\n _ => Enumerable.Empty().ToArray(),", "\n };", @@ -887,7 +879,7 @@ { "cell_type": "code", "source": [ - "public interface CurrentPeriodAmortizationFactor : IScope<(ImportIdentity Id, string AmountType), ImportStorage>", + "public interface CurrentPeriodAmortizationFactor : IScope<(ImportIdentity Id, string AmountType, int patternShift), ImportStorage>", "\n{", "\n static ApplicabilityBuilder ScopeApplicabilityBuilder(ApplicabilityBuilder builder) =>", "\n builder.ForScope(s => ", @@ -906,11 +898,15 @@ "\n [NotVisible] string EconomicBasis => GetContext();", "\n", "\n string EstimateType => EstimateTypes.F;", + "\n string EffectiveAmountType => GetScope(Identity).releasePattern.EffectiveAmountType;", "\n double Value => 1d - amortizedFactor;", "\n}", "\n", "\npublic interface AmfFromIfrsVariable : CurrentPeriodAmortizationFactor{", - "\n double CurrentPeriodAmortizationFactor.Value => GetStorage().GetValue(Identity.Id, Identity.AmountType, EstimateType, EconomicBasis, (int?)null, Identity.Id.ProjectionPeriod);", + "\n private double amortizationFactorForAmountType => GetStorage().GetValue(Identity.Id, Identity.AmountType, EstimateType, EconomicBasis, Identity.patternShift, Identity.Id.ProjectionPeriod);", + "\n double CurrentPeriodAmortizationFactor.Value => Math.Abs(amortizationFactorForAmountType) >= Precision", + "\n ? amortizationFactorForAmountType ", + "\n : GetStorage().GetValue(Identity.Id, null, EstimateType, EconomicBasis, Identity.patternShift, Identity.Id.ProjectionPeriod);", "\n}" ], "metadata": {}, diff --git a/ifrs17/Import/3ImportScope-Actuals.ipynb b/ifrs17/Import/3ImportScope-Actuals.ipynb index 4cbe071d..d0ef8497 100644 --- a/ifrs17/Import/3ImportScope-Actuals.ipynb +++ b/ifrs17/Import/3ImportScope-Actuals.ipynb @@ -282,6 +282,128 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "code", + "source": [ + "//AOCSTEPS: BOP,I and N - AM - EOP", + "\npublic interface Deferrable : IScope", + "\n{", + "\n static ApplicabilityBuilder ScopeApplicabilityBuilder(ApplicabilityBuilder builder) =>", + "\n builder.ForScope(s => s //compute with IfrsVariable?", + "\n //.WithApplicability(x => x.Identity.AocType == AocTypes.BOP && x.Identity.Novelty == Novelties.I && x.Identity.ProjectionPeriod > 0)", + "\n .WithApplicability(x => x.Identity.AocType == AocTypes.CF)", + "\n // .WithApplicability(x => x.Identity.AocType == AocTypes.CL)", + "\n .WithApplicability(x => x.Identity.AocType == AocTypes.AM)", + "\n .WithApplicability(x => x.Identity.AocType == AocTypes.EOP)", + "\n );", + "\n [IdentityProperty][NotVisible][Dimension(typeof(EstimateType))]", + "\n string EstimateType => EstimateTypes.DA;", + "\n string AmountType => null;", + "\n", + "\n [NotVisible] string EconomicBasis => GetStorage().GetEconomicBasisDriver(Identity.DataNode);", + "\n double Value => GetScope((Identity, \"DAE\", EstimateTypes.BE, (int?)null), o => o.WithContext(EconomicBasis)).Value;", + "\n}", + "\n", + "\npublic interface DeferrableDefaultValue : Deferrable {", + "\n double Deferrable.Value => default;", + "\n}", + "\n", + "\npublic interface DeferrableAm : Deferrable {", + "\n private double AmortizationFactorDae => GetScope((Identity, \"DAE\", 0), o => o.WithContext(EconomicBasis)).Value;", + "\n private double AmortizationFactorCu => GetScope((Identity, AmountTypes.CU, 0), o => o.WithContext(EconomicBasis)).Value;", + "\n private double AmortizationFactor => ", + "\n private double AggregatedDeferrable => GetScope((Identity, InputSource.Cashflow)).Values", + "\n .Sum(aocStep => GetScope(Identity with {AocType = aocStep.AocType, Novelty = aocStep.Novelty}).Value);", + "\n double Deferrable.Value => -1d * AggregatedDeferrable * AmortizationFactor;", + "\n}", + "\n", + "\npublic interface DeferrableEoP : Deferrable {", + "\n double Deferrable.Value => GetScope((Identity, InputSource.Cashflow)).Values", + "\n .Sum(aocStep => GetScope(Identity with {AocType = aocStep.AocType, Novelty = aocStep.Novelty}).Value);", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "//AOCSTEPS: BOP,I and N - AM - EOP //IS this only for LIC?", + "\npublic interface NominalDeferrable : IScope", + "\n{", + "\n static ApplicabilityBuilder ScopeApplicabilityBuilder(ApplicabilityBuilder builder) =>", + "\n builder.ForScope(s => s //compute with IfrsVariable?", + "\n .WithApplicability(x => x.Identity.AocType == AocTypes.BOP && x.Identity.Novelty == Novelties.I && x.Identity.ProjectionPeriod > 0)", + "\n .WithApplicability(x => x.Identity.AocType == AocTypes.BOP) //I and N?", + "\n .WithApplicability(x => x.Identity.AocType == AocTypes.CL)", + "\n .WithApplicability(x => x.Identity.AocType == AocTypes.AM)", + "\n .WithApplicability(x => x.Identity.AocType == AocTypes.EOP)", + "\n );", + "\n ", + "\n [IdentityProperty][NotVisible][Dimension(typeof(EstimateType))]", + "\n string EstimateType => EstimateTypes.DA;", + "\n string AmountType => null;", + "\n", + "\n [NotVisible] string EconomicBasis => EconomicBases.N;// GetStorage().GetEconomicBasisDriver(Identity.DataNode);", + "\n (int AccidentYear, double Value)[] Deferrals => Enumerable.Empty<(int,double)>().ToArray(); // TODO ", + "\n}", + "\n", + "\npublic interface BoPDeferrableProjection : NominalDeferrable{", + "\n (int AccidentYear, double Value)[] NominalDeferrable.Deferrals => GetScope(Identity with {AocType = AocTypes.EOP, Novelty = Novelties.C, ", + "\n ProjectionPeriod = Identity.ProjectionPeriod - 1}).Deferrals", + "\n .Where(x => Math.Abs(x.Item2) >= Precision).ToArray();", + "\n}", + "\n", + "\npublic interface BoPDeferrable : NominalDeferrable{", + "\n", + "\n /*private*/ bool isAtInception => GetStorage().IsInceptionYear(Identity.DataNode);", + "\n ", + "\n /*private*/ double[] referenceCashflow => GetScope((Identity, \"DAE\", EstimateTypes.BE, (int?)null)).Values; //should it be NominalCashlfow?", + "\n ", + "\n (int AccidentYear, double Value)[] NominalDeferrable.Deferrals =>( (isAtInception && Identity.Novelty == Novelties.I) || Identity.Novelty == Novelties.N", + "\n ? referenceCashflow.Select((x, i) => ((int)i, x))", + "\n : Enumerable.Range(1, MonthInAYear).Select(ay => ((int)ay, GetStorage().GetValue(Identity, null, \"DAE\", EconomicBasis, ay, Identity.ProjectionPeriod)) ) )", + "\n .Where(x => Math.Abs(x.Item2) >= Precision).ToArray();", + "\n}", + "\n", + "\npublic interface ClDeferrable : NominalDeferrable{", + "\n (int AccidentYear, double Value)[] referenceCashflow => GetScope((Identity, InputSource.Cashflow)).Values", + "\n .GroupBy(x => x.Novelty, (k, aocs) => aocs.Last()).Select(aoc => GetScope((Identity with {AocType = aoc.AocType, Novelty = aoc.Novelty}, \"DAE\", EstimateTypes.BE, (int?)null)).Values)", + "\n .AggregateDoubleArray().Select((x, i) => ((int)i, x)).Where(x => Math.Abs(x.Item2) >= Precision).ToArray(); //Should be Deferral BOP - from IfrsVariable- in year +1", + "\n (int AccidentYear, double Value)[] NominalDeferrable.Deferrals => referenceCashflow.Any() ? referenceCashflow : GetScope(Identity with {AocType = AocTypes.BOP, Novelty = Novelties.N}).Deferrals;", + "\n}", + "\n", + "\npublic interface AmDeferrable : NominalDeferrable{", + "\n private AocStep referenceAocStep => GetScope(Identity).Value;", + "\n (int AccidentYear, double Value)[] referenceCashflow => GetScope(Identity with {AocType = referenceAocStep.AocType, Novelty = referenceAocStep.Novelty}).Deferrals;", + "\n (int AccidentYear, double Value)[] NominalDeferrable.Deferrals => referenceCashflow.Select(def => (def.AccidentYear, ", + "\n -1d * def.Value * GetScope((Identity, \"DAE\", (int)def.AccidentYear), o => o.WithContext(EconomicBasis)).Value) ).ToArray();", + "\n}", + "\n", + "\npublic interface EopDeferrable : NominalDeferrable{", + "\n /*private*/ IEnumerable previousAocSteps => GetScope((Identity, InputSource.Cashflow)).Values;", + "\n (int AccidentYear, double Value)[] NominalDeferrable.Deferrals => previousAocSteps.SelectMany(aocStep => GetScope(Identity with {AocType = aocStep.AocType, Novelty = aocStep.Novelty}).Deferrals)", + "\n .GroupBy(d => d.AccidentYear, (k, v) => (k, v.Sum(x => x.Value))).ToArray();", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public interface AmortizationFactorForDeferrable : IScope", + "\n{", + "\n ", + "\n double Value => default;", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ @@ -315,7 +437,7 @@ "\n", "\npublic interface AmortizationDeferrable : DeferrableActual", "\n{", - "\n private double AmortizationFactor => GetScope((Identity, AmountTypes.CU), o => o.WithContext(EconomicBasis)).Value;", + "\n private double AmortizationFactor => GetScope((Identity, AmountTypes.CU, 0), o => o.WithContext(EconomicBasis)).Value;", "\n private double AggregatedDeferrable => GetScope((Identity, InputSource.Actual)).Values", "\n .Sum(aocStep => GetScope(Identity with {AocType = aocStep.AocType, Novelty = aocStep.Novelty}).Value);", "\n double DeferrableActual.Value => -1d * AggregatedDeferrable * AmortizationFactor;", diff --git a/ifrs17/Import/4ImportScope-TechnicalMargin.ipynb b/ifrs17/Import/4ImportScope-TechnicalMargin.ipynb index 603ddf28..3b424f86 100644 --- a/ifrs17/Import/4ImportScope-TechnicalMargin.ipynb +++ b/ifrs17/Import/4ImportScope-TechnicalMargin.ipynb @@ -304,7 +304,7 @@ "\n static ApplicabilityBuilder ScopeApplicabilityBuilder(ApplicabilityBuilder builder) =>", "\n builder.ForScope(s => s.WithApplicability(x => x.Identity.ValuationApproach == ValuationApproaches.PAA)); ", "\n ", - "\n double TechnicalMargin.Value => -1d * AggregatedValue * GetScope((Identity, AmountTypes.CU), o => o.WithContext(EconomicBasis)).Value;", + "\n double TechnicalMargin.Value => -1d * AggregatedValue * GetScope((Identity, AmountTypes.CU, 0), o => o.WithContext(EconomicBasis)).Value;", "\n}", "\n", "\npublic interface TechnicalMarginForAmForPaa : TechnicalMargin", diff --git a/ifrs17/Import/5ImportScope-ToIfrsVar.ipynb b/ifrs17/Import/5ImportScope-ToIfrsVar.ipynb index b057f490..e407fd11 100644 --- a/ifrs17/Import/5ImportScope-ToIfrsVar.ipynb +++ b/ifrs17/Import/5ImportScope-ToIfrsVar.ipynb @@ -200,6 +200,28 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "code", + "source": [ + "public interface DeferrableToIfrsVariable2: IScope", + "\n{", + "\n IEnumerable DeferrableActual => GetStorage().DataNodeDataBySystemName[Identity.DataNode].LiabilityType == LiabilityTypes.LIC ", + "\n ? Enumerable.Empty()", + "\n : GetScope(Identity).RepeatOnce().SelectMany(x => x.Deferrals.Select(d => ", + "\n new IfrsVariable{ EstimateType = x.EstimateType,", + "\n DataNode = x.Identity.DataNode,", + "\n AocType = x.Identity.AocType,", + "\n Novelty = x.Identity.Novelty,", + "\n AccidentYear = d.AccidentYear,", + "\n Values = SetProjectionValue(d.Value, x.Identity.ProjectionPeriod),", + "\n Partition = GetStorage().TargetPartition }", + "\n ));", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ @@ -268,13 +290,13 @@ "\n{", "\n private string EconomicBasis => Identity.ValuationApproach == ValuationApproaches.VFA ? EconomicBases.C : EconomicBases.L;", "\n IEnumerable AmortizationFactor => Identity.AocType == AocTypes.AM", - "\n ? GetScope((Identity, AmountTypes.CU), o => o.WithContext(EconomicBasis))", + "\n ? GetScope((Identity, AmountTypes.CU, 0), o => o.WithContext(EconomicBasis))", "\n .RepeatOnce()", "\n .Select(x => new IfrsVariable{ EstimateType = x.EstimateType,", "\n DataNode = x.Identity.Id.DataNode,", "\n AocType = x.Identity.Id.AocType,", "\n Novelty = x.Identity.Id.Novelty,", - "\n AmountType = x.Identity.AmountType, //??", + "\n AmountType = x.EffectiveAmountType, //??", "\n EconomicBasis = x.EconomicBasis,", "\n Values = SetProjectionValue(x.Value, x.Identity.Id.ProjectionPeriod),", "\n Partition = GetStorage().TargetPartition", diff --git a/ifrs17/Import/ImportStorage.ipynb b/ifrs17/Import/ImportStorage.ipynb index d7cb8b6b..60985e8b 100644 --- a/ifrs17/Import/ImportStorage.ipynb +++ b/ifrs17/Import/ImportStorage.ipynb @@ -367,19 +367,20 @@ "\n return Math.Pow(1d + rate[period].Values[0], 1d / 12d) - 1d;", "\n }", "\n ", - "\n public double[] GetReleasePattern (ImportIdentity identity, string amountType)", + "\n public (string, double[]) GetReleasePattern (ImportIdentity identity, string amountType, int patternShift)", "\n {", "\n var patternFromCashflow = GetValues(identity with {AocType = AocTypes.CL, Novelty = Novelties.C}, amountType, EstimateTypes.P, (int?)null);", "\n if (patternFromCashflow.Any())", - "\n return patternFromCashflow;", + "\n return (amountType, Enumerable.Repeat(0d, patternShift).Concat(patternFromCashflow).ToArray());", "\n ", "\n double[] patternFromParameter = default;", "\n if(!SingleDataNodeParametersByGoc.TryGetValue(identity.DataNode, out var dataNodeParameterByPeriod))", - "\n return patternFromParameter;", + "\n return (null, patternFromParameter);", "\n ", "\n var monthlyPattern = dataNodeParameterByPeriod[CurrentPeriod].AmortizationFactor.Interpolate(dataNodeParameterByPeriod[CurrentPeriod].CashFlowPeriodicity, dataNodeParameterByPeriod[CurrentPeriod].InterpolationMethod);", - "\n return monthlyPattern.Normalize();", + "\n return (null, Enumerable.Repeat(0d, patternShift).Concat(monthlyPattern.Normalize()).ToArray());", "\n }", + "\n ", "\n public double GetPremiumAllocationFactor(ImportIdentity id) => ", "\n SingleDataNodeParametersByGoc.TryGetValue(id.DataNode, out var singleDataNodeParameter) ", "\n ? singleDataNodeParameter[CurrentPeriod].PremiumAllocation : DefaultPremiumExperienceAdjustmentFactor;", @@ -387,7 +388,10 @@ "\n public string GetEconomicBasisDriver(string dataNode) => ", "\n SingleDataNodeParametersByGoc.TryGetValue(dataNode, out var singleDataNodeParameter)", "\n ? singleDataNodeParameter[CurrentPeriod].EconomicBasisDriver : default;", - "\n", + "\n ", + "\n public bool IsInceptionYear(string dataNode) => SingleDataNodeParametersByGoc.TryGetValue(dataNode, out var singleDataNodeParameter)", + "\n ? singleDataNodeParameter[CurrentPeriod].Year == CurrentReportingPeriod.Year : default;", + "\n ", "\n // Data Node relationships", "\n public IEnumerable GetUnderlyingGic(ImportIdentity id) => !InterDataNodeParametersByGoc.TryGetValue(id.DataNode, out var interDataNodeParameters)", "\n ? Enumerable.Empty()", From d0ad3444e2496b89ec642d9b7ec46298925761da Mon Sep 17 00:00:00 2001 From: Davide Colleoni Date: Thu, 25 May 2023 14:54:21 +0200 Subject: [PATCH 46/55] new data --- .../Files/DataNodes/DataNodeStates_CH_2020_12.csv | 2 ++ ifrs17-template/Files/DataNodes/DataNodes_CH.csv | 3 +++ .../TransactionalData/NominalCashflowsPAA_CH_2020_12.csv | 7 +++++++ 3 files changed, 12 insertions(+) create mode 100644 ifrs17-template/Files/TransactionalData/NominalCashflowsPAA_CH_2020_12.csv diff --git a/ifrs17-template/Files/DataNodes/DataNodeStates_CH_2020_12.csv b/ifrs17-template/Files/DataNodes/DataNodeStates_CH_2020_12.csv index 42e0398a..982cc7ca 100644 --- a/ifrs17-template/Files/DataNodes/DataNodeStates_CH_2020_12.csv +++ b/ifrs17-template/Files/DataNodes/DataNodeStates_CH_2020_12.csv @@ -23,3 +23,5 @@ DTR1.4,Active, DTR2.1,Active, DTR2.2,Active, DTP1.1,Active, +DT10.1,Active, +DT10.2,Active, \ No newline at end of file diff --git a/ifrs17-template/Files/DataNodes/DataNodes_CH.csv b/ifrs17-template/Files/DataNodes/DataNodes_CH.csv index 6fae278b..7142e21a 100644 --- a/ifrs17-template/Files/DataNodes/DataNodes_CH.csv +++ b/ifrs17-template/Files/DataNodes/DataNodes_CH.csv @@ -10,6 +10,7 @@ DT2,DT2 NOCI,USD,ANN,BBA,, DT3,DT3 RunOff,USD,ANN,BBA,Default, DT4,DT4 OCI,USD,ANN,BBA,Default, DT5,DT5 Simple Import,USD,ANN,BBA,Default, +DT10,DT10 PPA,USD,ANN,PAA,Default, ,,,,,, @@GroupOfInsuranceContract,,,,,, SystemName,DisplayName,InsurancePortfolio,AnnualCohort,LiabilityType,Profitability, @@ -25,6 +26,8 @@ DT3.1,DT3.1 Runoff - PA 0.8,DT3,2020,LRC,P, DT4.1,DT4.1 CSM PA 0.8,DT4,2020,LRC,P, DT5.1,DT5.1 Simple Import on DT 4.1,DT5,2020,LRC,P, DTP1.1,DTP1.1 Projection,DT1,2020,LRC,P, +DT10.1,DT10.1 PAA,DT10,2020,LIC,P +DT10.2,DT10.1 PAA,DT10,2020,LRC,P ,,,,,, @@ReinsurancePortfolio,,,,,, SystemName,DisplayName,ContractualCurrency,LineOfBusiness,ValuationApproach,OciType, diff --git a/ifrs17-template/Files/TransactionalData/NominalCashflowsPAA_CH_2020_12.csv b/ifrs17-template/Files/TransactionalData/NominalCashflowsPAA_CH_2020_12.csv new file mode 100644 index 00000000..1cbf5e54 --- /dev/null +++ b/ifrs17-template/Files/TransactionalData/NominalCashflowsPAA_CH_2020_12.csv @@ -0,0 +1,7 @@ +@@Main,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +ReportingNode,Year,Month,Scenario,,,,,,,,,,,,,,,,,,,,,,,,,, +CH,2020,12,,,,,,,,,,,,,,,,,,,,,,,,,,, +@@Cashflow,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +DataNode,AmountType,EstimateType,AocType,Novelty,AccidentYear,CashFlowPeriodicity,InterpolationMethod,Values0,Values1,Values2,Values3,Values4,Values5,Values6,Values7,Values8,Values9,Values10,Values11,Values12,Values13,Values14,Values15,Values16,Values17,Values18,Values19,Values20,Values21,Values22,Values23 +DT10.2,DAE,BE,BOP,N,,Monthly,Uniform,1000,0,1300 +DT10.2,PR,BE,BOP,N,,Monthly,Uniform,1000, From c21b12238dc913bc45f403e9eb37756e0e136937 Mon Sep 17 00:00:00 2001 From: Davide Colleoni Date: Thu, 25 May 2023 15:33:39 +0200 Subject: [PATCH 47/55] rename --- .../DataNodeParameters_CH_2020_12.csv | 24 ++++++++++--------- ifrs17/Import/ImportStorage.ipynb | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/ifrs17-template/Files/DataNodes/DataNodeParameters_CH_2020_12.csv b/ifrs17-template/Files/DataNodes/DataNodeParameters_CH_2020_12.csv index 0e17cb6d..31932817 100644 --- a/ifrs17-template/Files/DataNodes/DataNodeParameters_CH_2020_12.csv +++ b/ifrs17-template/Files/DataNodes/DataNodeParameters_CH_2020_12.csv @@ -3,17 +3,19 @@ ReportingNode,Year,Month CH,2020,12 ,, @@SingleDataNodeParameter,, -DataNode,PremiumAllocation, -GicComplex,0.8, -DT1.1,0.8, -DT1.2,0.8, -DT1.3,1, -DT1.4,0.8, -DT1.5,0.8, -DT2.1,0.8, -DT2.2,0.8, -DT3.1,0.8, -DT4.1,0.8, +DataNode,PremiumAllocation,ReleasePattern0,ReleasePattern1,ReleasePattern2,ReleasePattern3,ReleasePattern4 +GicComplex,0.8,Monthly, +DT1.1,0.8,Monthly, +DT1.2,0.8,Monthly, +DT1.3,1,Monthly, +DT1.4,0.8,Monthly, +DT1.5,0.8,Monthly, +DT2.1,0.8,Monthly, +DT2.2,0.8,Monthly, +DT3.1,0.8,Monthly, +DT4.1,0.8,Monthly, +DT10.1,0,Yearly,Uniform, +DT10.2,0,Yearly,Uniform,1.41,1.14,0.87,0.58 ,, @@InterDataNodeParameter,, DataNode,LinkedDataNode,ReinsuranceCoverage diff --git a/ifrs17/Import/ImportStorage.ipynb b/ifrs17/Import/ImportStorage.ipynb index 8cddda3e..feb2bf0a 100644 --- a/ifrs17/Import/ImportStorage.ipynb +++ b/ifrs17/Import/ImportStorage.ipynb @@ -377,7 +377,7 @@ "\n if(!SingleDataNodeParametersByGoc.TryGetValue(identity.DataNode, out var dataNodeParameterByPeriod))", "\n return (null, patternFromParameter);", "\n ", - "\n var monthlyPattern = dataNodeParameterByPeriod[CurrentPeriod].AmortizationFactor.Interpolate(dataNodeParameterByPeriod[CurrentPeriod].CashFlowPeriodicity, dataNodeParameterByPeriod[CurrentPeriod].InterpolationMethod);", + "\n var monthlyPattern = dataNodeParameterByPeriod[CurrentPeriod].ReleasePattern.Interpolate(dataNodeParameterByPeriod[CurrentPeriod].CashFlowPeriodicity, dataNodeParameterByPeriod[CurrentPeriod].InterpolationMethod);", "\n return (null, Enumerable.Repeat(0d, patternShift).Concat(monthlyPattern.Normalize()).ToArray());", "\n }", "\n ", From f95c97cd45cb5611d34fc227c1650c6ff078c0e9 Mon Sep 17 00:00:00 2001 From: Davide Colleoni Date: Thu, 25 May 2023 16:02:48 +0200 Subject: [PATCH 48/55] compiles after merge --- .../DataNodeParameters_CH_2020_121.csv | 28 +++++++++++++++++++ .../InitSystemorphBaseToMemory.ipynb | 2 +- ifrs17/Import/3ImportScope-Actuals.ipynb | 7 ++--- ifrs17/Import/5ImportScope-ToIfrsVar.ipynb | 2 +- 4 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 ifrs17-template/Files/DataNodes/DataNodeParameters_CH_2020_121.csv diff --git a/ifrs17-template/Files/DataNodes/DataNodeParameters_CH_2020_121.csv b/ifrs17-template/Files/DataNodes/DataNodeParameters_CH_2020_121.csv new file mode 100644 index 00000000..4d8c0860 --- /dev/null +++ b/ifrs17-template/Files/DataNodes/DataNodeParameters_CH_2020_121.csv @@ -0,0 +1,28 @@ +@@Main,, +ReportingNode,Year,Month +CH,2020,12 +,, +@@SingleDataNodeParameter,, +DataNode,PremiumAllocation,CashFlowPeriodicity,InterpolationMethod,ReleasePattern0,ReleasePattern1,ReleasePattern2,ReleasePattern3,ReleasePattern4 +GicComplex,0.8,Monthly, +DT1.1,0.8,Monthly, +DT1.2,0.8,Monthly, +DT1.3,1,Monthly, +DT1.4,0.8,Monthly, +DT1.5,0.8,Monthly, +DT2.1,0.8,Monthly, +DT2.2,0.8,Monthly, +DT3.1,0.8,Monthly, +DT4.1,0.8,Monthly, +DT10.1,0,Yearly,Uniform, +DT10.2,0,Yearly,Uniform,1.41,1.14,0.87,0.58 +,, +@@InterDataNodeParameter,, +DataNode,LinkedDataNode,ReinsuranceCoverage +DT1.1,DTR1.1,1 +DT1.2,DTR1.2,1 +DT1.4,DTR1.3,1 +DT1.5,DTR1.4,1 +DT2.1,DTR2.1,1 +DT2.2,DTR2.2,1 +GricComplex,GicComplex,1 diff --git a/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb b/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb index ecb28355..4ca9b684 100644 --- a/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb +++ b/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb @@ -207,7 +207,7 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/DataNodes/DataNodeParameters_CH_2020_12.csv\")", + "await Import.FromFile(\"../Files/DataNodes/DataNodeParameters_CH_2020_121.csv\")", "\n .WithFormat(ImportFormats.DataNodeParameter)", "\n .WithTarget(DataSource)", "\n .WithActivityLog()", diff --git a/ifrs17/Import/3ImportScope-Actuals.ipynb b/ifrs17/Import/3ImportScope-Actuals.ipynb index d0ef8497..dfbe3f1b 100644 --- a/ifrs17/Import/3ImportScope-Actuals.ipynb +++ b/ifrs17/Import/3ImportScope-Actuals.ipynb @@ -285,11 +285,10 @@ { "cell_type": "code", "source": [ - "//AOCSTEPS: BOP,I and N - AM - EOP", - "\npublic interface Deferrable : IScope", + "public interface Deferrable : IScope", "\n{", "\n static ApplicabilityBuilder ScopeApplicabilityBuilder(ApplicabilityBuilder builder) =>", - "\n builder.ForScope(s => s //compute with IfrsVariable?", + "\n builder.ForScope(s => s //compute with IfrsVariable?", "\n //.WithApplicability(x => x.Identity.AocType == AocTypes.BOP && x.Identity.Novelty == Novelties.I && x.Identity.ProjectionPeriod > 0)", "\n .WithApplicability(x => x.Identity.AocType == AocTypes.CF)", "\n // .WithApplicability(x => x.Identity.AocType == AocTypes.CL)", @@ -311,7 +310,7 @@ "\npublic interface DeferrableAm : Deferrable {", "\n private double AmortizationFactorDae => GetScope((Identity, \"DAE\", 0), o => o.WithContext(EconomicBasis)).Value;", "\n private double AmortizationFactorCu => GetScope((Identity, AmountTypes.CU, 0), o => o.WithContext(EconomicBasis)).Value;", - "\n private double AmortizationFactor => ", + "\n private double AmortizationFactor => Math.Abs(AmortizationFactorDae) >= Precision ? AmortizationFactorDae : AmortizationFactorCu;", "\n private double AggregatedDeferrable => GetScope((Identity, InputSource.Cashflow)).Values", "\n .Sum(aocStep => GetScope(Identity with {AocType = aocStep.AocType, Novelty = aocStep.Novelty}).Value);", "\n double Deferrable.Value => -1d * AggregatedDeferrable * AmortizationFactor;", diff --git a/ifrs17/Import/5ImportScope-ToIfrsVar.ipynb b/ifrs17/Import/5ImportScope-ToIfrsVar.ipynb index e407fd11..f930c666 100644 --- a/ifrs17/Import/5ImportScope-ToIfrsVar.ipynb +++ b/ifrs17/Import/5ImportScope-ToIfrsVar.ipynb @@ -207,7 +207,7 @@ "\n{", "\n IEnumerable DeferrableActual => GetStorage().DataNodeDataBySystemName[Identity.DataNode].LiabilityType == LiabilityTypes.LIC ", "\n ? Enumerable.Empty()", - "\n : GetScope(Identity).RepeatOnce().SelectMany(x => x.Deferrals.Select(d => ", + "\n : GetScope(Identity).RepeatOnce().SelectMany(x => x.Deferrals.Select(d => ", "\n new IfrsVariable{ EstimateType = x.EstimateType,", "\n DataNode = x.Identity.DataNode,", "\n AocType = x.Identity.AocType,", From e581caf91f1468cfb188c7e80c797b46b5a8ab57 Mon Sep 17 00:00:00 2001 From: Davide Colleoni Date: Thu, 25 May 2023 16:34:21 +0200 Subject: [PATCH 49/55] Normilize not to return null but empty enum --- ifrs17/Test/DoubleArrayExtentionsTest.ipynb | 4 ++-- ifrs17/Utils/Extensions.ipynb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ifrs17/Test/DoubleArrayExtentionsTest.ipynb b/ifrs17/Test/DoubleArrayExtentionsTest.ipynb index d0ac5cf5..efc12fc9 100644 --- a/ifrs17/Test/DoubleArrayExtentionsTest.ipynb +++ b/ifrs17/Test/DoubleArrayExtentionsTest.ipynb @@ -263,7 +263,7 @@ "cell_type": "code", "source": [ "var array = new double[]{-1,+1,-1,+1};", - "\nvar benchmark = (double[])null;", + "\nvar benchmark = Enumerable.Empty().ToArray();", "\nCheckNormalizedArray(array, benchmark);" ], "metadata": {}, @@ -274,7 +274,7 @@ "cell_type": "code", "source": [ "var array = new double[]{};", - "\nvar benchmark = (double[])null;", + "\nvar benchmark = Enumerable.Empty().ToArray();", "\nCheckNormalizedArray(array, benchmark);" ], "metadata": {}, diff --git a/ifrs17/Utils/Extensions.ipynb b/ifrs17/Utils/Extensions.ipynb index 84a84868..b46442a1 100644 --- a/ifrs17/Utils/Extensions.ipynb +++ b/ifrs17/Utils/Extensions.ipynb @@ -146,7 +146,7 @@ "public static double[] Normalize(this IEnumerable source) {", "\n var norm = source?.Sum() ?? 0d;", "\n if(Math.Abs(norm) < 10E-6)", - "\n return default;", + "\n return Enumerable.Empty().ToArray();", "\n return source.Select(v => v / norm).ToArray();}" ], "metadata": {}, From 782ebb5f1ccb7ede9774b9d88565b6f1337c47b5 Mon Sep 17 00:00:00 2001 From: Davide Colleoni Date: Fri, 26 May 2023 08:07:26 +0200 Subject: [PATCH 50/55] remove new deferral --- ifrs17/Import/3ImportScope-Actuals.ipynb | 121 --------------------- ifrs17/Import/5ImportScope-ToIfrsVar.ipynb | 22 ---- 2 files changed, 143 deletions(-) diff --git a/ifrs17/Import/3ImportScope-Actuals.ipynb b/ifrs17/Import/3ImportScope-Actuals.ipynb index dfbe3f1b..6cf9e033 100644 --- a/ifrs17/Import/3ImportScope-Actuals.ipynb +++ b/ifrs17/Import/3ImportScope-Actuals.ipynb @@ -282,127 +282,6 @@ "execution_count": 0, "outputs": [] }, - { - "cell_type": "code", - "source": [ - "public interface Deferrable : IScope", - "\n{", - "\n static ApplicabilityBuilder ScopeApplicabilityBuilder(ApplicabilityBuilder builder) =>", - "\n builder.ForScope(s => s //compute with IfrsVariable?", - "\n //.WithApplicability(x => x.Identity.AocType == AocTypes.BOP && x.Identity.Novelty == Novelties.I && x.Identity.ProjectionPeriod > 0)", - "\n .WithApplicability(x => x.Identity.AocType == AocTypes.CF)", - "\n // .WithApplicability(x => x.Identity.AocType == AocTypes.CL)", - "\n .WithApplicability(x => x.Identity.AocType == AocTypes.AM)", - "\n .WithApplicability(x => x.Identity.AocType == AocTypes.EOP)", - "\n );", - "\n [IdentityProperty][NotVisible][Dimension(typeof(EstimateType))]", - "\n string EstimateType => EstimateTypes.DA;", - "\n string AmountType => null;", - "\n", - "\n [NotVisible] string EconomicBasis => GetStorage().GetEconomicBasisDriver(Identity.DataNode);", - "\n double Value => GetScope((Identity, \"DAE\", EstimateTypes.BE, (int?)null), o => o.WithContext(EconomicBasis)).Value;", - "\n}", - "\n", - "\npublic interface DeferrableDefaultValue : Deferrable {", - "\n double Deferrable.Value => default;", - "\n}", - "\n", - "\npublic interface DeferrableAm : Deferrable {", - "\n private double AmortizationFactorDae => GetScope((Identity, \"DAE\", 0), o => o.WithContext(EconomicBasis)).Value;", - "\n private double AmortizationFactorCu => GetScope((Identity, AmountTypes.CU, 0), o => o.WithContext(EconomicBasis)).Value;", - "\n private double AmortizationFactor => Math.Abs(AmortizationFactorDae) >= Precision ? AmortizationFactorDae : AmortizationFactorCu;", - "\n private double AggregatedDeferrable => GetScope((Identity, InputSource.Cashflow)).Values", - "\n .Sum(aocStep => GetScope(Identity with {AocType = aocStep.AocType, Novelty = aocStep.Novelty}).Value);", - "\n double Deferrable.Value => -1d * AggregatedDeferrable * AmortizationFactor;", - "\n}", - "\n", - "\npublic interface DeferrableEoP : Deferrable {", - "\n double Deferrable.Value => GetScope((Identity, InputSource.Cashflow)).Values", - "\n .Sum(aocStep => GetScope(Identity with {AocType = aocStep.AocType, Novelty = aocStep.Novelty}).Value);", - "\n}" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "//AOCSTEPS: BOP,I and N - AM - EOP //IS this only for LIC?", - "\npublic interface NominalDeferrable : IScope", - "\n{", - "\n static ApplicabilityBuilder ScopeApplicabilityBuilder(ApplicabilityBuilder builder) =>", - "\n builder.ForScope(s => s //compute with IfrsVariable?", - "\n .WithApplicability(x => x.Identity.AocType == AocTypes.BOP && x.Identity.Novelty == Novelties.I && x.Identity.ProjectionPeriod > 0)", - "\n .WithApplicability(x => x.Identity.AocType == AocTypes.BOP) //I and N?", - "\n .WithApplicability(x => x.Identity.AocType == AocTypes.CL)", - "\n .WithApplicability(x => x.Identity.AocType == AocTypes.AM)", - "\n .WithApplicability(x => x.Identity.AocType == AocTypes.EOP)", - "\n );", - "\n ", - "\n [IdentityProperty][NotVisible][Dimension(typeof(EstimateType))]", - "\n string EstimateType => EstimateTypes.DA;", - "\n string AmountType => null;", - "\n", - "\n [NotVisible] string EconomicBasis => EconomicBases.N;// GetStorage().GetEconomicBasisDriver(Identity.DataNode);", - "\n (int AccidentYear, double Value)[] Deferrals => Enumerable.Empty<(int,double)>().ToArray(); // TODO ", - "\n}", - "\n", - "\npublic interface BoPDeferrableProjection : NominalDeferrable{", - "\n (int AccidentYear, double Value)[] NominalDeferrable.Deferrals => GetScope(Identity with {AocType = AocTypes.EOP, Novelty = Novelties.C, ", - "\n ProjectionPeriod = Identity.ProjectionPeriod - 1}).Deferrals", - "\n .Where(x => Math.Abs(x.Item2) >= Precision).ToArray();", - "\n}", - "\n", - "\npublic interface BoPDeferrable : NominalDeferrable{", - "\n", - "\n /*private*/ bool isAtInception => GetStorage().IsInceptionYear(Identity.DataNode);", - "\n ", - "\n /*private*/ double[] referenceCashflow => GetScope((Identity, \"DAE\", EstimateTypes.BE, (int?)null)).Values; //should it be NominalCashlfow?", - "\n ", - "\n (int AccidentYear, double Value)[] NominalDeferrable.Deferrals =>( (isAtInception && Identity.Novelty == Novelties.I) || Identity.Novelty == Novelties.N", - "\n ? referenceCashflow.Select((x, i) => ((int)i, x))", - "\n : Enumerable.Range(1, MonthInAYear).Select(ay => ((int)ay, GetStorage().GetValue(Identity, null, \"DAE\", EconomicBasis, ay, Identity.ProjectionPeriod)) ) )", - "\n .Where(x => Math.Abs(x.Item2) >= Precision).ToArray();", - "\n}", - "\n", - "\npublic interface ClDeferrable : NominalDeferrable{", - "\n (int AccidentYear, double Value)[] referenceCashflow => GetScope((Identity, InputSource.Cashflow)).Values", - "\n .GroupBy(x => x.Novelty, (k, aocs) => aocs.Last()).Select(aoc => GetScope((Identity with {AocType = aoc.AocType, Novelty = aoc.Novelty}, \"DAE\", EstimateTypes.BE, (int?)null)).Values)", - "\n .AggregateDoubleArray().Select((x, i) => ((int)i, x)).Where(x => Math.Abs(x.Item2) >= Precision).ToArray(); //Should be Deferral BOP - from IfrsVariable- in year +1", - "\n (int AccidentYear, double Value)[] NominalDeferrable.Deferrals => referenceCashflow.Any() ? referenceCashflow : GetScope(Identity with {AocType = AocTypes.BOP, Novelty = Novelties.N}).Deferrals;", - "\n}", - "\n", - "\npublic interface AmDeferrable : NominalDeferrable{", - "\n private AocStep referenceAocStep => GetScope(Identity).Value;", - "\n (int AccidentYear, double Value)[] referenceCashflow => GetScope(Identity with {AocType = referenceAocStep.AocType, Novelty = referenceAocStep.Novelty}).Deferrals;", - "\n (int AccidentYear, double Value)[] NominalDeferrable.Deferrals => referenceCashflow.Select(def => (def.AccidentYear, ", - "\n -1d * def.Value * GetScope((Identity, \"DAE\", (int)def.AccidentYear), o => o.WithContext(EconomicBasis)).Value) ).ToArray();", - "\n}", - "\n", - "\npublic interface EopDeferrable : NominalDeferrable{", - "\n /*private*/ IEnumerable previousAocSteps => GetScope((Identity, InputSource.Cashflow)).Values;", - "\n (int AccidentYear, double Value)[] NominalDeferrable.Deferrals => previousAocSteps.SelectMany(aocStep => GetScope(Identity with {AocType = aocStep.AocType, Novelty = aocStep.Novelty}).Deferrals)", - "\n .GroupBy(d => d.AccidentYear, (k, v) => (k, v.Sum(x => x.Value))).ToArray();", - "\n}" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "public interface AmortizationFactorForDeferrable : IScope", - "\n{", - "\n ", - "\n double Value => default;", - "\n}" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, { "cell_type": "code", "source": [ diff --git a/ifrs17/Import/5ImportScope-ToIfrsVar.ipynb b/ifrs17/Import/5ImportScope-ToIfrsVar.ipynb index f930c666..1eb166db 100644 --- a/ifrs17/Import/5ImportScope-ToIfrsVar.ipynb +++ b/ifrs17/Import/5ImportScope-ToIfrsVar.ipynb @@ -200,28 +200,6 @@ "execution_count": 0, "outputs": [] }, - { - "cell_type": "code", - "source": [ - "public interface DeferrableToIfrsVariable2: IScope", - "\n{", - "\n IEnumerable DeferrableActual => GetStorage().DataNodeDataBySystemName[Identity.DataNode].LiabilityType == LiabilityTypes.LIC ", - "\n ? Enumerable.Empty()", - "\n : GetScope(Identity).RepeatOnce().SelectMany(x => x.Deferrals.Select(d => ", - "\n new IfrsVariable{ EstimateType = x.EstimateType,", - "\n DataNode = x.Identity.DataNode,", - "\n AocType = x.Identity.AocType,", - "\n Novelty = x.Identity.Novelty,", - "\n AccidentYear = d.AccidentYear,", - "\n Values = SetProjectionValue(d.Value, x.Identity.ProjectionPeriod),", - "\n Partition = GetStorage().TargetPartition }", - "\n ));", - "\n}" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, { "cell_type": "code", "source": [ From 9d99d0c1b75945d9cffc492f99388e069103418d Mon Sep 17 00:00:00 2001 From: Davide Colleoni Date: Fri, 26 May 2023 08:07:54 +0200 Subject: [PATCH 51/55] Fix Amf from IfrsVariable (to be cherry picked) --- ifrs17/Import/2ImportScope-PresentValue.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ifrs17/Import/2ImportScope-PresentValue.ipynb b/ifrs17/Import/2ImportScope-PresentValue.ipynb index 43a2940b..92267c22 100644 --- a/ifrs17/Import/2ImportScope-PresentValue.ipynb +++ b/ifrs17/Import/2ImportScope-PresentValue.ipynb @@ -903,10 +903,10 @@ "\n}", "\n", "\npublic interface AmfFromIfrsVariable : CurrentPeriodAmortizationFactor{", - "\n private double amortizationFactorForAmountType => GetStorage().GetValue(Identity.Id, Identity.AmountType, EstimateType, EconomicBasis, Identity.patternShift, Identity.Id.ProjectionPeriod);", + "\n private double amortizationFactorForAmountType => GetStorage().GetValue(Identity.Id, Identity.AmountType, EstimateType, EconomicBasis, Identity.patternShift == 0 ? null : Identity.patternShift, Identity.Id.ProjectionPeriod);", "\n double CurrentPeriodAmortizationFactor.Value => Math.Abs(amortizationFactorForAmountType) >= Precision", "\n ? amortizationFactorForAmountType ", - "\n : GetStorage().GetValue(Identity.Id, null, EstimateType, EconomicBasis, Identity.patternShift, Identity.Id.ProjectionPeriod);", + "\n : GetStorage().GetValue(Identity.Id, null, EstimateType, EconomicBasis, Identity.patternShift == 0 ? null : Identity.patternShift, Identity.Id.ProjectionPeriod);", "\n}" ], "metadata": {}, From f7d3e5ce0cb0598108d0baaa7b47317f9f077894 Mon Sep 17 00:00:00 2001 From: Davide Colleoni Date: Fri, 26 May 2023 08:42:29 +0200 Subject: [PATCH 52/55] update bm and ifrsVartest --- .../BM_CH_2020_12__F.csv | 22 +++++++++---------- .../BM_CH_2021_3__F.csv | 20 ++++++++--------- ifrs17-template/Test/IfrsVariablesTest.ipynb | 2 +- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12__F.csv b/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12__F.csv index 1edaa670..2bbd39c7 100644 --- a/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12__F.csv +++ b/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12__F.csv @@ -3,19 +3,19 @@ Month,ReportingNode,Scenario,Year 12,CH,,2020 @@F AccidentYear,AmountType,AocType,DataNode,EconomicBasis,EstimateType,Novelty,Values0 -,,AM,DT1.1,L,F,C,0.65623 +,CU,AM,DT1.1,L,F,C,0.65623 ,,AM,DT1.2,L,F,C,1 -,,AM,DT1.3,L,F,C,0.65623 -,,AM,DT2.1,L,F,C,0.65623 +,CU,AM,DT1.3,L,F,C,0.65623 +,CU,AM,DT2.1,L,F,C,0.65623 ,,AM,DT2.2,L,F,C,1 -,,AM,DTR1.1,L,F,C,0.65623 +,CU,AM,DTR1.1,L,F,C,0.65623 ,,AM,DTR1.2,L,F,C,1 -,,AM,DTR2.1,L,F,C,0.65623 +,CU,AM,DTR2.1,L,F,C,0.65623 ,,AM,DTR2.2,L,F,C,1 -,,AM,DT3.1,L,F,C,0.65623 -,,AM,DT4.1,L,F,C,0.65623 -,,AM,DT1.4,L,F,C,0.65623 -,,AM,DT1.5,L,F,C,0.65623 -,,AM,DTR1.3,L,F,C,0.65623 -,,AM,DTR1.4,L,F,C,0.65623 +,CU,AM,DT3.1,L,F,C,0.65623 +,CU,AM,DT4.1,L,F,C,0.65623 +,CU,AM,DT1.4,L,F,C,0.65623 +,CU,AM,DT1.5,L,F,C,0.65623 +,CU,AM,DTR1.3,L,F,C,0.65623 +,CU,AM,DTR1.4,L,F,C,0.65623 ,,AM,DT5.1,L,F,C,0.65623 \ No newline at end of file diff --git a/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2021_3__F.csv b/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2021_3__F.csv index 9a7ba050..e8653719 100644 --- a/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2021_3__F.csv +++ b/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2021_3__F.csv @@ -3,18 +3,18 @@ Month,ReportingNode,Scenario,Year 3,CH,,2021 @@F AccidentYear,AmountType,AocType,DataNode,EconomicBasis,EstimateType,Novelty,Values0 -,,AM,DT1.1,L,F,C,0.32249 +,CU,AM,DT1.1,L,F,C,0.32249 ,,AM,DT1.2,L,F,C,1 -,,AM,DT1.3,L,F,C,0.32249 -,,AM,DT2.1,L,F,C,0.32249 +,CU,AM,DT1.3,L,F,C,0.32249 +,CU,AM,DT2.1,L,F,C,0.32249 ,,AM,DT2.2,L,F,C,1 -,,AM,DTR1.1,L,F,C,0.32249 +,CU,AM,DTR1.1,L,F,C,0.32249 ,,AM,DTR1.2,L,F,C,1 -,,AM,DTR2.1,L,F,C,0.32249 +,CU,AM,DTR2.1,L,F,C,0.32249 ,,AM,DTR2.2,L,F,C,1 ,,AM,DT3.1,L,F,C,1 -,,AM,DT4.1,L,F,C,0.32249 -,,AM,DT1.4,L,F,C,0.32249 -,,AM,DT1.5,L,F,C,0.32249 -,,AM,DTR1.3,L,F,C,0.32249 -,,AM,DTR1.4,L,F,C,0.32249 \ No newline at end of file +,CU,AM,DT4.1,L,F,C,0.32249 +,CU,AM,DT1.4,L,F,C,0.32249 +,CU,AM,DT1.5,L,F,C,0.32249 +,CU,AM,DTR1.3,L,F,C,0.32249 +,CU,AM,DTR1.4,L,F,C,0.32249 \ No newline at end of file diff --git a/ifrs17-template/Test/IfrsVariablesTest.ipynb b/ifrs17-template/Test/IfrsVariablesTest.ipynb index d3931f2b..5506bba7 100644 --- a/ifrs17-template/Test/IfrsVariablesTest.ipynb +++ b/ifrs17-template/Test/IfrsVariablesTest.ipynb @@ -186,7 +186,7 @@ "\n var computedNotExpected = computed.Where(x => x.Values.Any(y => Math.Abs(y) > BenchmarkPrecision)).Except(expected, comparer);", "\n if (expectedNotComputed.Any()){", "\n foreach(var element in expectedNotComputed){", - "\n errors.Add(new BenchmarkTestResult(\"Extra expected variable for: Partition \" + element.Partition + \", \" + element.ToIdentityString()));", + "\n errors.Add(new BenchmarkTestResult(\"Extra expected variable for: Partition \" + element.Partition + \", \" + element.ToIdentityString(), element.Values, null));", "\n }", "\n }", "\n if (computedNotExpected.Any()){", From 5a7a975c85f38ed721c612dab3505433cbf8bbda Mon Sep 17 00:00:00 2001 From: Davide Colleoni Date: Fri, 26 May 2023 08:44:22 +0200 Subject: [PATCH 53/55] add evaluation in the debug nb --- .../EvaluateImportScopes.ipynb | 99 +++++++++++++++++-- 1 file changed, 91 insertions(+), 8 deletions(-) diff --git a/ifrs17-template/Import/InteractWithImportScopes/EvaluateImportScopes.ipynb b/ifrs17-template/Import/InteractWithImportScopes/EvaluateImportScopes.ipynb index a00173f3..87af97cf 100644 --- a/ifrs17-template/Import/InteractWithImportScopes/EvaluateImportScopes.ipynb +++ b/ifrs17-template/Import/InteractWithImportScopes/EvaluateImportScopes.ipynb @@ -202,14 +202,16 @@ { "cell_type": "code", "source": [ - "var ret = universe.GetScopes(identities)", - "\n .SelectMany(x => x.PresentValues)", - "\n .Select(x => new {Value= x.Value, ", - "\n Id = x.Identity.Id, ", - "\n AmoutType = x.Identity.AmountType,", - "\n EstimateType = x.Identity.EstimateType,", - "\n AccidentYear = x.Identity.AccidentYear});", - "\nret.ToArray();" + "identities.First()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var idByDn = identities.ToDictionaryGrouped(x => x.DataNode, x => x.ToArray());" ], "metadata": {}, "execution_count": 0, @@ -224,6 +226,87 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "code", + "source": [ + "var ivs = Scopes.ForIdentities(identities, storage).ToScopes().SelectMany(x => x.PvLocked.Concat(x.PvCurrent)).ToArray();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var ivs = Scopes.ForIdentities(identities, storage).ToScopes().SelectMany(x => x.CumulatedNominal).ToArray();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var ivs = Scopes.ForIdentities(identities, storage).ToScopes().SelectMany(x => x.RaCurrent.Concat(x.RaLocked)).ToArray();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var ivs = Scopes.ForIdentities(identities, storage).ToScopes().SelectMany(x => x.Actual.Concat(x.AdvanceActual).Concat(x.OverdueActual)).ToArray();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var ivs = Scopes.ForIdentities(identities, storage).ToScopes().SelectMany(x => x.DeferrableActual).ToArray();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var ivs = Scopes.ForIdentities(identities, storage).ToScopes().SelectMany(x => x.BeEAForPremium.Concat(x.ActEAForPremium)).ToArray();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var ivs = Scopes.ForIdentities(identities, storage).ToScopes().SelectMany(x => x.BeEAForPremium.Concat(x.ActEAForPremium)).ToArray();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var ivs = Scopes.ForIdentities(identities, storage).ToScopes().SelectMany(x => x.AmortizationFactor.Concat(x.Csms).Concat(x.Loss)).ToArray();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ From 7b54b28884cf87dcd09b971e617f25fc8ff8647b Mon Sep 17 00:00:00 2001 From: Davide Colleoni Date: Fri, 26 May 2023 12:03:10 +0200 Subject: [PATCH 54/55] improve doc and address comments --- .../DataNodeParameters_CH_2020_12.csv | 2 +- .../DataNodeParameters_CH_2020_121.csv | 28 ----------- .../InitSystemorphBaseToMemory.ipynb | 2 +- ifrs17/Import/2ImportScope-PresentValue.ipynb | 47 +++++++------------ ifrs17/Utils/Extensions.ipynb | 2 +- 5 files changed, 21 insertions(+), 60 deletions(-) delete mode 100644 ifrs17-template/Files/DataNodes/DataNodeParameters_CH_2020_121.csv diff --git a/ifrs17-template/Files/DataNodes/DataNodeParameters_CH_2020_12.csv b/ifrs17-template/Files/DataNodes/DataNodeParameters_CH_2020_12.csv index 31932817..4d8c0860 100644 --- a/ifrs17-template/Files/DataNodes/DataNodeParameters_CH_2020_12.csv +++ b/ifrs17-template/Files/DataNodes/DataNodeParameters_CH_2020_12.csv @@ -3,7 +3,7 @@ ReportingNode,Year,Month CH,2020,12 ,, @@SingleDataNodeParameter,, -DataNode,PremiumAllocation,ReleasePattern0,ReleasePattern1,ReleasePattern2,ReleasePattern3,ReleasePattern4 +DataNode,PremiumAllocation,CashFlowPeriodicity,InterpolationMethod,ReleasePattern0,ReleasePattern1,ReleasePattern2,ReleasePattern3,ReleasePattern4 GicComplex,0.8,Monthly, DT1.1,0.8,Monthly, DT1.2,0.8,Monthly, diff --git a/ifrs17-template/Files/DataNodes/DataNodeParameters_CH_2020_121.csv b/ifrs17-template/Files/DataNodes/DataNodeParameters_CH_2020_121.csv deleted file mode 100644 index 4d8c0860..00000000 --- a/ifrs17-template/Files/DataNodes/DataNodeParameters_CH_2020_121.csv +++ /dev/null @@ -1,28 +0,0 @@ -@@Main,, -ReportingNode,Year,Month -CH,2020,12 -,, -@@SingleDataNodeParameter,, -DataNode,PremiumAllocation,CashFlowPeriodicity,InterpolationMethod,ReleasePattern0,ReleasePattern1,ReleasePattern2,ReleasePattern3,ReleasePattern4 -GicComplex,0.8,Monthly, -DT1.1,0.8,Monthly, -DT1.2,0.8,Monthly, -DT1.3,1,Monthly, -DT1.4,0.8,Monthly, -DT1.5,0.8,Monthly, -DT2.1,0.8,Monthly, -DT2.2,0.8,Monthly, -DT3.1,0.8,Monthly, -DT4.1,0.8,Monthly, -DT10.1,0,Yearly,Uniform, -DT10.2,0,Yearly,Uniform,1.41,1.14,0.87,0.58 -,, -@@InterDataNodeParameter,, -DataNode,LinkedDataNode,ReinsuranceCoverage -DT1.1,DTR1.1,1 -DT1.2,DTR1.2,1 -DT1.4,DTR1.3,1 -DT1.5,DTR1.4,1 -DT2.1,DTR2.1,1 -DT2.2,DTR2.2,1 -GricComplex,GicComplex,1 diff --git a/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb b/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb index 4ca9b684..ecb28355 100644 --- a/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb +++ b/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb @@ -207,7 +207,7 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/DataNodes/DataNodeParameters_CH_2020_121.csv\")", + "await Import.FromFile(\"../Files/DataNodes/DataNodeParameters_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.DataNodeParameter)", "\n .WithTarget(DataSource)", "\n .WithActivityLog()", diff --git a/ifrs17/Import/2ImportScope-PresentValue.ipynb b/ifrs17/Import/2ImportScope-PresentValue.ipynb index 92267c22..1149e59d 100644 --- a/ifrs17/Import/2ImportScope-PresentValue.ipynb +++ b/ifrs17/Import/2ImportScope-PresentValue.ipynb @@ -779,30 +779,7 @@ { "cell_type": "markdown", "source": [ - "## Coverage Units", - "\n", - "\nThe coverage unit (CU) of a GIC is introduced in the standard as the quantity of the service provided in that GIC. The service is", - "\nmeasured by considering the quantity of benefits provided as well as the expected coverage period of the GIC.", - "\n", - "\nThe cash flows of coverage units are retrieved from the discounted cash flows with [EstimateType](../DataModel/DataStructure#estimate-type) CU." - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "//TODO - OBSOLETE : Remove", - "\npublic interface PatternPv : IScope<(ImportIdentity Id, string AmountType), ImportStorage>", - "\n{ ", - "\n [NotVisible] string EconomicBasis => GetContext();", - "\n ", - "\n [IdentityProperty][NotVisible][Dimension(typeof(EstimateType))]", - "\n string EstimateType => EstimateTypes.P; ", - "\n", - "\n double[] Values => GetScope((Identity.Id, Identity.AmountType, EstimateType, (int?)null)).Values;", - "\n}" + "## Amortization Factor" ], "metadata": {}, "execution_count": 0, @@ -811,7 +788,15 @@ { "cell_type": "markdown", "source": [ - "## Amortization Factor" + "The calculation of the Amortization factors uses a release pattern defined in input. ", + "\nA generic pattern specific for a certain GIC can be input through the [Single Data Node Parameter](../DataModel/#data-node-parameters) through the Release Pattern fields. It is possible to also define release pattern specific for an AmountType. For example a coverage units pattern for the calculaiton of Contractual service margin, a premium pattern for the Premium allocation approach, and a deferral pattern for deferrable expenses. ", + "\nThe calculation gives priority to the specific pattern and falls back to the general pattern provided as Data node parameter if absent. ", + "\n", + "\n**Specific AmountType**", + "\n", + "\nFor valuation approaches BBA and VFA the coverage unit (CU) of a GIC is introduced in the standard as the quantity of the service provided in that GIC. The service is measured by considering the quantity of benefits provided as well as the expected coverage period of the GIC.", + "\n", + "\nThe cash flows of coverage units are retrieved from the discounted (with Locked-in, Current, or undiscounted) and cumulated cash flows with [EstimateType](../DataModel/DataStructure#estimate-type) P and [AmountType](../DataModel/DataStructure#amount-type) CU. The pattern for the AoC Step CL,C is considered. " ], "metadata": {}, "execution_count": 0, @@ -820,16 +805,20 @@ { "cell_type": "markdown", "source": [ - "For a certain GIC, the monthly Amortization Factors $\\text{Monthly }AF_i$ are computed from the cash flows of the underlying coverage unit for that GIC:", + "**Calculation**", + "\n", + "\nFor a certain GIC, the monthly Amortization Factors $\\text{Monthly }AF_i$ are computed from the provided pattern for that GIC:", "\n", "\n$$", - "\n\\text{Monthly }AF_i = Max\\left(0, 1 - \\frac{ \\text{Nominal}_i(CL)} {\\text{CDC}_i(CL) }\\right) ~.", + "\n\\text{Monthly }AF_i = Max\\left(0, 1 - \\frac{ \\text{Nominal}_i} {\\text{CDC}_i }\\right) ~.", "\n$$", "\n", "\nwhere:", "\n- $i$ denotes a monthly period;", - "\n- the nominal cash flows $\\text{Nominal}_i(CL)$ are the nominal cash flows of the coverage unit for the AoC Step **Combined Liability** (CL) (input data);", - "\n- and the corresponding cumulated discounted cash flows $\\text{CDC}_i$ are defined [above](#cumulated-discounted-cash-flows)." + "\n- the nominal pattern $\\text{Nominal}_i$ is the monthly nominal pattern provided as input data;", + "\n- $\\text{CDC}_i$ is the corresponding cumulated discounted cash flows as defined [above](#cumulated-discounted-cash-flows). The discounting factors (Locked-in, Current, Nominal or undiscounted) is controlled by the EconomicBasis parameter following Ifrs 17 standards : Locked-in for BBA, Current for VFA, Current for PAA-LIC or taken from [EconomicBasisDriver](../DataModel/DataStructure#data-node-parameters) when the choice is left to the user. ", + "\n", + "\nOccasionally, it is required to shift the relase pattern to a certain period in order to correctly compute the release. Here we allow the $\\text{Nominal}_i$ to be shifted arbitrarily. The shift is considered also in the calculationof the corresponding $\\text{CDC}_i$ term and it is controlled by the computation of the specific release (Deferral, Premium, Contractual service margin)." ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17/Utils/Extensions.ipynb b/ifrs17/Utils/Extensions.ipynb index b46442a1..41a92e0e 100644 --- a/ifrs17/Utils/Extensions.ipynb +++ b/ifrs17/Utils/Extensions.ipynb @@ -145,7 +145,7 @@ "source": [ "public static double[] Normalize(this IEnumerable source) {", "\n var norm = source?.Sum() ?? 0d;", - "\n if(Math.Abs(norm) < 10E-6)", + "\n if(Math.Abs(norm) < Precision)", "\n return Enumerable.Empty().ToArray();", "\n return source.Select(v => v / norm).ToArray();}" ], From 8d972f31c149ade248432d6680bdfab40f033d39 Mon Sep 17 00:00:00 2001 From: Davide Colleoni Date: Fri, 26 May 2023 12:22:00 +0200 Subject: [PATCH 55/55] skip according to annual cohort --- ifrs17/Import/ImportStorage.ipynb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ifrs17/Import/ImportStorage.ipynb b/ifrs17/Import/ImportStorage.ipynb index feb2bf0a..25000183 100644 --- a/ifrs17/Import/ImportStorage.ipynb +++ b/ifrs17/Import/ImportStorage.ipynb @@ -376,9 +376,11 @@ "\n double[] patternFromParameter = default;", "\n if(!SingleDataNodeParametersByGoc.TryGetValue(identity.DataNode, out var dataNodeParameterByPeriod))", "\n return (null, patternFromParameter);", - "\n ", + "\n", + "\n var annualCohort = DataNodeDataBySystemName[identity.DataNode].AnnualCohort;", + "\n var skipMonthsToCurrentReportingPeriod = MonthInAYear * (CurrentReportingPeriod.Year - annualCohort);", "\n var monthlyPattern = dataNodeParameterByPeriod[CurrentPeriod].ReleasePattern.Interpolate(dataNodeParameterByPeriod[CurrentPeriod].CashFlowPeriodicity, dataNodeParameterByPeriod[CurrentPeriod].InterpolationMethod);", - "\n return (null, Enumerable.Repeat(0d, patternShift).Concat(monthlyPattern.Normalize()).ToArray());", + "\n return (null, Enumerable.Repeat(0d, patternShift).Concat(monthlyPattern.Normalize()).Skip(skipMonthsToCurrentReportingPeriod).ToArray());", "\n }", "\n ", "\n public double GetPremiumAllocationFactor(ImportIdentity id) => ",