diff --git a/Files/DimensionsAndPartitions.csv b/Files/DimensionsAndPartitions.csv index 80f592bd..b6ad39bb 100644 --- a/Files/DimensionsAndPartitions.csv +++ b/Files/DimensionsAndPartitions.csv @@ -202,8 +202,10 @@ ISE12,Non Financial LIC Changes,ISE,23,,,,,,,, IFIE,Insurance Finance Income/Expense,PNL,24,,,,,,,, IFIE1,Financial LRC Changes,IFIE,25,,,,,,,, IFIE2,Financial LIC Changes,IFIE,26,,,,,,,, -OCI1,Financial LRC Changes,OCI,27,,,,,,,, -OCI2,Financial LIC Changes,OCI,28,,,,,,,, +IFIE3,FX Changes,IFIE,27,,,,,,,, +OCI1,Financial LRC Changes,OCI,28,,,,,,,, +OCI2,Financial LIC Changes,OCI,29,,,,,,,, +OCI3,FX Changes,OCI,30,,,,,,,, ,,,,,,,,,,, @@Profitability,,,,,,,,,,, SystemName,DisplayName,,,,,,,,,, diff --git a/Report/ReportScopes.ipynb b/Report/ReportScopes.ipynb index bc470121..ae87b53d 100644 --- a/Report/ReportScopes.ipynb +++ b/Report/ReportScopes.ipynb @@ -546,7 +546,7 @@ "\n };", "\n ", "\n private IDataCube NonFinancialFcfDeltas => FcfDeltas", - "\n .Filter((\"VariableType\", \"!IA\"), (\"VariableType\", \"!YCU\"), (\"VariableType\", \"!CRU\")); ", + "\n .Filter((\"VariableType\", \"!IA\"), (\"VariableType\", \"!YCU\"), (\"VariableType\", \"!CRU\"), (\"VariableType\", \"!FX\")); ", "\n ", "\n IDataCube FpNonFinancial => -1 * NonFinancialFcfDeltas", "\n .AggregateOver(nameof(Novelty), nameof(VariableType))", @@ -568,10 +568,20 @@ "\n FcfDeltas.Filter((\"VariableType\", AocTypes.YCU)) +", "\n FcfDeltas.Filter((\"VariableType\", AocTypes.CRU));", "\n ", + "\n IDataCube FpFx => -1 * FcfDeltas", + "\n .Filter((\"VariableType\", AocTypes.FX))", + "\n .AggregateOver(nameof(Novelty))", + "\n .SelectToDataCube(rv => rv with { Novelty = Novelties.C, VariableType = \"IFIE3\"});", + "\n ", "\n IDataCube FpFinancial => -1 * FinancialFcfDeltas", "\n .AggregateOver(nameof(Novelty), nameof(VariableType))", "\n .SelectToDataCube(rv => rv with { Novelty = Novelties.C, VariableType = variableTypeFpFinancial});", "\n", + "\n IDataCube OciFx => (FcfDeltas - CurrentFcfDeltas)", + "\n .Filter((\"VariableType\", AocTypes.FX))", + "\n .AggregateOver(nameof(Novelty))", + "\n .SelectToDataCube(rv => rv with { Novelty = Novelties.C, VariableType = \"OCI3\"});", + "\n", "\n IDataCube OciFinancial => (FcfDeltas - CurrentFcfDeltas)", "\n .AggregateOver(nameof(Novelty), nameof(VariableType))", "\n .SelectToDataCube(rv => rv with { Novelty = Novelties.C, VariableType = variableTypeOciFinancial});", @@ -616,10 +626,14 @@ "\n IDataCube Amortization => -1 * Csm.Filter((\"VariableType\", AocTypes.AM)).SelectToDataCube(v => v with { VariableType = variableType.amortization });", "\n ", "\n IDataCube NonFinancialChanges => -1 * Csm", - "\n .Filter((\"VariableType\", \"!AM\"), (\"VariableType\", \"!IA\"), (\"VariableType\", \"!YCU\"), (\"VariableType\", \"!CRU\"))", + "\n .Filter((\"VariableType\", \"!AM\"), (\"VariableType\", \"!IA\"), (\"VariableType\", \"!YCU\"), (\"VariableType\", \"!CRU\"), (\"VariableType\", \"!FX\"))", "\n .AggregateOver(nameof(Novelty), nameof(VariableType))", "\n .SelectToDataCube(v => v with { Novelty = Novelties.C, VariableType = variableType.nonFinancial });", - "\n ", + "\n", + "\n IDataCube Fx => -1 * Csm.Filter((\"VariableType\", AocTypes.FX))", + "\n .AggregateOver(nameof(Novelty))", + "\n .SelectToDataCube(v => v with { Novelty = Novelties.C, VariableType = \"IFIE3\" });", + "\n", "\n IDataCube FinancialChanges => -1 * (Csm.Filter((\"VariableType\", AocTypes.IA)) +", "\n Csm.Filter((\"VariableType\", AocTypes.YCU)) +", "\n Csm.Filter((\"VariableType\", AocTypes.CRU)) )", @@ -655,10 +669,14 @@ "\n IDataCube Amortization => -1 * Lc.Filter((\"VariableType\", AocTypes.AM)).SelectToDataCube(v => v with { VariableType = \"ISE9\" });", "\n ", "\n IDataCube NonFinancialChanges => -1 * Lc", - "\n .Filter((\"VariableType\", \"!AM\"), (\"VariableType\", \"!IA\"), (\"VariableType\", \"!YCU\"), (\"VariableType\", \"!CRU\"))", + "\n .Filter((\"VariableType\", \"!AM\"), (\"VariableType\", \"!IA\"), (\"VariableType\", \"!YCU\"), (\"VariableType\", \"!CRU\"), (\"VariableType\", \"!FX\"))", "\n .AggregateOver(nameof(Novelty), nameof(VariableType))", "\n .SelectToDataCube(v => v with { Novelty = Novelties.C, VariableType = \"ISE11\" });", "\n ", + "\n IDataCube Fx => -1 * Lc.Filter((\"VariableType\", AocTypes.FX))", + "\n .AggregateOver(nameof(Novelty))", + "\n .SelectToDataCube(v => v with { VariableType = \"IFIE3\" });", + "\n", "\n IDataCube FinancialChanges => -1 * (Lc.Filter((\"VariableType\", AocTypes.IA)) +", "\n Lc.Filter((\"VariableType\", AocTypes.YCU)) +", "\n Lc.Filter((\"VariableType\", AocTypes.CRU)) )", @@ -694,10 +712,14 @@ "\n IDataCube Amortization => -1 * Loreco.Filter((\"VariableType\", AocTypes.AM)).SelectToDataCube(v => v with { VariableType = \"ISE8\" });", "\n ", "\n IDataCube NonFinancialChanges => -1 * Loreco", - "\n .Filter((\"VariableType\", \"!AM\"), (\"VariableType\", \"!IA\"), (\"VariableType\", \"!YCU\"), (\"VariableType\", \"!CRU\"))", + "\n .Filter((\"VariableType\", \"!AM\"), (\"VariableType\", \"!IA\"), (\"VariableType\", \"!YCU\"), (\"VariableType\", \"!CRU\"), (\"VariableType\", \"!FX\"))", "\n .AggregateOver(nameof(Novelty), nameof(VariableType))", "\n .SelectToDataCube(v => v with { Novelty = Novelties.C, VariableType = \"ISE11\" });", "\n ", + "\n IDataCube Fx => -1 * Loreco.Filter((\"VariableType\", AocTypes.FX))", + "\n .AggregateOver(nameof(Novelty))", + "\n .SelectToDataCube(v => v with { VariableType = \"IFIE3\" });", + "\n", "\n IDataCube FinancialChanges => -1 * (Loreco.Filter((\"VariableType\", AocTypes.IA)) +", "\n Loreco.Filter((\"VariableType\", AocTypes.YCU)) +", "\n Loreco.Filter((\"VariableType\", AocTypes.CRU)) )", diff --git a/Test/SpecificationsFinancialPerformance.ipynb b/Test/SpecificationsFinancialPerformance.ipynb index 219121be..e52a0f5e 100644 --- a/Test/SpecificationsFinancialPerformance.ipynb +++ b/Test/SpecificationsFinancialPerformance.ipynb @@ -88,7 +88,7 @@ { "cell_type": "code", "source": [ - "var currencyType = CurrencyType.Contractual ;" + "var currencyType = CurrencyType.Functional ;" ] }, { @@ -301,7 +301,8 @@ "source": [ "var expectedDeltaFCF_nonFinancial = deltaFCF.Filter((\"VariableType\", \"!IA\"), ", "\n (\"VariableType\", \"!YCU\"), ", - "\n (\"VariableType\", \"!CRU\") ).Aggregate().Value;" + "\n (\"VariableType\", \"!CRU\"), ", + "\n (\"VariableType\", \"!FX\") ).Aggregate().Value;" ] }, { @@ -382,7 +383,63 @@ { "cell_type": "markdown", "source": [ - "### Other Comprehensive Income" + "### FX" + ] + }, + { + "cell_type": "markdown", + "source": [ + "The computed value for the FX contribution to the Fulfillment Cashflows (FCF) is" + ] + }, + { + "cell_type": "code", + "source": [ + "var computedDeltaFCF_Fx = Test.GetScopes(identities).Aggregate()", + "\n .FpFx.Filter((\"GroupOfContract\", dataNode)).Aggregate().Value;" + ] + }, + { + "cell_type": "code", + "source": [ + "computedDeltaFCF_Fx" + ] + }, + { + "cell_type": "markdown", + "source": [ + "The independent recalculation of this value reads" + ] + }, + { + "cell_type": "code", + "source": [ + "var expectedDeltaFCF_Fx = deltaFCF.Filter((\"VariableType\", \"FX\")).Aggregate().Value;" + ] + }, + { + "cell_type": "code", + "source": [ + "expectedDeltaFCF_Fx" + ] + }, + { + "cell_type": "markdown", + "source": [ + "taking the minus sign into account" + ] + }, + { + "cell_type": "code", + "source": [ + "expectedDeltaFCF_Fx.CheckEquality( -computedDeltaFCF_Fx ).Should().Be(true);" + ] + }, + { + "cell_type": "markdown", + "source": [ + "", + "\n### Other Comprehensive Income" ] }, { @@ -463,6 +520,83 @@ "expectedDeltaFCF_OCI.CheckEquality( computedDeltaFCF_OCI ).Should().Be(true);" ] }, + { + "cell_type": "markdown", + "source": [ + "### FX Other Comprehensive Income" + ] + }, + { + "cell_type": "markdown", + "source": [ + "The FX impact on the Other Comprehensive Income is calculated using the same formulas defined [above](#oci) but is presented separately in the Financial Performance.", + "\n", + "\nThe computed value for the FX contribution to the Other Comprehensive Income (OCI) is" + ] + }, + { + "cell_type": "code", + "source": [ + "var computedFxFCF_OCI = Test.GetScopes(identities).Aggregate()", + "\n .OciFx.Filter((\"GroupOfContract\", dataNode)).Aggregate().Value;" + ] + }, + { + "cell_type": "code", + "source": [ + "computedFxFCF_OCI" + ] + }, + { + "cell_type": "markdown", + "source": [ + "The OCI contribution is zero when the OCI option is disabled for the [target Group of Contract](#report).", + "\n", + "\nHere below we follow the steps to calculate independently the FX OCI contribution " + ] + }, + { + "cell_type": "code", + "source": [ + "var FxFCF_Locked = deltaFCF.Filter((\"VariableType\", AocTypes.FX)).Aggregate().Value;" + ] + }, + { + "cell_type": "code", + "source": [ + "var FxFCF_Current = FCFs_current.Filter((\"VariableType\", AocTypes.FX)).Aggregate().Value;" + ] + }, + { + "cell_type": "code", + "source": [ + "var expectedFxFCF_OCI = FxFCF_Locked - FxFCF_Current;" + ] + }, + { + "cell_type": "code", + "source": [ + "FxFCF_Locked" + ] + }, + { + "cell_type": "code", + "source": [ + "FxFCF_Current" + ] + }, + { + "cell_type": "code", + "source": [ + "expectedFxFCF_OCI" + ] + }, + { + "cell_type": "code", + "source": [ + "expectedFxFCF_OCI.CheckEquality( computedFxFCF_OCI ).Should().Be(true);" + ] + }, { "cell_type": "markdown", "source": [ @@ -528,7 +662,7 @@ { "cell_type": "code", "source": [ - "var expectedDeltaCSM_nonFinancial = deltaCSM.Filter((\"VariableType\", \"!AM\"), (\"VariableType\", \"!IA\"), (\"VariableType\", \"!YCU\"), (\"VariableType\", \"!CRU\")).Aggregate().Value;" + "var expectedDeltaCSM_nonFinancial = deltaCSM.Filter((\"VariableType\", \"!AM\"), (\"VariableType\", \"!IA\"), (\"VariableType\", \"!YCU\"), (\"VariableType\", \"!CRU\"), (\"VariableType\", \"!FX\")).Aggregate().Value;" ] }, { @@ -571,7 +705,7 @@ { "cell_type": "markdown", "source": [ - "This value can be independently computed starting from the $\\Delta\\text{CSM}$, and considering only the Interest Accretion term" + "This value can be independently computed starting from the $\\Delta\\text{CSM}$, and considering only Interest Accretion, Yield Curve Update and Credit Risk Update terms" ] }, { @@ -595,6 +729,55 @@ "expectedDeltaCSM_Financial.CheckEquality( -computedDeltaCSM_Financial ).Should().Be(true);" ] }, + { + "cell_type": "markdown", + "source": [ + "### FX" + ] + }, + { + "cell_type": "markdown", + "source": [ + "The computed value for the FX change of the CSM is" + ] + }, + { + "cell_type": "code", + "source": [ + "var computedDeltaCSM_Fx = Test.GetScopes(identities).Aggregate()", + "\n .Fx.Filter((\"GroupOfContract\", dataNode)).Aggregate().Value;" + ] + }, + { + "cell_type": "code", + "source": [ + "computedDeltaCSM_Fx" + ] + }, + { + "cell_type": "markdown", + "source": [ + "This value can be independently computed starting from the $\\Delta\\text{CSM}$, and considering only the FX term" + ] + }, + { + "cell_type": "code", + "source": [ + "var expectedDeltaCSM_Fx = deltaCSM.Filter((\"VariableType\", AocTypes.FX)).Aggregate().Value;" + ] + }, + { + "cell_type": "code", + "source": [ + "expectedDeltaCSM_Fx" + ] + }, + { + "cell_type": "code", + "source": [ + "expectedDeltaCSM_Fx.CheckEquality( -computedDeltaCSM_Fx ).Should().Be(true);" + ] + }, { "cell_type": "markdown", "source": [ @@ -654,13 +837,13 @@ { "cell_type": "markdown", "source": [ - "The non Financial contribution is calculated subtracting the Amortization and the Interest Accretion terms:" + "The non Financial contribution is calculated subtracting the Amortization, Interest Accretion, Yield Curve Update, Credit Risk Update, Fx terms:" ] }, { "cell_type": "code", "source": [ - "var expectedDeltaLC_nonFinancial = deltaLC.Filter((\"VariableType\", \"!AM\"), (\"VariableType\", \"!IA\"), (\"VariableType\", \"!YCU\"), (\"VariableType\", \"!CRU\")).Aggregate().Value;" + "var expectedDeltaLC_nonFinancial = deltaLC.Filter((\"VariableType\", \"!AM\"), (\"VariableType\", \"!IA\"), (\"VariableType\", \"!YCU\"), (\"VariableType\", \"!CRU\"), (\"VariableType\", \"!FX\")).Aggregate().Value;" ] }, { @@ -703,7 +886,7 @@ { "cell_type": "markdown", "source": [ - "This value can be independently computed starting from the $\\Delta\\text{CSM}$, and considering only the Interest Accretion term" + "This value can be independently computed starting from the $\\Delta\\text{LC}$, and considering only the Interest Accretion, Yield Curve Update, Credit Risk Update terms" ] }, { @@ -727,6 +910,55 @@ "expectedDeltaLC_Financial.CheckEquality( -computedDeltaLC_Financial ).Should().Be(true);" ] }, + { + "cell_type": "markdown", + "source": [ + "### FX" + ] + }, + { + "cell_type": "markdown", + "source": [ + "The computed value for the FX change of the LC is" + ] + }, + { + "cell_type": "code", + "source": [ + "var computedDeltaLC_Fx = Test.GetScopes(identities).Aggregate()", + "\n .Fx.Filter((\"GroupOfContract\", dataNode)).Aggregate().Value;" + ] + }, + { + "cell_type": "code", + "source": [ + "computedDeltaLC_Fx" + ] + }, + { + "cell_type": "markdown", + "source": [ + "This value can be independently computed starting from the $\\Delta\\text{LC}$, and considering only the FX term" + ] + }, + { + "cell_type": "code", + "source": [ + "var expectedDeltaLC_Fx = deltaLC.Filter((\"VariableType\", AocTypes.FX)).Aggregate().Value;" + ] + }, + { + "cell_type": "code", + "source": [ + "expectedDeltaLC_Fx" + ] + }, + { + "cell_type": "code", + "source": [ + "expectedDeltaLC_Fx.CheckEquality( -computedDeltaLC_Fx ).Should().Be(true);" + ] + }, { "cell_type": "markdown", "source": [ @@ -794,7 +1026,7 @@ { "cell_type": "code", "source": [ - "var expectedDeltaLORECO_nonFinancial = deltaLORECO.Filter((\"VariableType\", \"!AM\"), (\"VariableType\", \"!IA\"), (\"VariableType\", \"!YCU\"), (\"VariableType\", \"!CRU\")).Aggregate()?.Value?? 0;" + "var expectedDeltaLORECO_nonFinancial = deltaLORECO.Filter((\"VariableType\", \"!AM\"), (\"VariableType\", \"!IA\"), (\"VariableType\", \"!YCU\"), (\"VariableType\", \"!CRU\"), (\"VariableType\", \"!FX\")).Aggregate()?.Value?? 0;" ] }, { @@ -837,7 +1069,7 @@ { "cell_type": "markdown", "source": [ - "This value can be independently computed starting from the $\\Delta\\text{CSM}$, and considering only the Interest Accretion term" + "This value can be independently computed starting from the $\\Delta\\text{LoReCo}$, and considering only the Interest Accretion, Yield Curve Update, Credit Risk Update terms" ] }, { @@ -861,6 +1093,55 @@ "expectedDeltaLORECO_Financial.CheckEquality( -computedDeltaLORECO_Financial ).Should().Be(true);" ] }, + { + "cell_type": "markdown", + "source": [ + "### FX" + ] + }, + { + "cell_type": "markdown", + "source": [ + "The computed value for the FX change of the LoReCo is" + ] + }, + { + "cell_type": "code", + "source": [ + "var computedDeltaLORECO_Fx = Test.GetScopes(identities).Aggregate()", + "\n .Fx.Filter((\"GroupOfContract\", dataNode)).Aggregate()?.Value?? 0;" + ] + }, + { + "cell_type": "code", + "source": [ + "computedDeltaLORECO_Fx" + ] + }, + { + "cell_type": "markdown", + "source": [ + "This value can be independently computed starting from the $\\Delta\\text{LoReCo}$, and considering only the FX term" + ] + }, + { + "cell_type": "code", + "source": [ + "var expectedDeltaLORECO_Fx = deltaLORECO.Filter((\"VariableType\", AocTypes.FX)).Aggregate()?.Value?? 0;" + ] + }, + { + "cell_type": "code", + "source": [ + "expectedDeltaLORECO_Fx" + ] + }, + { + "cell_type": "code", + "source": [ + "expectedDeltaLORECO_Fx.CheckEquality( -computedDeltaLORECO_Fx ).Should().Be(true);" + ] + }, { "cell_type": "markdown", "source": [ @@ -1123,10 +1404,11 @@ "\n$$", "\n\\text{IFIE} = \\left\\{", "\n\\begin{array}{ll}", - "\n\\Delta\\text{FCF Financial} + \\Delta\\text{CSM Financial} + \\Delta\\text{LC Financial} ~~,", + "\n\\Delta\\text{FCF Financial} + \\Delta\\text{CSM Financial} + \\Delta\\text{LC Financial} + \\Delta\\text{FCF FX} + \\Delta\\text{CSM FX} + \\Delta\\text{LC FX} ~~,", "\n& \\text{for Insurance contracts} \\\\[0.2cm]", "\n\\Delta\\text{FCF Financial} + \\Delta\\text{CSM Financial} + \\Delta\\text{LC Financial} ", - "\n+ \\Delta\\text{LoReCo Financial} ~~, ", + "\n+ \\Delta\\text{LoReCo Financial} + \\Delta\\text{FCF FX} + \\Delta\\text{CSM FX} + \\Delta\\text{LC FX} ", + "\n+ \\Delta\\text{LoReCo FX} ~~, ", "\n& \\text{for Re-Insurance contracts}", "\n\\end{array}", "\n\\right.", @@ -1142,12 +1424,19 @@ "\nif(groupOfContract.Partner == null) ", "\n IFIE = - expectedDeltaFCF_Financial ", "\n - expectedDeltaCSM_Financial", - "\n - expectedDeltaLC_Financial;", + "\n - expectedDeltaLC_Financial", + "\n - expectedDeltaFCF_Fx ", + "\n - expectedDeltaCSM_Fx", + "\n - expectedDeltaLC_Fx;", "\nelse", "\n IFIE = - expectedDeltaFCF_Financial ", "\n - expectedDeltaCSM_Financial", "\n - expectedDeltaLC_Financial", - "\n - expectedDeltaLORECO_Financial;" + "\n - expectedDeltaLORECO_Financial", + "\n - expectedDeltaFCF_Fx ", + "\n - expectedDeltaCSM_Fx", + "\n - expectedDeltaLC_Fx", + "\n - expectedDeltaLORECO_Fx;" ] }, { @@ -1177,7 +1466,7 @@ { "cell_type": "code", "source": [ - "var OCI = expectedDeltaFCF_OCI;" + "var OCI = expectedDeltaFCF_OCI + expectedFxFCF_OCI;" ] }, {