diff --git a/full-ifrs17-template/Constants/Consts.ipynb b/full-ifrs17-template/Constants/CalculationEngine.ipynb
similarity index 86%
rename from full-ifrs17-template/Constants/Consts.ipynb
rename to full-ifrs17-template/Constants/CalculationEngine.ipynb
index 1ef5ee81..cf36e68d 100644
--- a/full-ifrs17-template/Constants/Consts.ipynb
+++ b/full-ifrs17-template/Constants/CalculationEngine.ipynb
@@ -18,11 +18,11 @@
{
"cell_type": "code",
"source": [
- "var projectName = \"ifrs17ce\";",
- "\nvar environmentName = \"dev\";",
+ "var projectName = \"ifrs17\";",
+ "\nvar environmentName = \"v1.0.0\";",
"\nvar notebookName = \"CalculationEngine\";",
"\nvar calculationEngine = $\"#!import \\\"//{projectName}/{environmentName}/{notebookName}\\\"\";"
]
}
]
-}
+}
\ No newline at end of file
diff --git a/full-ifrs17-template/Database/Configure.ipynb b/full-ifrs17-template/Database/Configure.ipynb
index cbe56388..44886de4 100644
--- a/full-ifrs17-template/Database/Configure.ipynb
+++ b/full-ifrs17-template/Database/Configure.ipynb
@@ -27,7 +27,7 @@
{
"cell_type": "code",
"source": [
- "#!import \"../Constants/Consts\"",
+ "#!import \"../Constants/CalculationEngine\"",
"\n#!eval calculationEngine"
]
},
diff --git a/full-ifrs17-template/Database/PersonalConnectionExample.ipynb b/full-ifrs17-template/Database/PersonalConnectionExample.ipynb
new file mode 100644
index 00000000..0bcdbdd5
--- /dev/null
+++ b/full-ifrs17-template/Database/PersonalConnectionExample.ipynb
@@ -0,0 +1,25 @@
+{
+ "metadata": {
+ "authors": [],
+ "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": "code",
+ "source": [
+ "var connectionStringMsSql = \"here enter your connection string\";"
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/full-ifrs17-template/Export/MapTemplate.ipynb b/full-ifrs17-template/Export/MapTemplate.ipynb
index af901570..0b4a1094 100644
--- a/full-ifrs17-template/Export/MapTemplate.ipynb
+++ b/full-ifrs17-template/Export/MapTemplate.ipynb
@@ -26,13 +26,17 @@
{
"cell_type": "markdown",
"source": [
- "This Notebook exports the Data nodes, states, and parameters for the target partition to a spreadsheet file which can be read, modified, and is ready to be re-imported."
+ "This notebook exports the data nodes, data node states, and data node parameters belonging to a specific data partition into an excel file.",
+ "\n
This file contains reference data used to prepopulate dropdows and validations to facilitate editing.",
+ "\n
This can be modified and imported in the calculation engine to create and modify data."
]
},
{
"cell_type": "markdown",
"source": [
- "After setting the desired target Partition, the Data present in the workspace is ready to be exported. "
+ "After setting the desired target Partition, the Data present in the workspace is ready to be exported. ",
+ "\n",
+ "\nThe default location of the exported files is the project file storage. A **download** link is generated and available for as long as the session is active. "
]
},
{
@@ -52,8 +56,8 @@
"source": [
"/* The DataSource is configured and connected to real database */",
"\n//#!eval-notebook \"../Database/Configure\"",
- "\n/* The Systemorph set of dimensions + mockdata are dispatched to the unconfigured in-memory DataSource */",
- "\n#!eval-notebook \"../Initialization/InitSystemorphBaseToMemory\""
+ "\n/* The Systemorph set of dimensions + mockdata (+ those added in the CloseImportTemplate) are dispatched to the unconfigured in-memory DataSource */",
+ "\n#!eval-notebook \"../Import/CloseImportTemplate\""
]
},
{
@@ -77,7 +81,9 @@
{
"cell_type": "markdown",
"source": [
- "# Map Template: Data Node"
+ "# Map Template: Data Node",
+ "\n",
+ "\n[DataNodes](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#data-node) defines the properties of [Portfolios](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#portfolios) and [Group of Contracts](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#group-of-contracts)."
]
},
{
@@ -89,13 +95,8 @@
{
"cell_type": "code",
"source": [
- "static var partition = new PartitionByReportingNode() { ReportingNode = \"CH\" };"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "await Workspace.Partition.SetAsync( partition );"
+ "static var partition = new PartitionByReportingNode() { ReportingNode = \"CH\" };",
+ "\nawait Workspace.Partition.SetAsync( partition );"
]
},
{
@@ -120,7 +121,9 @@
{
"cell_type": "markdown",
"source": [
- "# Map Template: Data Node State"
+ "# Map Template: Data Node State",
+ "\n",
+ "\n[Data Node State](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#data-node-state) defines whether the instance is active (used in import/output) or inactive (present in the DataSource but not used in input/output operations)."
]
},
{
@@ -132,19 +135,20 @@
{
"cell_type": "code",
"source": [
- "static var partition = new PartitionByReportingNodeAndPeriod() { ReportingNode = \"CH\", Year = 2020, Month = 12 };"
+ "static var partition = new PartitionByReportingNodeAndPeriod() { ReportingNode = \"CH\", Year = 2020, Month = 12 };",
+ "\nawait Workspace.Partition.SetAsync( new PartitionByReportingNode() { ReportingNode = partition.ReportingNode } );"
]
},
{
- "cell_type": "code",
+ "cell_type": "markdown",
"source": [
- "await Workspace.Partition.SetAsync( new PartitionByReportingNode() { ReportingNode = partition.ReportingNode } );"
+ "## Export"
]
},
{
"cell_type": "markdown",
"source": [
- "## Export"
+ "The data is retrieved for the Workspace and prepared for export."
]
},
{
@@ -158,6 +162,12 @@
"\n .ToArray();"
]
},
+ {
+ "cell_type": "markdown",
+ "source": [
+ "Export is performed."
+ ]
+ },
{
"cell_type": "code",
"source": [
@@ -172,7 +182,9 @@
{
"cell_type": "markdown",
"source": [
- "# Map Template: Data Node Parameter"
+ "# Map Template: Data Node Parameter",
+ "\n",
+ "\n[Data Node Parameters](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#data-node-parameters) are defined at the Group of Contract level and are used during the import calculation. "
]
},
{
@@ -184,19 +196,20 @@
{
"cell_type": "code",
"source": [
- "static var partition = new PartitionByReportingNodeAndPeriod() { ReportingNode = \"CH\", Year = 2020, Month = 12 };"
+ "static var partition = new PartitionByReportingNodeAndPeriod() { ReportingNode = \"CH\", Year = 2020, Month = 12 };",
+ "\nawait Workspace.Partition.SetAsync( new PartitionByReportingNode() { ReportingNode = partition.ReportingNode } );"
]
},
{
- "cell_type": "code",
+ "cell_type": "markdown",
"source": [
- "await Workspace.Partition.SetAsync( new PartitionByReportingNode() { ReportingNode = partition.ReportingNode } );"
+ "## Export"
]
},
{
"cell_type": "markdown",
"source": [
- "## Export"
+ "The data is retrieved for the Workspace and prepared for export."
]
},
{
@@ -212,6 +225,12 @@
"\n .ToArray() );"
]
},
+ {
+ "cell_type": "markdown",
+ "source": [
+ "Export is performed."
+ ]
+ },
{
"cell_type": "code",
"source": [
diff --git a/full-ifrs17-template/Files/700.DataNodes/DataNodeParameters_CH_2020_12.csv b/full-ifrs17-template/Files/DataNodes/DataNodeParameters_CH_2020_12.csv
similarity index 100%
rename from full-ifrs17-template/Files/700.DataNodes/DataNodeParameters_CH_2020_12.csv
rename to full-ifrs17-template/Files/DataNodes/DataNodeParameters_CH_2020_12.csv
diff --git a/full-ifrs17-template/Files/700.DataNodes/DataNodeStates_CH_2020_12.csv b/full-ifrs17-template/Files/DataNodes/DataNodeStates_CH_2020_12.csv
similarity index 100%
rename from full-ifrs17-template/Files/700.DataNodes/DataNodeStates_CH_2020_12.csv
rename to full-ifrs17-template/Files/DataNodes/DataNodeStates_CH_2020_12.csv
diff --git a/full-ifrs17-template/Files/700.DataNodes/DataNodes_CH.csv b/full-ifrs17-template/Files/DataNodes/DataNodes_CH.csv
similarity index 100%
rename from full-ifrs17-template/Files/700.DataNodes/DataNodes_CH.csv
rename to full-ifrs17-template/Files/DataNodes/DataNodes_CH.csv
diff --git a/full-ifrs17-template/Files/800.Parameters/CreditDefaultRate.csv b/full-ifrs17-template/Files/Parameters/CreditDefaultRate.csv
similarity index 100%
rename from full-ifrs17-template/Files/800.Parameters/CreditDefaultRate.csv
rename to full-ifrs17-template/Files/Parameters/CreditDefaultRate.csv
diff --git a/full-ifrs17-template/Files/800.Parameters/ExchangeRate.csv b/full-ifrs17-template/Files/Parameters/ExchangeRate.csv
similarity index 100%
rename from full-ifrs17-template/Files/800.Parameters/ExchangeRate.csv
rename to full-ifrs17-template/Files/Parameters/ExchangeRate.csv
diff --git a/full-ifrs17-template/Files/800.Parameters/PartnerRating.csv b/full-ifrs17-template/Files/Parameters/PartnerRating.csv
similarity index 100%
rename from full-ifrs17-template/Files/800.Parameters/PartnerRating.csv
rename to full-ifrs17-template/Files/Parameters/PartnerRating.csv
diff --git a/full-ifrs17-template/Files/800.Parameters/YieldCurve.csv b/full-ifrs17-template/Files/Parameters/YieldCurve.csv
similarity index 100%
rename from full-ifrs17-template/Files/800.Parameters/YieldCurve.csv
rename to full-ifrs17-template/Files/Parameters/YieldCurve.csv
diff --git a/full-ifrs17-template/Files/300.ReportingNodes/ReportingNodes.csv b/full-ifrs17-template/Files/ReportingNodes/ReportingNodes.csv
similarity index 100%
rename from full-ifrs17-template/Files/300.ReportingNodes/ReportingNodes.csv
rename to full-ifrs17-template/Files/ReportingNodes/ReportingNodes.csv
diff --git a/full-ifrs17-template/Files/900.TransactionalData/Actuals_CH_2020_12.csv b/full-ifrs17-template/Files/TransactionalData/Actuals_CH_2020_12.csv
similarity index 100%
rename from full-ifrs17-template/Files/900.TransactionalData/Actuals_CH_2020_12.csv
rename to full-ifrs17-template/Files/TransactionalData/Actuals_CH_2020_12.csv
diff --git a/full-ifrs17-template/Files/900.TransactionalData/Actuals_CH_2021_3.csv b/full-ifrs17-template/Files/TransactionalData/Actuals_CH_2021_3.csv
similarity index 100%
rename from full-ifrs17-template/Files/900.TransactionalData/Actuals_CH_2021_3.csv
rename to full-ifrs17-template/Files/TransactionalData/Actuals_CH_2021_3.csv
diff --git a/full-ifrs17-template/Files/900.TransactionalData/NominalCashflows_CH_2020_12.csv b/full-ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2020_12.csv
similarity index 100%
rename from full-ifrs17-template/Files/900.TransactionalData/NominalCashflows_CH_2020_12.csv
rename to full-ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2020_12.csv
diff --git a/full-ifrs17-template/Files/900.TransactionalData/NominalCashflows_CH_2021_3.csv b/full-ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2021_3.csv
similarity index 100%
rename from full-ifrs17-template/Files/900.TransactionalData/NominalCashflows_CH_2021_3.csv
rename to full-ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2021_3.csv
diff --git a/full-ifrs17-template/Files/900.TransactionalData/Openings_CH_2020_12.csv b/full-ifrs17-template/Files/TransactionalData/Openings_CH_2020_12.csv
similarity index 100%
rename from full-ifrs17-template/Files/900.TransactionalData/Openings_CH_2020_12.csv
rename to full-ifrs17-template/Files/TransactionalData/Openings_CH_2020_12.csv
diff --git a/full-ifrs17-template/Files/900.TransactionalData/SimpleValue_CH_2020_12.csv b/full-ifrs17-template/Files/TransactionalData/SimpleValue_CH_2020_12.csv
similarity index 100%
rename from full-ifrs17-template/Files/900.TransactionalData/SimpleValue_CH_2020_12.csv
rename to full-ifrs17-template/Files/TransactionalData/SimpleValue_CH_2020_12.csv
diff --git a/full-ifrs17-template/Images/SpecificationsCSM.PNG b/full-ifrs17-template/Images/SpecificationsCSM.PNG
deleted file mode 100644
index a04d351d..00000000
Binary files a/full-ifrs17-template/Images/SpecificationsCSM.PNG and /dev/null differ
diff --git a/full-ifrs17-template/Images/SpecificationsImportActuals.PNG b/full-ifrs17-template/Images/SpecificationsImportActuals.PNG
deleted file mode 100644
index 7f3d5d05..00000000
Binary files a/full-ifrs17-template/Images/SpecificationsImportActuals.PNG and /dev/null differ
diff --git a/full-ifrs17-template/Images/SpecificationsImportCashflows.PNG b/full-ifrs17-template/Images/SpecificationsImportCashflows.PNG
deleted file mode 100644
index bcb093c8..00000000
Binary files a/full-ifrs17-template/Images/SpecificationsImportCashflows.PNG and /dev/null differ
diff --git a/full-ifrs17-template/Images/SpecificationsPL.PNG b/full-ifrs17-template/Images/SpecificationsPL.PNG
deleted file mode 100644
index 2eb86dfe..00000000
Binary files a/full-ifrs17-template/Images/SpecificationsPL.PNG and /dev/null differ
diff --git a/full-ifrs17-template/Images/video1.png b/full-ifrs17-template/Images/video1.png
new file mode 100644
index 00000000..08878eac
Binary files /dev/null and b/full-ifrs17-template/Images/video1.png differ
diff --git a/full-ifrs17-template/Import/CloseImportTemplate.ipynb b/full-ifrs17-template/Import/CloseImportTemplate.ipynb
new file mode 100644
index 00000000..eae574bf
--- /dev/null
+++ b/full-ifrs17-template/Import/CloseImportTemplate.ipynb
@@ -0,0 +1,125 @@
+{
+ "metadata": {
+ "authors": [],
+ "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": [
+ " Close Imports Template
"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "All imports are triggered via the Import command. Several options can be fluently appended to customize the import action:",
+ "\n- FromFile() : accepts a string as input (eg. \"../Files/TransactionalData/Openings_CH_2020_12.csv\"). It corresponds the file to be imported complete with the path",
+ "\n- WithFormat() : accepts a string as input (eg. \"Cashflow\" or \"Actual\"). It is used to trigger the desired import logic for the current file. Full list of avalaible ImportFormat can be found [here](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/Constants/Consts#import-formats)",
+ "\n- WithFileStorage() : defined the drive from where the input files is retrieved. In this example we use the project file storage (new files have to be uploaded into the project), other options are SharePoint and OneDrive. ",
+ "\n- WithTarget() : target drive where the results are stored. In this example we use our in-memory set up",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "# Set up data and configuration",
+ "\n",
+ "\nThe data source is initialized and the whole IFRS 17 Calculation Engine code is compiled. "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "#!eval-notebook \"../Initialization/InitSystemorphToMemory\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "# DataNode and Parameters",
+ "\n",
+ "\nNew Data Nodes and Parameters are imported here.",
+ "\n
To easily generate these files, please refer to the **Map Template** files exported [here](../Export/MapTemplate). Edit them at your wish and import them back into the solution through the following cells. ",
+ "\n
For the **ImportFormat**, the following options are expected:",
+ "\n- ImportFormats.DataNode : [Portfolios](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#portfolios) and [Group of Contracts](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#group-of-contracts)",
+ "\n- ImportFormats.DataNodeState : the [state of a data node](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#data-node-state) can be either active or inactive.",
+ "\n- ImportFormats.DataNodeParameter : parameters are described [here](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#data-node-parameters). For **Group of Insurance Contracts** a default [Premium Allocation factor](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/Import/ImportScopeCalculation#experience-adjustment-on-premium) of 1 is applied if the parameter is not imported.",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "var pathToFile = \"../Files/DataNodes/DataNodes_CH.csv\";"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "var format = ImportFormats.DataNode;"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "await Import.FromFile(pathToFile).WithFormat(format).WithTarget(DataSource).ExecuteAsync()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "# Transactional Data",
+ "\n",
+ "\nTransactional data are imported here. ",
+ "\n
For the **ImportFormat**, the following options are expected:",
+ "\n- ImportFormats.Opening : for opening values in a Fair Value Approach",
+ "\n- ImportFormats.Cashflow : nominal cash flows",
+ "\n- ImportFormats.Actual : written actuals, payable and receivables. ",
+ "\n- ImportFormats.SimpleValue : direct import of pre-calculated Present Value and Actual values for all reports - no calculation is triggered -"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "var pathToFile = \"../Files/TransactionalData/Openings_CH_2020_12.csv\";"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "var format = ImportFormats.Opening;"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "await Import.FromFile(pathToFile).WithFormat(format).WithTarget(DataSource).ExecuteAsync()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "# Workspace reset"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "Workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());"
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/full-ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb b/full-ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb
index e910c089..46ba277c 100644
--- a/full-ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb
+++ b/full-ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb
@@ -29,7 +29,7 @@
{
"cell_type": "code",
"source": [
- "#!import \"../Constants/Consts\"",
+ "#!import \"../Constants/CalculationEngine\"",
"\n#!eval calculationEngine"
]
},
@@ -106,7 +106,7 @@
{
"cell_type": "code",
"source": [
- "await Import.FromFile(\"../Files/300.ReportingNodes/ReportingNodes.csv\").WithType().WithTarget(DataSource).ExecuteAsync()"
+ "await Import.FromFile(\"../Files/ReportingNodes/ReportingNodes.csv\").WithType().WithTarget(DataSource).ExecuteAsync()"
]
},
{
@@ -128,25 +128,25 @@
{
"cell_type": "code",
"source": [
- "await Import.FromFile(\"../Files/800.Parameters/YieldCurve.csv\").WithType().SnapshotMode().WithTarget(DataSource).ExecuteAsync()"
+ "await Import.FromFile(\"../Files/Parameters/YieldCurve.csv\").WithType().SnapshotMode().WithTarget(DataSource).ExecuteAsync()"
]
},
{
"cell_type": "code",
"source": [
- "await Import.FromFile(\"../Files/800.Parameters/ExchangeRate.csv\").WithType().SnapshotMode().WithTarget(DataSource).ExecuteAsync()"
+ "await Import.FromFile(\"../Files/Parameters/ExchangeRate.csv\").WithType().SnapshotMode().WithTarget(DataSource).ExecuteAsync()"
]
},
{
"cell_type": "code",
"source": [
- "await Import.FromFile(\"../Files/800.Parameters/PartnerRating.csv\").WithType().SnapshotMode().WithTarget(DataSource).ExecuteAsync()"
+ "await Import.FromFile(\"../Files/Parameters/PartnerRating.csv\").WithType().SnapshotMode().WithTarget(DataSource).ExecuteAsync()"
]
},
{
"cell_type": "code",
"source": [
- "await Import.FromFile(\"../Files/800.Parameters/CreditDefaultRate.csv\").WithType().SnapshotMode().WithTarget(DataSource).ExecuteAsync()"
+ "await Import.FromFile(\"../Files/Parameters/CreditDefaultRate.csv\").WithType().SnapshotMode().WithTarget(DataSource).ExecuteAsync()"
]
},
{
@@ -158,19 +158,19 @@
{
"cell_type": "code",
"source": [
- "await Import.FromFile(\"../Files/700.DataNodes/DataNodes_CH.csv\").WithFormat(ImportFormats.DataNode).WithTarget(DataSource).ExecuteAsync()"
+ "await Import.FromFile(\"../Files/DataNodes/DataNodes_CH.csv\").WithFormat(ImportFormats.DataNode).WithTarget(DataSource).ExecuteAsync()"
]
},
{
"cell_type": "code",
"source": [
- "await Import.FromFile(\"../Files/700.DataNodes/DataNodeStates_CH_2020_12.csv\").WithFormat(ImportFormats.DataNodeState).WithTarget(DataSource).ExecuteAsync()"
+ "await Import.FromFile(\"../Files/DataNodes/DataNodeStates_CH_2020_12.csv\").WithFormat(ImportFormats.DataNodeState).WithTarget(DataSource).ExecuteAsync()"
]
},
{
"cell_type": "code",
"source": [
- "await Import.FromFile(\"../Files/700.DataNodes/DataNodeParameters_CH_2020_12.csv\").WithFormat(ImportFormats.DataNodeParameter).WithTarget(DataSource).ExecuteAsync()"
+ "await Import.FromFile(\"../Files/DataNodes/DataNodeParameters_CH_2020_12.csv\").WithFormat(ImportFormats.DataNodeParameter).WithTarget(DataSource).ExecuteAsync()"
]
},
{
diff --git a/full-ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb b/full-ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb
index cc45633d..104f646d 100644
--- a/full-ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb
+++ b/full-ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb
@@ -84,7 +84,7 @@
{
"cell_type": "code",
"source": [
- "await Import.FromFile(\"../Files/300.ReportingNodes/ReportingNodes.csv\").WithType().WithTarget(DataSource).ExecuteAsync()"
+ "await Import.FromFile(\"../Files/ReportingNodes/ReportingNodes.csv\").WithType().WithTarget(DataSource).ExecuteAsync()"
]
},
{
@@ -106,25 +106,25 @@
{
"cell_type": "code",
"source": [
- "await Import.FromFile(\"../Files/800.Parameters/YieldCurve.csv\").WithType().SnapshotMode().WithTarget(DataSource).ExecuteAsync()"
+ "await Import.FromFile(\"../Files/Parameters/YieldCurve.csv\").WithType().SnapshotMode().WithTarget(DataSource).ExecuteAsync()"
]
},
{
"cell_type": "code",
"source": [
- "await Import.FromFile(\"../Files/800.Parameters/ExchangeRate.csv\").WithType().SnapshotMode().WithTarget(DataSource).ExecuteAsync()"
+ "await Import.FromFile(\"../Files/Parameters/ExchangeRate.csv\").WithType().SnapshotMode().WithTarget(DataSource).ExecuteAsync()"
]
},
{
"cell_type": "code",
"source": [
- "await Import.FromFile(\"../Files/800.Parameters/PartnerRating.csv\").WithType().SnapshotMode().WithTarget(DataSource).ExecuteAsync()"
+ "await Import.FromFile(\"../Files/Parameters/PartnerRating.csv\").WithType().SnapshotMode().WithTarget(DataSource).ExecuteAsync()"
]
},
{
"cell_type": "code",
"source": [
- "await Import.FromFile(\"../Files/800.Parameters/CreditDefaultRate.csv\").WithType().SnapshotMode().WithTarget(DataSource).ExecuteAsync()"
+ "await Import.FromFile(\"../Files/Parameters/CreditDefaultRate.csv\").WithType().SnapshotMode().WithTarget(DataSource).ExecuteAsync()"
]
},
{
@@ -136,19 +136,19 @@
{
"cell_type": "code",
"source": [
- "await Import.FromFile(\"../Files/700.DataNodes/DataNodes_CH.csv\").WithFormat(ImportFormats.DataNode).WithTarget(DataSource).ExecuteAsync()"
+ "await Import.FromFile(\"../Files/DataNodes/DataNodes_CH.csv\").WithFormat(ImportFormats.DataNode).WithTarget(DataSource).ExecuteAsync()"
]
},
{
"cell_type": "code",
"source": [
- "await Import.FromFile(\"../Files/700.DataNodes/DataNodeStates_CH_2020_12.csv\").WithFormat(ImportFormats.DataNodeState).WithTarget(DataSource).ExecuteAsync()"
+ "await Import.FromFile(\"../Files/DataNodes/DataNodeStates_CH_2020_12.csv\").WithFormat(ImportFormats.DataNodeState).WithTarget(DataSource).ExecuteAsync()"
]
},
{
"cell_type": "code",
"source": [
- "await Import.FromFile(\"../Files/700.DataNodes/DataNodeParameters_CH_2020_12.csv\").WithFormat(ImportFormats.DataNodeParameter).WithTarget(DataSource).ExecuteAsync()"
+ "await Import.FromFile(\"../Files/DataNodes/DataNodeParameters_CH_2020_12.csv\").WithFormat(ImportFormats.DataNodeParameter).WithTarget(DataSource).ExecuteAsync()"
]
},
{
@@ -160,31 +160,31 @@
{
"cell_type": "code",
"source": [
- "await Import.FromFile(\"../Files/900.TransactionalData/Openings_CH_2020_12.csv\").WithFormat(ImportFormats.Opening).WithTarget(DataSource).ExecuteAsync()"
+ "await Import.FromFile(\"../Files/TransactionalData/Openings_CH_2020_12.csv\").WithFormat(ImportFormats.Opening).WithTarget(DataSource).ExecuteAsync()"
]
},
{
"cell_type": "code",
"source": [
- "await Import.FromFile(\"../Files/900.TransactionalData/NominalCashflows_CH_2020_12.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()"
+ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()"
]
},
{
"cell_type": "code",
"source": [
- "await Import.FromFile(\"../Files/900.TransactionalData/Actuals_CH_2020_12.csv\").WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync()"
+ "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\").WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync()"
]
},
{
"cell_type": "code",
"source": [
- "await Import.FromFile(\"../Files/900.TransactionalData/NominalCashflows_CH_2021_3.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()"
+ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2021_3.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()"
]
},
{
"cell_type": "code",
"source": [
- "await Import.FromFile(\"../Files/900.TransactionalData/Actuals_CH_2021_3.csv\").WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync()"
+ "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2021_3.csv\").WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync()"
]
},
{
diff --git a/full-ifrs17-template/Initialization/InitSystemorphToMemory.ipynb b/full-ifrs17-template/Initialization/InitSystemorphToMemory.ipynb
index 057f5088..a96f6a66 100644
--- a/full-ifrs17-template/Initialization/InitSystemorphToMemory.ipynb
+++ b/full-ifrs17-template/Initialization/InitSystemorphToMemory.ipynb
@@ -52,37 +52,37 @@
{
"cell_type": "code",
"source": [
- "await Import.FromFile(\"../Files/900.TransactionalData/Openings_CH_2020_12.csv\").WithFormat(ImportFormats.Opening).WithTarget(DataSource).ExecuteAsync()"
+ "await Import.FromFile(\"../Files/TransactionalData/Openings_CH_2020_12.csv\").WithFormat(ImportFormats.Opening).WithTarget(DataSource).ExecuteAsync()"
]
},
{
"cell_type": "code",
"source": [
- "await Import.FromFile(\"../Files/900.TransactionalData/NominalCashflows_CH_2020_12.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()"
+ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()"
]
},
{
"cell_type": "code",
"source": [
- "await Import.FromFile(\"../Files/900.TransactionalData/Actuals_CH_2020_12.csv\").WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync()"
+ "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\").WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync()"
]
},
{
"cell_type": "code",
"source": [
- "await Import.FromFile(\"../Files/900.TransactionalData/NominalCashflows_CH_2021_3.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()"
+ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2021_3.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()"
]
},
{
"cell_type": "code",
"source": [
- "await Import.FromFile(\"../Files/900.TransactionalData/Actuals_CH_2021_3.csv\").WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync()"
+ "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2021_3.csv\").WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync()"
]
},
{
"cell_type": "code",
"source": [
- "await Import.FromFile(\"../Files/900.TransactionalData/SimpleValue_CH_2020_12.csv\").WithFormat(ImportFormats.SimpleValue ).WithTarget(DataSource).ExecuteAsync()"
+ "await Import.FromFile(\"../Files/TransactionalData/SimpleValue_CH_2020_12.csv\").WithFormat(ImportFormats.SimpleValue ).WithTarget(DataSource).ExecuteAsync()"
]
},
{
diff --git a/full-ifrs17-template/InputFormatDescription.ipynb b/full-ifrs17-template/InputFormatDescription.ipynb
index 9dd70de5..2b083f04 100644
--- a/full-ifrs17-template/InputFormatDescription.ipynb
+++ b/full-ifrs17-template/InputFormatDescription.ipynb
@@ -36,16 +36,16 @@
"source": [
"A cashflow file is named **NominalCashflows** *\\_* *\\_* *\\_* and is composed of two sections: **Main** and **Cashflow**.",
"\n",
- "\nThe **Main** section contains information such as: Reporting Node, Year, Month and Scenario for which the data is being imported. This information is used to define the [partition](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/DataModel/DataStructure#partitions) to which the data belongs.",
+ "\nThe **Main** section contains information such as: Reporting Node, Year, Month and Scenario for which the data is being imported. This information is used to define the [partition](https://portal.stage.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#partitions) to which the data belongs.",
"\n",
"\nThe **Cashflow** section contains the cash flow data. Several pieces of information are required to characterize a cash flow correctly:",
- "\n- [DataNode](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/DataModel/DataStructure#group-of-contracts) : lowest granularity of the Data Node, it is entered with its SystemName,",
- "\n- [AmountType](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/DataModel/DataStructure#amount-type) : entered with its SystemName,",
- "\n- [AocType](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/DataModel/DataStructure#aoc-type) : entered with its SystemName,",
- "\n- [Novelty](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/DataModel/DataStructure#novelty) : entered with its SystemName,",
+ "\n- [DataNode](https://portal.stage.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#group-of-contracts) : lowest granularity of the Data Node, it is entered with its SystemName,",
+ "\n- [AmountType](https://portal.stage.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#amount-type) : entered with its SystemName,",
+ "\n- [AocType](https://portal.stage.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#aoc-type) : entered with its SystemName,",
+ "\n- [Novelty](https://portal.stage.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#novelty) : entered with its SystemName,",
"\n- AccidentYear : relevant for Data Node with Liability Type: Liability for Incurred Claims.",
"\n",
- "\nAll valid combinations of AocType and Novelty can be found in [AocConfiguration](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/DataModel/DataStructure#aoc-configuration) with DataType Optional or Mandatory.",
+ "\nAll valid combinations of AocType and Novelty can be found in [AocConfiguration](https://portal.stage.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#aoc-configuration) with DataType Optional or Mandatory.",
"\n
The cash flow is entered in the columns named ValuesN where N goes from 0 to the lenght of cash flow. The Value0 corresponds to January of the Year entered in the **Main** section for every combination of AocType and Novelty. "
]
},
@@ -64,12 +64,12 @@
"source": [
"An Actuals file is named **Actuals** *\\_* *\\_* *\\_* and is composed of two sections: **Main** and **Actual**.",
"\n",
- "\nThe **Main** section contains information such as: Reporting Node, Year, Month for which the data is being imported. This information is used to define the [partition](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/DataModel/DataStructure#partition) to which the data belong.",
+ "\nThe **Main** section contains information such as: Reporting Node, Year, Month for which the data is being imported. This information is used to define the [partition](https://portal.stage.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#partition) to which the data belong.",
"\n",
"\nThe **Actual** section contains the actuals data. Several pieces of information are required to to characterize an Actuals amount correctly:",
- "\n- [DataNode](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/DataModel/DataStructure#group-of-contracts) : lowest granularity of the Data Node, it is entered with its SystemName,",
- "\n- [AocType](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/DataModel/DataStructure#aoc-type) : entered with its SystemName,",
- "\n- [ValueType](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/DataModel/DataStructure#amount-type) : corresponds to AmountType SystemName extended with the ExternalId,",
+ "\n- [DataNode](https://portal.stage.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#group-of-contracts) : lowest granularity of the Data Node, it is entered with its SystemName,",
+ "\n- [AocType](https://portal.stage.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#aoc-type) : entered with its SystemName,",
+ "\n- [ValueType](https://portal.stage.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#amount-type) : corresponds to AmountType SystemName extended with the ExternalId,",
"\n- AccidentYear : relevant for Data Node with Liability Type: Liability for Incurred Claims."
]
},
@@ -88,12 +88,12 @@
"source": [
"An Openings file is named **Openings** *\\_* *\\_* *\\_* and is composed of two sections: **Main** and **Opening**. In an AoC for one period, we only need one file with the year/month combination of the beginning of the period. Some GICs do not need any entries in Openings.",
"\n",
- "\nThe **Main** section contains information such as: Reporting Node, Year, Month for which the data is being imported. This information is used to define the [partition](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/DataModel/DataStructure#partition) to which the data belong.",
+ "\nThe **Main** section contains information such as: Reporting Node, Year, Month for which the data is being imported. This information is used to define the [partition](https://portal.stage.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#partition) to which the data belong.",
"\n",
"\nThe **Opening** section contains values at opening of an analysis. Several pieces of information are required to to characterize an Opening amount correctly:",
- "\n- [DataNode](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/DataModel/DataStructure#group-of-contracts) : lowest granularity of the Data Node, it is entered with its SystemName,",
- "\n- [EstimateType](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/DataModel/DataStructure#estimate-type) : entered with its SystemName,",
- "\n- [AmountType](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/DataModel/DataStructure#amount-type) : entered with its SystemName,",
+ "\n- [DataNode](https://portal.stage.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#group-of-contracts) : lowest granularity of the Data Node, it is entered with its SystemName,",
+ "\n- [EstimateType](https://portal.stage.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#estimate-type) : entered with its SystemName,",
+ "\n- [AmountType](https://portal.stage.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#amount-type) : entered with its SystemName,",
"\n- AccidentYear : relevant for Data Node with Liability Type: Liability for Incurred Claims."
]
}
diff --git a/full-ifrs17-template/OverviewIFRS17Template.ipynb b/full-ifrs17-template/OverviewIFRS17Template.ipynb
index 026e24e4..2475dbde 100644
--- a/full-ifrs17-template/OverviewIFRS17Template.ipynb
+++ b/full-ifrs17-template/OverviewIFRS17Template.ipynb
@@ -28,7 +28,7 @@
"source": [
"# Introduction",
"\n",
- "\nSystemorph's IFRS 17 Calculation Engine is a tool and a solution to conduct all the essential IFRS 17 calculations based on some key input: modeled future **cashflows** and actual amounts for **groups of insurance contracts** and other relevant parameters (Yield Curve, FX rates, etc...). The output is a set of calculated results (CSM, Loss Component, Financial Performance, etc...) that are needed for IFRS 17 reporting, analysis, accounting, steering and other management information.",
+ "\nSystemorph's IFRS 17 Calculation Engine is a tool and a solution to conduct all the essential IFRS 17 calculations based on some key input: modeled future **cashflows** and actual amounts for **groups of insurance contracts** and other relevant parameters (Yield Curve, FX rates, etc...). The output is a set of calculated results (Contractual Service Margin, Loss Component, Financial Performance, etc...) that are needed for IFRS 17 reporting, analysis, accounting, steering and other management information.",
"\n",
"\nSystemorph's Full IFRS 17 Template provides a complete example of input data and uses the Calculation Engine for the production of IFRS 17 results. Users can adapt this template to their own needs by changing the input data and calculating their own results.",
"\n",
@@ -43,7 +43,7 @@
"\n",
"\nIFRS 17 is a new accounting standard for insurance contracts. The previous standard IFRS 4, which is based on nominal accounting, is replaced by the economic accounting standard IFRS 17.",
"\n",
- "\nExplanatory **videos** on **IFRS 17** and a **demo application** can be found on Systemorph's website. Some key points are repeated here briefly.",
+ "\nSome key points are repeated here briefly.",
"\n",
"\nIFRS 17 deals with insurance contracts which are on the liability side of the balance sheet. Other accounting standards deal with other parts of the business, primarily IFRS 9 for invested assets.",
"\n",
@@ -70,18 +70,22 @@
{
"cell_type": "markdown",
"source": [
- "# Data input"
+ "# Data input",
+ "\n",
+ "\n"
]
},
{
"cell_type": "markdown",
"source": [
"",
- "\n## Data input: Reporting nodes, dimensions and partitions",
+ "\n## Data input: Reporting nodes, dimensions",
"\n",
- "\nSee folders *Files* (DimensionsAndPartitions) and *Files/300.ReportingNodes* (ReportingNodes).",
+ "\nSee folders *Files* (Dimensions) and *Files/ReportingNodes* (ReportingNodes).",
"\n- **ReportingNodes**: List of business units, often per country, with system name and display name, currency and \"G\" for the whole group",
- "\n- **DimensionsAndPartitions**: The many dimensions (21) required to characterize all of the data and results, with system names and display names. This information is quite stable, but some information related to partitions refers to the reporting nodes "
+ "\n$$",
+ "\n$$",
+ "\n- **Dimensions**: The many dimensions required to characterize all of the data and results, with system names and display names. This information is quite stable."
]
},
{
@@ -90,9 +94,13 @@
"",
"\n## Data input: Groups of insurance and reinsurance contracts",
"\n",
- "\nSee folder Files/700.DataNodes. The information is about data nodes, that is Groups of Insurance Contracts (GICs) and Groups of Reinsurance Contracts (GRICs) and portfolios of these.",
+ "\nSee folder Files/DataNodes. The information is about data nodes, that is Groups of Insurance Contracts (GICs) and Groups of Reinsurance Contracts (GRICs) and portfolios of these.",
"\n- **DataNodes**: List of all GICs and GRICs, each with several attributes and the portfolios to which they belong; an additional attribute of GRICs being the reinsurance partner",
+ "\n$$",
+ "\n$$",
"\n- **DataNodeParameters** *\\_* *\\_* *\\_*: List of those GICs and GRICs that are actually used for the given reporting node/year/month combination with few attributes; if needed, more such files may be added for other reporting node/year/month combinations",
+ "\n$$",
+ "\n$$",
"\n- **DataNodeStates** *\\_* *\\_* *\\_*: Switching data nodes on and off, the normal state is (\"Active\") for all the GICs and GRICs of the reporting node/year/month combination; if needed, more such files may be added for other reporting node/year/month combinations"
]
},
@@ -102,10 +110,16 @@
"",
"\n## Data input: Parameters from financial markets",
"\n",
- "\nSee folder Files/800.Parameters.",
+ "\nSee folder Files/Parameters.",
"\n- **YieldCurve**: List of all yield curves to be used, for different currencies and as-of dates (year/month), using a yearly grid of interest rate maturities extending as far as needed",
+ "\n$$",
+ "\n$$",
"\n- **ExchangeRate**: List of exchange rates to be used, for different currencies and as-of dates (year/month), with a type (Spot/Average); defined as the value of 1 foreign unit expressed in the group currency of the insurance company ",
+ "\n$$",
+ "\n$$",
"\n- **CreditDefaultRate**: For relevant year/month combinations, each with a full list of all credit ratings in S&P notation with their default rate (= probabilty of default within 1 year)",
+ "\n$$",
+ "\n$$",
"\n- **PartnerRating**: For each reinsurance partner of a relevant GRIC, the rating in S&P notation with the as-of date (year/month)"
]
},
@@ -115,9 +129,13 @@
"",
"\n## Data input: Groups of insurance and reinsurance contracts",
"\n",
- "\nSee folder Files/900.TransactionalData.",
+ "\nSee folder Files/TransactionalData.",
"\n- **Actuals** *\\_* *\\_* *\\_*: List of all actual amounts for those GICs and GRICs that are used by the given reporting node/year/month combination, for different amount types, AoC types and other attributes; we need at least two such files for the two dates of the Analysis of Change",
+ "\n$$",
+ "\n$$",
"\n- **Openings** *\\_* *\\_* *\\_*: List of the opening amounts for some GICs that are used by the given reporting node. The year/month combination corresponds to the beginning of the planned Analysis of Change period, so only one such file is required. The entries are by EstimateType and AmountType.",
+ "\n$$",
+ "\n$$",
"\n- **NominalCashflows** *\\_* *\\_* *\\_*: List of all projected cash flows for those GICs and GRICs that are used by the given reporting node/year/month combination, for different amount types, AoC types, novelty types and other attributes, where the cash flow amounts are given in a regular sequence extending as far as needed; we need at least two such files for the two dates of the Analysis of Change",
"\n",
"\nThe structure of the [Actuals](./InputFormatDescription#actual), [Openings](./InputFormatDescription#opening) and [NominalCashflows](./InputFormatDescription#cashflow) files is explained in a special [notebook](./InputFormatDescription).",
@@ -128,10 +146,19 @@
{
"cell_type": "markdown",
"source": [
- "",
- "\n# Reports",
+ "# Initialization",
+ "\n",
+ "\nWith **Initialization** we refer to an automatic import of data.",
+ "\nImport of dimensions is a necessary step which occurs only once in a production application. ",
+ "\nIn the context of the present **Full IFRS 17 Template** project other data, such as data nodes and transactional data, are imported through one of the following notebooks:",
"\n",
- "\nAll the reports are produced by running a notebook such as **[Reports](./Report/Reports#report-production)**. Some information on the reporting functionality can also be found there and in the final Reports section of [OverviewIFRS17](../IFRS17/OverviewIFRS17#reports)."
+ "\n- [InitSystemorphToDatabase](./Initialization/InitSystemorphToDatabase): where a physical database is used as target data store (database)",
+ "\n$$",
+ "\n$$",
+ "\n- [InitSystemorphToMemory](./Initialization/InitSystemorphToMemory): where memory of the server hosting the application is used as target data store (in-memory). Note that, this memory is lost when connection to the server is interrupted. ",
+ "\n",
+ "\nIn the **Full IFRS 17 Template** project we always rely on the in-memory set up in order to be independet from a physical database which might not be available to every user. ",
+ "\n"
]
},
{
@@ -139,6 +166,15 @@
"source": [
""
]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "",
+ "\n# Reports",
+ "\n",
+ "\nAll the reports are produced by running a notebook such as **[Reports](./Report/Reports#report-production)**."
+ ]
}
]
}
\ No newline at end of file
diff --git a/full-ifrs17-template/README.md b/full-ifrs17-template/README.md
index 682bf0c1..3a4c25fc 100644
--- a/full-ifrs17-template/README.md
+++ b/full-ifrs17-template/README.md
@@ -1,36 +1,38 @@
-
+
+
+
-**Full IFRS 17 Template**
+Full IFRS 17 Template
-Systemorph's IFRS 17 [Calculation Engine](https://portal.systemorph.cloud/api/project/ifrs17ce/env/dev/) is a tool to conduct all the essential IFRS 17 calculations given some key figures.
+**Full IFRS 17 Template** uses our [**IFRS 17 Calculation Engine**](https://portal.systemorph.cloud/api/project/ifrs17/env/v1.0.0/) to import several use-cases and show the results.
-Systemorph's *Full IFRS 17 Template* uses our IFRS 17 Calculation Engine to import several use-cases and show the results.
+**IFRS 17 Calculation Engine** is a tool to conduct all the essential IFRS 17 calculations given some key figures.
# Get Started
-Interact with this *Full IFRS 17 Template* after having cloned the project
+Clone this project to start interacting with it.
# Supporting Material
-Check out the [video]() (this is a youtube link or the video is embedded)
+Check out our video series. You can get started here:
+[
](https://www.youtube.com/watch?v=M1B5AyYvXT8)
-Check out our IFRS 17 initiative [here](landing page)
+For more information on our IFRS 17 initiative check out our [IFRS 17 page](*landing page*).
-# Report
+For an overview of the **Full IFRS 17 Template** project refer to the [OverviewIFRS17Template](https://portal.systemorph.cloud/project/full-ifrs-17-template/env/v1.0.0/OverviewIFRS17Template)
-Check out the IFRS 17 reports computed for our use-cases [here](./Report/Reports)
+# Report
-# Testing
+Check out the IFRS 17 reports computed for our mock use-cases [here](https://portal.systemorph.cloud/project/full-ifrs-17-template/env/v1.0.0/Report/Reports).
-If you want a step by step guide into the calculation logic, please go to the "Specification" notebook you are interested in:
-- [Cashflow Calculation](./Test/SpecificationsImportCashflows)
-- [Actuals Calculation](./Test/SpecificationsImportActuals)
-- [Technical Margin Calculation](./Test/SpecificationsTechnicalMargin)
-- [Financial Performance Calculation](./Test/SpecificationsFinancialPerformance)
+Check out the our mock data set by exporting excel MapTemplates [here](https://portal.systemorph.cloud/project/full-ifrs-17-template/env/v1.0.0/Export/MapTemplate).
# Got Questions
-For support around the IFRS 17 CalculationEngine get in contact with our Community:
+For support around the IFRS 17 CalculationEngine get in contact with our [Community](). (*TODO -link to the community page(IFRS17 landing page)*)-
+
+# Contributing
+
+All work on the **Full IFRS 17 Template** happens directly on [GitHub](https://github.com/Systemorph/IFRS17CalculationEngine).
-- [Community]() -link to the community page-
-- [Evangelists]() -link to Evangelists page-
\ No newline at end of file
+This project adheres to overall [General Terms & Conditions for Systemorph Cloud]() TODO link to terms and conditions file.
\ No newline at end of file
diff --git a/full-ifrs17-template/Report/Reports.ipynb b/full-ifrs17-template/Report/Reports.ipynb
index 7528d59f..5d9ef4db 100644
--- a/full-ifrs17-template/Report/Reports.ipynb
+++ b/full-ifrs17-template/Report/Reports.ipynb
@@ -20,9 +20,8 @@
{
"cell_type": "markdown",
"source": [
- " Reports
",
- "\n",
- "\n"
+ "",
+ "\n Reports
"
]
},
{
@@ -30,7 +29,7 @@
"source": [
"For demonstration purposes we import here data for 7 *Group of Insurance Contract* (GIC) and 4 *Group of Reinsurance Contract* (GRIC) - the import is triggered in the [Set up data and configuration](#set-up-data-and-configuration).",
"\n
The imported data set consists of cashflows, actuals, and parameters for two consecutive periods (Year 2020-Quarter 4 and Year 2021-Quarter 1)",
- "\n
Input files can be found in the **File** directory. You are invited to change them or upload your own. ",
+ "\n
Input files can be found in the **File** directory. You are invited to change them or upload your own or to add new data in the [CloseImportTemplate](../Import/CloseImportTemplate) notebook. ",
"\n
For simplicity, we import the same transactional data for all GICs and GRICs. Each *Group of Contracts* produces different figures due to differences in parameters such as *Liability Type*, *Oci type* or *Premium allocation factor* to Contractual Service Margin.",
"\n",
"\nFollow the instructions below for a guided interaction with the reports."
@@ -45,7 +44,7 @@
{
"cell_type": "code",
"source": [
- "#!eval-notebook \"../Initialization/InitSystemorphToMemory\""
+ "#!eval-notebook \"../Import/CloseImportTemplate\""
]
},
{
@@ -60,7 +59,7 @@
"source": [
"# Best Estimate",
"\n",
- "\nPresent values of the [best-estimate](https://portal.systemorph.cloud/project/ifrs17ce/env/dev/Report/ReportScopes#best-estimate) future cashflows are shown here in an Analysis of Change report.",
+ "\nPresent values of the [best-estimate](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/Report/ReportScopes#best-estimate) future cashflows are shown here in an Analysis of Change report.",
"\n",
"\nThe granularity of the reported figures can be modified by changing the Column Slices options.",
"\nFor example one can add \"GroupOfContract\" to separate the contributions of the individual Group of Contracts.",
@@ -85,16 +84,18 @@
"source": [
"# Risk Adjustment",
"\n",
- "\nPresent values of the [risk adjustment](https://portal.systemorph.cloud/project/ifrs17ce/env/dev/Report/ReportScopes#risk-adjustment) future cashflows are shown here.",
+ "\nPresent values of the [risk adjustment](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/Report/ReportScopes#risk-adjustment) future cashflows are shown here.",
"\n",
- "\nFilters can be applied to report to isolate a sub-set of the data. They can be used in conjuction to the Slice options. For example, filtering **EconomicBasis** Locked-in together with a slice on the **GroupOfContract** allows to analyse the risk adjustment figures computed with the yield curve at inception for all Group of Contracts."
+ "\nThe additional ColumnSlices are added to the view as the inner column. This can dicrease the readability of the report. For example, adding the slice by \"GroupOfContract\" leaves the lock-in and current rate contributions far apart and difficult to compare. The re-order of default slices with custom slices is achieved by esplicitly add the default slice among the custom slices. In our case, you can try entering both \"GroupOfContract\" and \"EconomicBasis\" separated by a comma in the ColumnSlices."
]
},
{
"cell_type": "code",
"source": [
"var raReport = ifrs17Report.RiskAdjustments;",
- "\nraReport.ColumnSlices = new string[]{};//\"GroupOfContract\"",
+ "\nraReport.ReportingNode = \"CH\";",
+ "\nraReport.ReportingPeriod = (2021, 3);",
+ "\nraReport.ColumnSlices = new string[]{};//\"GroupOfContract\", \"EconomicBasis\"",
"\nraReport.DataFilter = null;//new [] {(\"GroupOfContract\", \"DT1.2\")};",
"\n(await raReport.ToReportAsync) with {Height = 800}"
]
@@ -104,15 +105,18 @@
"source": [
"# Written Actuals",
"\n",
- "\n[Written Actuals](https://portal.systemorph.cloud/project/ifrs17ce/env/dev/Report/ReportScopes#written-accrual-deferral) are shown here. ",
+ "\n[Written Actuals](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/Report/ReportScopes#written-accrual-deferral) are shown here. ",
"\n",
- "\nIn this case, the analysis of change view is replaced with a default slice by the **AmountTypes**. Only the amount type with non zero value are displayed. "
+ "\nIn this case, the analysis of change view is replaced with a default slice by the **AmountTypes**. Only the amount type with non zero value are displayed. ",
+ "\nFilters can be applied to report to isolate a sub-set of the data, by selecting the dimension to filter and the system value desired. For example, to investigate the contribution of a single Group of Contract the following filter can be applied: new [] {(\"GroupOfContract\", \"DT1.1\")}."
]
},
{
"cell_type": "code",
"source": [
"var writtenActualReport = ifrs17Report.WrittenActuals;",
+ "\nwrittenActualReport.ReportingNode = \"CH\";",
+ "\nwrittenActualReport.ReportingPeriod = (2021, 3);",
"\nwrittenActualReport.ColumnSlices = new string[]{};//\"GroupOfContract\"",
"\nwrittenActualReport.DataFilter = null; //new [] {(\"GroupOfContract\", \"DT1.1\")};",
"\n(await writtenActualReport.ToReportAsync) with {Height = 400}"
@@ -123,16 +127,20 @@
"source": [
"## Advance, Overdue Actuals",
"\n",
- "\nActuals payed in [Advance](https://portal.systemorph.cloud/project/ifrs17ce/env/dev/Report/ReportScopes#written-accrual-deferral)",
- "\nor [Overdue](https://portal.systemorph.cloud/project/ifrs17ce/env/dev/Report/ReportScopes#written-accrual-deferral) are shown here together in a simplified Analysis of Change. "
+ "\nActuals payed in [Advance](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/Report/ReportScopes#written-accrual-deferral)",
+ "\nor [Overdue](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/Report/ReportScopes#written-accrual-deferral) are shown here together in a simplified Analysis of Change. ",
+ "\n",
+ "\nCombining Filters and ColumnSlices facilitate the report analysis. For example, you can select \"GroupOfContract\" as column slices with a Filter on EstimateType \"AA\" to analyse the Advance Actuals for all Group of Contract. "
]
},
{
"cell_type": "code",
"source": [
"var accrualActualReport = ifrs17Report.AccrualActuals;",
+ "\naccrualActualReport.ReportingNode = \"CH\";",
+ "\naccrualActualReport.ReportingPeriod = (2021, 3);",
"\naccrualActualReport.ColumnSlices = new string[]{};//\"GroupOfContract\", \"AmountType\"",
- "\naccrualActualReport.DataFilter = null;//new [] {(\"GroupOfContract\", \"DT2.1\")};",
+ "\naccrualActualReport.DataFilter = null; //new [] {(\"EstimateType\", \"AA\")};",
"\n(await accrualActualReport.ToReportAsync) with {Height = 400}"
]
},
@@ -141,13 +149,15 @@
"source": [
"## Deferrable Actuals",
"\n",
- "\n[Deferrable Actuals](https://portal.systemorph.cloud/project/ifrs17ce/env/dev/Report/ReportScopes#written-accrual-deferral) are shown here. Amortization of the deferrable amount is computed using the Coverage Unit pattern. "
+ "\n[Deferrable Actuals](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/Report/ReportScopes#written-accrual-deferral) are shown here. Amortization of the deferrable amount is computed using the Coverage Unit pattern. "
]
},
{
"cell_type": "code",
"source": [
"var deferrableActualReport = ifrs17Report.DeferralActuals;",
+ "\ndeferrableActualReport.ReportingNode = \"CH\";",
+ "\ndeferrableActualReport.ReportingPeriod = (2021, 3);",
"\ndeferrableActualReport.ColumnSlices = new string[]{};//\"GroupOfContract\", \"AmountType\"",
"\ndeferrableActualReport.DataFilter = null;//new [] {(\"GroupOfContract\", \"DT1.1\")};",
"\n(await deferrableActualReport.ToReportAsync) with {Height = 400}"
@@ -158,14 +168,19 @@
"source": [
"# Fulfilment Cashflow",
"\n",
- "\nPresent Value of the [Fulfilment Cashflow](https://portal.systemorph.cloud/project/ifrs17ce/env/dev/Report/ReportScopes#fulfillment-cashflows) are shown here. ",
- "\n
The individual contributions from Best Estimate and Risk Adjustment can be visualized slicing by **EstimateType**"
+ "\nPresent Value of the [Fulfilment Cashflow](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/Report/ReportScopes#fulfillment-cashflows) are shown here. ",
+ "\n
The individual contributions from Best Estimate and Risk Adjustment can be visualized slicing by **EstimateType**.",
+ "\n",
+ "\nFilters can be applied to report to isolate a sub-set of the data. For example you can Filter by a specific Group of Contract using its system name using : new [] {(\"GroupOfContract\", \"DT1.1\")}.",
+ "\n"
]
},
{
"cell_type": "code",
"source": [
"var fulfillmentCashflowsReport = ifrs17Report.FulfillmentCashflows;",
+ "\nfulfillmentCashflowsReport.ReportingNode = \"CH\";",
+ "\nfulfillmentCashflowsReport.ReportingPeriod = (2021, 3);",
"\nfulfillmentCashflowsReport.ColumnSlices = new string[]{};//\"EstimateType\"",
"\nfulfillmentCashflowsReport.DataFilter = null;// new [] {(\"GroupOfContract\", \"DT1.1\")};",
"\n(await fulfillmentCashflowsReport.ToReportAsync) with {Height = 750}"
@@ -176,13 +191,15 @@
"source": [
"# Actuarial Experience Adjustment",
"\n",
- "\nA comparison between [Written Actual](#written-actual) and the Releases of the [Best Estimate](#present-value) is reported in the [Actuarial Experience Adjustment](https://portal.systemorph.cloud/project/ifrs17ce/env/dev/Report/ReportScopes#experience-adjustment)."
+ "\nA comparison between [Written Actual](#written-actual) and the Releases of the [Best Estimate](#present-value) is reported in the [Actuarial Experience Adjustment](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/Report/ReportScopes#experience-adjustment)."
]
},
{
"cell_type": "code",
"source": [
"var experienceAdjustmentsReport = ifrs17Report.ExperienceAdjustments;",
+ "\nexperienceAdjustmentsReport.ReportingNode = \"CH\";",
+ "\nexperienceAdjustmentsReport.ReportingPeriod = (2021, 3);",
"\nexperienceAdjustmentsReport.ColumnSlices = new string[]{};//\"GroupOfContract\", \"AmountType\"",
"\nexperienceAdjustmentsReport.DataFilter = null; //new [] {(\"GroupOfContract\", \"DT1.1\")};",
"\n(await experienceAdjustmentsReport.ToReportAsync) with {Height = 300}"
@@ -193,7 +210,7 @@
"source": [
"# LRC Technical Margin",
"\n",
- "\nIn the [Technical Margin](https://portal.systemorph.cloud/project/ifrs17ce/env/dev/Report/ReportScopes#technical-margin) report we present a unified view on the figures that are allocated to either Contractual Service Margin or to Loss Component. ",
+ "\nIn the [Technical Margin](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/Report/ReportScopes#technical-margin) report we present a unified view on the figures that are allocated to either Contractual Service Margin or to Loss Component. ",
"\n
The Analysis of Change is expanded with few more steps such as **Experience Adjustment** and **Amortization**."
]
},
@@ -201,6 +218,8 @@
"cell_type": "code",
"source": [
"var technicalMarginsReport = ifrs17Report.TechnicalMargins;",
+ "\ntechnicalMarginsReport.ReportingNode = \"CH\";",
+ "\ntechnicalMarginsReport.ReportingPeriod = (2021, 3);",
"\ntechnicalMarginsReport.ColumnSlices = new string[]{};//\"GroupOfContract\", \"AmountType\"",
"\ntechnicalMarginsReport.DataFilter = null; //new [] {(\"GroupOfContract\", \"DT1.1\")};",
"\n(await technicalMarginsReport.ToReportAsync) with {Height = 600}"
@@ -211,7 +230,7 @@
"source": [
"# Contractual Service Margin / Loss Component / Loss Recovery Component",
"\n",
- "\nThe Contractual Service Margin (CSM) / Loss Component (LC) / Loss Recovery Component (LR) [report](https://portal.systemorph.cloud/project/ifrs17ce/env/dev/Report/ReportScopes#technical-margin) are here shown side by side as the allocation to profit or loss is done at each step of the Analysis of Change. ",
+ "\nThe Contractual Service Margin (CSM) / Loss Component (LC) / Loss Recovery Component (LR) [report](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/Report/ReportScopes#technical-margin) are here shown side by side as the allocation to profit or loss is done at each step of the Analysis of Change. ",
"\n",
"\nA default slice by EstimateType - which distinguish between CSM, LC and LR contributions - is automatically enforced. "
]
@@ -220,6 +239,8 @@
"cell_type": "code",
"source": [
"var allocatedTechnicalMarginsReport = ifrs17Report.AllocatedTechnicalMargins;",
+ "\nallocatedTechnicalMarginsReport.ReportingNode = \"CH\";",
+ "\nallocatedTechnicalMarginsReport.ReportingPeriod = (2021, 3);",
"\nallocatedTechnicalMarginsReport.ColumnSlices = new string[]{\"GroupOfContract\", \"EstimateType\"};//\"GroupOfContract\", \"AmountType\"",
"\nallocatedTechnicalMarginsReport.DataFilter = null; //new [] {(\"GroupOfContract\", \"DT1.1\")};",
"\n(await allocatedTechnicalMarginsReport.ToReportAsync) with {Height = 700}"
@@ -228,13 +249,17 @@
{
"cell_type": "markdown",
"source": [
- "# LRC Actuarial"
+ "# LRC Actuarial",
+ "\n",
+ "\nThe [Actuarial Liability for Remaining Coverage](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/Report/ReportScopes#lrc-actuarial-actuarial-liability-for-remaining-coverage) report shows figures from Fulfilment Cashflow discounted with current yield curve, and the allocated techinical margin. "
]
},
{
"cell_type": "code",
"source": [
"var actuarialLrcReport = ifrs17Report.ActuarialLrc;",
+ "\nactuarialLrcReport.ReportingNode = \"CH\";",
+ "\nactuarialLrcReport.ReportingPeriod = (2021, 3);",
"\nactuarialLrcReport.ColumnSlices = new string[]{};//\"GroupOfContract\", \"AmountType\"",
"\nactuarialLrcReport.DataFilter = null; //new [] {(\"GroupOfContract\", \"DT1.1\")};",
"\n(await actuarialLrcReport.ToReportAsync) with {Height = 750}"
@@ -243,13 +268,17 @@
{
"cell_type": "markdown",
"source": [
- "# LRC"
+ "# LRC",
+ "\n",
+ "\nThe [Liability for Remaining Coverage](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/Report/ReportScopes#lrc-liability-for-remaining-coverage) report adds to the [Actuarial Liability for Remaining Coverage](#lrc-actuarial) the contribution of and accrual actuals. A simplified Aoc Chain is used to allow comparison of the balance change between Actuals and Present Values. "
]
},
{
"cell_type": "code",
"source": [
"var lrcReport = ifrs17Report.Lrc;",
+ "\nlrcReport.ReportingNode = \"CH\";",
+ "\nlrcReport.ReportingPeriod = (2021, 3);",
"\nlrcReport.ColumnSlices = new string[]{};//\"GroupOfContract\", \"AmountType\"",
"\nlrcReport.DataFilter = null; //new [] {(\"GroupOfContract\", \"DT1.1\")};",
"\n(await lrcReport.ToReportAsync) with {Height = 250}"
@@ -258,13 +287,17 @@
{
"cell_type": "markdown",
"source": [
- "# LIC Actuarial"
+ "# LIC Actuarial",
+ "\n",
+ "\nThe [Actuarial Liability of Incurred Claims](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/Report/ReportScopes#lic-actuarial-actuarial-liability-for-incurred-claims) report shows figures from Fulfilment Cashflow discounted with current yield curve. "
]
},
{
"cell_type": "code",
"source": [
"var actuarialLicReport = ifrs17Report.ActuarialLic;",
+ "\nactuarialLicReport.ReportingNode = \"CH\";",
+ "\nactuarialLicReport.ReportingPeriod = (2021, 3);",
"\nactuarialLicReport.ColumnSlices = new string[]{};//\"GroupOfContract\", \"AmountType\"",
"\nactuarialLicReport.DataFilter = null; //new [] {(\"GroupOfContract\", \"DT1.1\")};",
"\n(await actuarialLicReport.ToReportAsync) with {Height = 750}"
@@ -273,13 +306,17 @@
{
"cell_type": "markdown",
"source": [
- "# LIC"
+ "# LIC",
+ "\n",
+ "\nThe [Liability for Incurred Claims](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/Report/ReportScopes#lic-liability-for-incurred-claims) adds to the [Actuarial Liability for Incurred Claims](#lic-actuarial) the contribution of and accrual actuals."
]
},
{
"cell_type": "code",
"source": [
"var licReport = ifrs17Report.Lic;",
+ "\nlicReport.ReportingNode = \"CH\";",
+ "\nlicReport.ReportingPeriod = (2021, 3);",
"\nlicReport.ColumnSlices = new string[]{};//\"GroupOfContract\", \"AmountType\"",
"\nlicReport.DataFilter = null; //new [] {(\"GroupOfContract\", \"DT1.1\")};",
"\n(await licReport.ToReportAsync) with {Height = 250}"
@@ -290,6 +327,8 @@
"source": [
"# Financial Performance",
"\n",
+ "\nThe [Financial Performance](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/Report/ReportScopes#ifrs-17-financial-performance) report discloses the Change in Estimate of the IFRS 17 balance sheet items ([LRC](#lrc) and [LIC](#lic)) and the relevant incurred cashflows (Premiums, Claims, Expenses, etc...) for the given period.",
+ "\n",
"\nUse the expand and collapse buttons in the report rows to change the granularity of the figures displayed."
]
},
@@ -297,6 +336,8 @@
"cell_type": "code",
"source": [
"var financialPerformanceReport = ifrs17Report.FinancialPerformance;",
+ "\nfinancialPerformanceReport.ReportingNode = \"CH\";",
+ "\nfinancialPerformanceReport.ReportingPeriod = (2021, 3);",
"\nfinancialPerformanceReport.ColumnSlices = new string[]{};//\"GroupOfContract\"",
"\nfinancialPerformanceReport.DataFilter = null; //new [] {(\"GroupOfContract\", \"DT1.1\")};",
"\n(await financialPerformanceReport.ToReportAsync) with { Height = 900, GroupDefaultExpanded = 3}"
diff --git a/full-ifrs17-template/Test/SpecificationsFinancialPerformance.ipynb b/full-ifrs17-template/Test/SpecificationsFinancialPerformance.ipynb
deleted file mode 100644
index 60dc3809..00000000
--- a/full-ifrs17-template/Test/SpecificationsFinancialPerformance.ipynb
+++ /dev/null
@@ -1,1461 +0,0 @@
-{
- "metadata": {
- "authors": [],
- "kernelspec": {
- "display_name": "Formula Framework",
- "language": "C#",
- "name": "C#"
- },
- "language_info": {
- "file_extension": ".cs",
- "mimetype": "text/plain",
- "name": "C#"
- },
- "toc-autonumbering": "True",
- "toc-showcode": "False"
- },
- "nbformat": 4,
- "nbformat_minor": 5,
- "cells": [
- {
- "cell_type": "markdown",
- "source": [
- " Financial Performance Specifications
"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The aim of this notebook is to document the Financial Performance reporting system. The process is pictorially explained in the following flowchart. ",
- "\n",
- "\n",
- "\n
",
- "\n",
- "\nThroughout this notebook we adopt the following variable notation: we use the words *computed* vs. *expected* to differentiate the results provided by the application vs. this test notebook, respectively."
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "In the following the Dimensions, Parameters, Nominal Cashflows, and Actuals are imported from the corresponding csv files in Initialization/Systemorph/"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "#!eval-notebook \"../Initialization/InitSystemorphToMemory\""
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "---"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "# Process Data"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "",
- "\n## Current Period, Reporting Node and Currency Type"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Please select the target period (i.e. year and month) and Reporting Node based on the imported data:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var year = 2021 ;",
- "\nvar month = 3 ;",
- "\nvar reportingNode = \"CH\" ;"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "and the type of Currency among Contractual, Functional, and Group"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var currencyType = CurrencyType.Functional ;"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Import the Report definitions, initialize the Workspace and the Test Suite:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "Workspace.InitializeFrom(DataSource);"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var period = (year, month) ;",
- "\nvar reportStorage = new ReportStorage(Workspace, Report) ;",
- "\nvar Test = Scopes.ForSingleton().WithStorage(reportStorage).ToScope();"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "await reportStorage.InitializeReportIndependentCacheAsync();",
- "\nawait reportStorage.InitializeAsync(period, reportingNode, null, currencyType);"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## View list of Identities"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Based on the Cashflows imported, the list of all possible identities, i.e. combinations of valid Contractual and Functional Currencies, Liability Types, (Re)Insurance and Oci, is contructed and reported here below:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var identities = reportStorage.GetIdentities(period, reportingNode, null, currencyType);",
- "\nidentities"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "
",
- "\n",
- "\n# Report"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Please select here below the target Data Node for executing the tests below:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var dataNode = \"DT1.1\";"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The Group of Contract selected is:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var groupOfContract = (await Workspace.Query().Where(x => x.SystemName == dataNode).ToArrayAsync()).FirstOrDefault();",
- "\ngroupOfContract"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "where ",
- "\n- the **OciType** can be Default for contracts with non-zero OCI, and null otherwise, ",
- "\n- the **Liability Type** can be LRC for Liability for Remaining Coverage, and LIC for Liability of Incurred Claims,",
- "\n- the **Partner** can be null for Insurance contracts, or equal to the Partner System Name for Reinsurance contracts."
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The summary of the Financial Performance report is shown below"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "Report.ForDataCube( Test.GetScopes(identities).Aggregate().FinancialPerformance.Filter((\"GroupOfContract\", dataNode)) )",
- "\n .WithQuerySource(DataSource)",
- "\n .SliceRowsBy(\"VariableType\", \"EstimateType\")",
- "\n .SliceColumnsBy(\"Currency\", \"LiabilityType\",\"GroupOfContract\")",
- "\n .WithGridOptions( o => o.WithDefaultColumn( c => c.WithWidth(260) ) with {GroupDefaultExpanded = 3, Height = 900, OnGridReady = null} )",
- "\n .ToReport()"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "
",
- "\n",
- "\n# Inspection"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## Fulfillment Cashflows"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The Fulfillment Cashflow (FCF) corresponds to the sum of the Best Estimate [Present Value](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/Import/ImportScopeCalculation#current-and-locked) (PV) and the [Risk Adjustment](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/Import/ImportScopeCalculation#risk-adjustment) (RA), both summed over Amounty Types, and both discounted with the Locked-In curve in the BBA valuation approach:",
- "\n",
- "\n$$",
- "\n\\text{FCF}(\\text{AoC}) = \\text{PV Locked}(\\text{AoC})",
- "\n\\bigg|_{\\substack{\\text{Non Attributable} \\\\ \\text{Amount Types} \\\\ \\text{excluded}}} ",
- "\n+ \\text{RA Locked}(\\text{AoC}) ~.",
- "\n$$"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "### Non Financial"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The computed value for the non financial contribution to the FCF is"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedDeltaFCF_nonFinancial = Test.GetScopes(identities).Aggregate()",
- "\n .FpNonFinancial.Filter((\"GroupOfContract\", dataNode)).Aggregate().Value;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedDeltaFCF_nonFinancial"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "This value can be independently computed starting from the full list of FCFs"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var FCFs = Test.GetScopes(identities).Aggregate().Fcf.Filter((\"GroupOfContract\", dataNode));"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var deltaFCF = FCFs.Filter((\"VariableType\", \"!BOP\"),(\"VariableType\", \"!EOP\")) +",
- "\n FCFs.Filter((\"VariableType\", AocTypes.BOP),(\"Novelty\", Novelties.N));"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "deltaFCF.Aggregate().Value"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedDeltaFCF_nonFinancial = deltaFCF.Filter((\"VariableType\", \"!IA\"), ",
- "\n (\"VariableType\", \"!YCU\"), ",
- "\n (\"VariableType\", \"!CRU\"), ",
- "\n (\"VariableType\", \"!FX\") ).Aggregate().Value;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "expectedDeltaFCF_nonFinancial"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "For consistency, this term is taken with the minus sign"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "expectedDeltaFCF_nonFinancial.CheckEquality( -computedDeltaFCF_nonFinancial ).Should().Be(true);"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "### Financial"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Conversely, the computed value for the financial contribution to the Fulfillment Cashflows (FCF) is"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedDeltaFCF_Financial = Test.GetScopes(identities).Aggregate()",
- "\n .FpFinancial.Filter((\"GroupOfContract\", dataNode)).Aggregate().Value;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedDeltaFCF_Financial"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The independent recalculation of this value reads"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedDeltaFCF_Financial = (deltaFCF.Filter((\"VariableType\", \"IA\")) +",
- "\n deltaFCF.Filter((\"VariableType\", \"YCU\")) +",
- "\n deltaFCF.Filter((\"VariableType\", \"CRU\")) ).Aggregate().Value;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "expectedDeltaFCF_Financial"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "taking the minus sign into account"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "expectedDeltaFCF_Financial.CheckEquality( -computedDeltaFCF_Financial ).Should().Be(true);"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "### 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"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The Other Comprehensive Income (OCI) term is by definition the sum of the financial contributions not related to the insurance sector.",
- "\n",
- "\nThe Default method to compute the OCI term is by subtracting the FCF computed with the *Locked-In* rates and the FCF computed with the *Current* rates. In this way the non insurance financial volatiliy of the economic input is relegated to the OCI. "
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedDeltaFCF_OCI = Test.GetScopes(identities).Aggregate()",
- "\n .OciFinancial.Filter((\"GroupOfContract\", dataNode)).Aggregate().Value;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedDeltaFCF_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 OCI contribution "
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var DeltaFCF_Locked = deltaFCF.Aggregate().Value;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var FCFs_current = Test.GetScopes(identities).Aggregate().CurrentFcf.Filter((\"GroupOfContract\", dataNode));"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var DeltaFCF_Current = FCFs_current.Filter((\"VariableType\", \"!BOP\"),(\"VariableType\", \"!EOP\")) +",
- "\n FCFs_current.Filter((\"VariableType\", AocTypes.BOP),(\"Novelty\", Novelties.N));"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedDeltaFCF_OCI = DeltaFCF_Locked - DeltaFCF_Current.Aggregate().Value;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "DeltaFCF_Locked"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "DeltaFCF_Current.Aggregate().Value"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "expectedDeltaFCF_OCI"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "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": [
- "## Contractual Service Margin"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "### Non Financial"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The computed value for the non financial change of the CSM is"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedDeltaCSM_nonFinancial = Test.GetScopes(identities).Aggregate()",
- "\n .NonFinancialChanges.Filter((\"GroupOfContract\", dataNode)).Aggregate().Value;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedDeltaCSM_nonFinancial"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "This value can be independently computed starting from the full CSM data from which the delta can be computed:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var CSM = Test.GetScopes(identities).Aggregate().Csm.Filter((\"GroupOfContract\", dataNode));"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var deltaCSM = CSM.Filter((\"VariableType\", \"!BOP\"),(\"VariableType\", \"!EOP\")) +",
- "\n CSM.Filter((\"VariableType\", AocTypes.BOP),(\"Novelty\", Novelties.N));"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "deltaCSM.Aggregate().Value"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The non Financial contribution is calculated subtracting the Amortization and the Interest Accretion terms:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedDeltaCSM_nonFinancial = deltaCSM.Filter((\"VariableType\", \"!AM\"), (\"VariableType\", \"!IA\"), (\"VariableType\", \"!YCU\"), (\"VariableType\", \"!CRU\"), (\"VariableType\", \"!FX\")).Aggregate().Value;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "expectedDeltaCSM_nonFinancial"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "expectedDeltaCSM_nonFinancial.CheckEquality( -computedDeltaCSM_nonFinancial ).Should().Be(true);"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "### Financial"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Conversely, the computed value for the financial change of the CSM is"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedDeltaCSM_Financial = Test.GetScopes(identities).Aggregate()",
- "\n .FinancialChanges.Filter((\"GroupOfContract\", dataNode)).Aggregate().Value;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedDeltaCSM_Financial"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "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"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedDeltaCSM_Financial = ( deltaCSM.Filter((\"VariableType\", \"IA\")) +",
- "\n deltaCSM.Filter((\"VariableType\", \"YCU\")) +",
- "\n deltaCSM.Filter((\"VariableType\", \"CRU\")) )",
- "\n .Aggregate().Value;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "expectedDeltaCSM_Financial"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "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": [
- "## Loss Component"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "### Non Financial"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The computed value for the non financial change of the LC is"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedDeltaLC_nonFinancial = Test.GetScopes(identities).Aggregate()",
- "\n .NonFinancialChanges.Filter((\"GroupOfContract\", dataNode)).Aggregate().Value;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedDeltaLC_nonFinancial"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "This value can be independently computed starting from the full CSM data from which the delta can be computed:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var LC = Test.GetScopes(identities).Aggregate().Lc.Filter((\"GroupOfContract\", dataNode));"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var deltaLC = LC.Filter((\"VariableType\", \"!BOP\"),(\"VariableType\", \"!EOP\")) +",
- "\n LC.Filter((\"VariableType\", AocTypes.BOP),(\"Novelty\", Novelties.N));"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "deltaLC.Aggregate().Value"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "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\"), (\"VariableType\", \"!FX\")).Aggregate().Value;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "expectedDeltaLC_nonFinancial"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "expectedDeltaLC_nonFinancial.CheckEquality( -computedDeltaLC_nonFinancial ).Should().Be(true);"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "### Financial"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Conversely, the computed value for the financial change of the LC is"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedDeltaLC_Financial = Test.GetScopes(identities).Aggregate()",
- "\n .FinancialChanges.Filter((\"GroupOfContract\", dataNode)).Aggregate().Value;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedDeltaLC_Financial"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "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"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedDeltaLC_Financial = ( deltaLC.Filter((\"VariableType\", \"IA\")) +",
- "\n deltaLC.Filter((\"VariableType\", \"YCU\")) +",
- "\n deltaLC.Filter((\"VariableType\", \"CRU\")) )",
- "\n .Aggregate().Value;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "expectedDeltaLC_Financial"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "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": [
- "## Loss Recovery Component"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "### Non Financial"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "If the [target Group of Contract](#report) is not of type Re-Insurance, the result of the following will return null.",
- "\n",
- "\nThe computed value for the non financial change of the LoReCo is"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedDeltaLORECO_nonFinancial = Test.GetScopes(identities).Aggregate()",
- "\n .NonFinancialChanges.Filter((\"GroupOfContract\", dataNode)).Aggregate()?.Value?? 0;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedDeltaLORECO_nonFinancial"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "This value can be independently computed starting from the full LoReCo data from which the delta can be computed:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var LORECO = Test.GetScopes(identities).Aggregate().Loreco.Filter((\"GroupOfContract\", dataNode));"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var deltaLORECO = LORECO.Filter((\"VariableType\", \"!BOP\"),(\"VariableType\", \"!EOP\")) +",
- "\n LORECO.Filter((\"VariableType\", AocTypes.BOP),(\"Novelty\", Novelties.N));"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "deltaLORECO.Aggregate()?.Value?? 0"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The non Financial contribution is calculated subtracting the Amortization and the Interest Accretion terms:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedDeltaLORECO_nonFinancial = deltaLORECO.Filter((\"VariableType\", \"!AM\"), (\"VariableType\", \"!IA\"), (\"VariableType\", \"!YCU\"), (\"VariableType\", \"!CRU\"), (\"VariableType\", \"!FX\")).Aggregate()?.Value?? 0;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "expectedDeltaLORECO_nonFinancial"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "expectedDeltaLORECO_nonFinancial.CheckEquality( -computedDeltaLORECO_nonFinancial ).Should().Be(true);"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "### Financial"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Conversely, the computed value for the financial change of the LoReCo is"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedDeltaLORECO_Financial = Test.GetScopes(identities).Aggregate()",
- "\n .FinancialChanges.Filter((\"GroupOfContract\", dataNode)).Aggregate()?.Value?? 0;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedDeltaLORECO_Financial"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "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"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedDeltaLORECO_Financial = ( deltaLORECO.Filter((\"VariableType\", \"IA\")) +",
- "\n deltaLORECO.Filter((\"VariableType\", \"YCU\")) +",
- "\n deltaLORECO.Filter((\"VariableType\", \"CRU\")) )",
- "\n .Aggregate()?.Value?? 0;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "expectedDeltaLORECO_Financial"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "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": [
- "
",
- "\n",
- "\n# Reconciliation"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Based on the results calculated in Section 3, we check here the consistency of the [Financial Performance Report](#report). ",
- "\n",
- "\nFiner granular reconciliations can be performed by following the datails of how each report contributes to the Financial Performance Report. Please, refer to the [Report documentation](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/Report/ReportScopes#financial-performance) for all the details. "
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## Insurance Revenue"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The Insurance Revenue (IR) contributions vary from Insurance to Re-Insurance and depend on the Liability Type of the [target Group of Contract](#report). This can be summarized by the formulas below",
- "\n",
- "\n$$",
- "\n\\text{IR} = \\left\\{ ",
- "\n\\begin{array}{ll}",
- "\n\\Delta\\text{FCF Gross Non Financial} + \\Delta\\text{CSM Non Financial} + \\Delta\\text{CSM Release} \\\\",
- "\n+ \\text{Incurred Incoming Cashflows} + \\text{Claims ICO} + \\text{Incurred Deferrals} \\\\",
- "\n+ \\text{Exc. Experience Adjustment on Premiums} ~~,",
- "\n& \\text{for LRC Insurance contracts} \\\\[0.2cm]",
- "\n\\Delta\\text{CSM Non Financial} + \\Delta\\text{CSM Release} \\\\",
- "\n+ \\text{Incurred Incoming Cashflows} + \\text{Claims ICO} + \\text{Incurred Deferrals} ~~,",
- "\n& \\text{for LIC Insurance contracts} \\\\[0.2cm]",
- "\n\\text{Claims ICO} + \\text{Incurred Deferrals} ~~,",
- "\n& \\text{for Re-Insurance contracts}",
- "\n\\end{array}",
- "\n\\right.",
- "\n$$",
- "\n",
- "\nHere below we recompute the IR term:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedDeltaCSM_release = deltaCSM.Filter((\"VariableType\", \"AM\")).Aggregate()?.Value?? 0;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedIncurredIncomingCashflows = Test.GetScopes(identities).Aggregate().Premiums",
- "\n .Filter((\"GroupOfContract\", dataNode)).Aggregate()?.Value?? 0;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedIncurredDeferralsIr = Test.GetScopes(identities).Aggregate().AmortizationToIr",
- "\n .Filter((\"GroupOfContract\", dataNode)).Aggregate()?.Value?? 0;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedClaimsICO = Test.GetScopes(identities).Aggregate().ClaimsIcoToIr",
- "\n .Filter((\"GroupOfContract\", dataNode)).Aggregate()?.Value?? 0;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedExcExperienceAdjPremiums = Test.GetScopes(identities).Aggregate().ExperienceAdjustmentOnPremium",
- "\n .Filter((\"GroupOfContract\", dataNode)).Aggregate()?.Value?? 0;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "double IR = 0;",
- "\nif(groupOfContract.Partner == null && groupOfContract.LiabilityType == \"LRC\")",
- "\n IR = - expectedDeltaFCF_nonFinancial ",
- "\n - expectedDeltaCSM_nonFinancial ",
- "\n - expectedDeltaCSM_release ",
- "\n + expectedIncurredIncomingCashflows",
- "\n + expectedClaimsICO",
- "\n + expectedIncurredDeferralsIr",
- "\n + expectedExcExperienceAdjPremiums;",
- "\nelse if(groupOfContract.Partner == null && groupOfContract.LiabilityType == \"LIC\")",
- "\n IR = - expectedDeltaCSM_nonFinancial",
- "\n - expectedDeltaCSM_release",
- "\n + expectedIncurredIncomingCashflows",
- "\n + expectedClaimsICO",
- "\n + expectedIncurredDeferralsIr ",
- "\n + expectedExcExperienceAdjPremiums;",
- "\nelse if(groupOfContract.Partner != null)",
- "\n IR = + expectedClaimsICO",
- "\n + expectedIncurredDeferralsIr",
- "\n + expectedExcExperienceAdjPremiums;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "IR"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## Insurance Service Expenses"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Analogously, the Insurance Service Expenses (ISE) read",
- "\n",
- "\n$$",
- "\n\\text{ISE} = \\left\\{ ",
- "\n\\begin{array}{ll}",
- "\n\\Delta\\text{LC Non Financial}",
- "\n+ \\Delta\\text{LC Release}",
- "\n+ \\text{Incurred ClaimsNIC} \\\\",
- "\n+ \\text{Incurred Expenses}",
- "\n+ \\text{Incurred Commissions}",
- "\n+ \\text{Incurred Deferrals}",
- "\n& \\text{for LRC Insurance contracts} \\\\[0.2cm]",
- "\n\\Delta\\text{FCF Reinsurance Non Financial}",
- "\n+ \\Delta\\text{LC Non Financial}",
- "\n+ \\Delta\\text{LC Release}",
- "\n+ \\text{Incurred ClaimsNIC} \\\\",
- "\n+ \\text{Incurred Expenses} ",
- "\n+ \\text{Incurred Commissions}",
- "\n+ \\text{Incurred Deferrals}",
- "\n& \\text{for LIC Insurance contracts} \\\\[0.2cm]",
- "\n\\Delta\\text{FCF Reinsurance Non Financial} ",
- "\n+ \\Delta\\text{CSM Non Financial} ",
- "\n+ \\Delta\\text{CSM Release} \\\\",
- "\n+ \\Delta\\text{LC Non Financial} ",
- "\n+ \\Delta\\text{LC Release} ",
- "\n+ \\Delta\\text{LoReCo Non Financial} \\\\",
- "\n+ \\text{Incurred Incoming Cashflows} ",
- "\n+ \\text{Incurred ClaimsNIC} ",
- "\n+ \\text{Incurred Expenses} \\\\",
- "\n+ \\text{Incurred Commissions}",
- "\n+ \\text{Incurred Deferrals}",
- "\n& \\text{for Re-Insurance contracts}",
- "\n\\end{array}",
- "\n\\right.",
- "\n$$",
- "\n",
- "\nHere below we recompute the ISE term:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedDeltaLC_release = deltaLC.Filter((\"VariableType\", \"AM\")).Aggregate()?.Value?? 0;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedDeltaLoReCo_release = deltaLORECO.Filter((\"VariableType\", \"AM\")).Aggregate()?.Value?? 0;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedIncurredClaimsNIC = Test.GetScopes(identities).Aggregate().ClaimsNic",
- "\n .Filter((\"GroupOfContract\", dataNode)).Aggregate()?.Value?? 0;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedIncurredExpenses = Test.GetScopes(identities).Aggregate().Expenses",
- "\n .Filter((\"GroupOfContract\", dataNode)).Aggregate()?.Value?? 0;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedIncurredCommissions = Test.GetScopes(identities).Aggregate().Commissions",
- "\n .Filter((\"GroupOfContract\", dataNode)).Aggregate()?.Value?? 0;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedIncurredClaimsICO = Test.GetScopes(identities).Aggregate().ClaimsIcoToIse",
- "\n .Filter((\"GroupOfContract\", dataNode)).Aggregate()?.Value?? 0;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedIncurredDeferralsIse = Test.GetScopes(identities).Aggregate().AmortizationToIse",
- "\n .Filter((\"GroupOfContract\", dataNode)).Aggregate()?.Value?? 0;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "double ISE = 0;",
- "\nif(groupOfContract.Partner == null && groupOfContract.LiabilityType == \"LRC\")",
- "\n ISE = - expectedDeltaLC_nonFinancial ",
- "\n - expectedDeltaLC_release",
- "\n + expectedIncurredClaimsNIC ",
- "\n + expectedIncurredExpenses ",
- "\n + expectedIncurredClaimsICO",
- "\n + expectedIncurredCommissions",
- "\n + expectedIncurredDeferralsIse;",
- "\nelse if(groupOfContract.Partner == null && groupOfContract.LiabilityType == \"LIC\")",
- "\n ISE = - expectedDeltaFCF_nonFinancial",
- "\n - expectedDeltaLC_nonFinancial ",
- "\n - expectedDeltaLC_release",
- "\n + expectedIncurredClaimsNIC ",
- "\n + expectedIncurredExpenses ",
- "\n + expectedIncurredClaimsICO",
- "\n + expectedIncurredCommissions",
- "\n + expectedIncurredDeferralsIse;",
- "\nelse if(groupOfContract.Partner != null)",
- "\n ISE = - expectedDeltaFCF_nonFinancial",
- "\n - expectedDeltaCSM_nonFinancial",
- "\n - expectedDeltaCSM_release",
- "\n - expectedDeltaLC_nonFinancial ",
- "\n - expectedDeltaLC_release",
- "\n - expectedDeltaLoReCo_release",
- "\n + expectedIncurredIncomingCashflows",
- "\n + expectedIncurredClaimsNIC ",
- "\n + expectedIncurredExpenses ",
- "\n + expectedIncurredClaimsICO",
- "\n + expectedIncurredCommissions",
- "\n + expectedIncurredDeferralsIse;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "ISE"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## Insurance Finance Income/Expenses"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The Financial part associated to the Insurance business encompassing both the Income and Expenses is denoted IFIE from the initials marked in capital letters. The ",
- "\n",
- "\n$$",
- "\n\\text{IFIE} = \\left\\{",
- "\n\\begin{array}{ll}",
- "\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} + \\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.",
- "\n$$",
- "\n",
- "\nHere below we recompute the IFIE term:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "double IFIE = 0;",
- "\nif(groupOfContract.Partner == null) ",
- "\n IFIE = - expectedDeltaFCF_Financial ",
- "\n - expectedDeltaCSM_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 - expectedDeltaFCF_Fx ",
- "\n - expectedDeltaCSM_Fx",
- "\n - expectedDeltaLC_Fx",
- "\n - expectedDeltaLORECO_Fx;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "IFIE"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## Other Comprehensive Income"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The Other Comprehensive Income (OCI) can be non-zero only when the OCI is enabled for [target Group of Contract](#report), that is, Oci Type = Default.",
- "\n",
- "\n$$",
- "\n\\text{OCI} = \\Delta\\text{FCF} \\big|_{\\text{Locked-in}} - \\Delta\\text{FCF} \\big|_{\\text{Current}} ~~.",
- "\n$$",
- "\n",
- "\nHere below we recompute the OCI term:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var OCI = expectedDeltaFCF_OCI + expectedFxFCF_OCI;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "OCI"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- ""
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/full-ifrs17-template/Test/SpecificationsImportActuals.ipynb b/full-ifrs17-template/Test/SpecificationsImportActuals.ipynb
deleted file mode 100644
index 8993aa5c..00000000
--- a/full-ifrs17-template/Test/SpecificationsImportActuals.ipynb
+++ /dev/null
@@ -1,507 +0,0 @@
-{
- "metadata": {
- "authors": [],
- "kernelspec": {
- "display_name": "Formula Framework",
- "language": "C#",
- "name": "C#"
- },
- "language_info": {
- "file_extension": ".cs",
- "mimetype": "text/plain",
- "name": "C#"
- },
- "toc-autonumbering": "True",
- "toc-showcode": "False"
- },
- "nbformat": 4,
- "nbformat_minor": 5,
- "cells": [
- {
- "cell_type": "markdown",
- "source": [
- " Import Actuals Specifications
"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The aim of this notebook is to document the calculations taking place when importing the Actuals. For this documentation notebook the Data is imported from the corresponding csv files located in the following path Initialization/Systemorph/. The process is pictorially explained in the following flowchart. ",
- "\n",
- "\n",
- "\n
",
- "\n",
- "\nThroughout this notebook we adopt the following variable notation: we use the words *computed* vs. *expected* to differentiate the results provided by the application vs. this test notebook, respectively."
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "# Import Data"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "",
- "\n## Current Period"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Please select the target period (i.e. year and month), Reporting Node, Economic Basis, and Data Node based on the imported data:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var year = 2021 ;",
- "\nvar month = 3 ;",
- "\nvar reportingNode = \"CH\" ;",
- "\nvar economicBasis = \"L\" ;",
- "\nvar dataNode = \"DT1.1\";"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Import the Dimensions, Yield Curves and Nominal Cashflows from the corresponding csv files in Initialization/Systemorph/"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "#!eval-notebook \"../Initialization/InitSystemorphToMemory\""
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "---"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "[Setup IFRS17 Calculation Engine](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/Import/ImportScopeCalculation):"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "#!import \"SpecificationsSetup\""
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "---"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Initialization of the Test Suite: the data loaded from csv files are ready to be used by the Scopes for the calculations"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var Test = await StartCalculatorAsync(reportingNode, year, month, economicBasis, Periodicity.Quarterly, ImportFormats.Actual);"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "",
- "\n## View imported Actuals"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Here the imported Actuals from csv are visualized "
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "Test.GetStorage().GetIfrsVariables(dataNode)",
- "\n .Where(x => new string[] {EstimateTypes.A, EstimateTypes.AA, EstimateTypes.OA}.Contains(x.EstimateType))",
- "\n .Where(x => x.AocType != \"EOP\")"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "where the filter is selecting only those *estimate types* associated to the imported Actuals, hence excluding the IFRS variables calculated when [importing the cashflows](SpecificationsImportCashflows)."
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "
",
- "\n",
- "\n# Base Actuals"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The following simplified AoC Chain applies for Advance and Overdue Actuals:",
- "\n1. Beginning of Period (BOP)",
- "\n2. Cash flow (CF)",
- "\n3. Amortization (AM) ",
- "\n4. End of Period (EOP) ",
- "\n",
- "\nWe consider 4 types of Actual values, which are distinguished through their [Estimate Type](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/DataModel/DataStructure#estimate-type):",
- "\n- Actuals (A)",
- "\n- Advance Actuals (AA)",
- "\n- Overdue Actuals (OA)",
- "\n- Deferrable Actuals (DA)",
- "\n",
- "\nwith the Estimate Type's system name shown between parenthesis above.",
- "\nThey are computed by the so-called Actual Base **Scope**",
- "\n",
- "\n$$",
- "\n\\text{Actual Base} (\\text{AoC}) = \\left\\{",
- "\n\\begin{array}{cl}",
- "\n0 & \\text{if AoC step is AM,} \\\\",
- "\n\\text{Actual Base}(\\rm{BOP}) + \\text{Actual Base}(\\rm{CF}) + \\text{Actual Base}(\\rm{WO}) & \\text{if AoC step is EOP and Estimate Type is not A,} \\\\",
- "\n\\text{Imported Actual} & \\text{otherwise.}",
- "\n\\end{array}",
- "\n\\right.",
- "\n$$",
- "\n",
- "\nWe start by selecting one of the [imported Actual](#view-imported-actuals) and we pick up an available data node, novelty, and amount type. Then, we can retrieve the corresponding actual (if any) with AoC type BOP, R, and WO. ",
- "\n",
- "\nNote that the **Identity** for Actual Base contains information about the target data node, AoC type, novelty, amount type and estimate type."
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## End of Period"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The imported actuals for the AoC steps BOP, CF, and WO are:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var actualBaseBOP = Test.GetScope( (new ImportIdentity {DataNode = \"DT1.1\", AocType = \"BOP\", Novelty = \"I\" }, \"PR\", \"AA\", (int?)null) ); ",
- "\nactualBaseBOP"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var actualBaseCF = Test.GetScope( (new ImportIdentity {DataNode = \"DT1.1\", AocType = \"CF\", Novelty = \"C\" }, \"PR\", \"AA\", (int?)null) );",
- "\nactualBaseCF"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var actualBaseWO = Test.GetScope( (new ImportIdentity {DataNode = \"DT1.1\", AocType = \"WO\", Novelty = \"C\" }, \"PR\", \"AA\", (int?)null) ); ",
- "\nactualBaseWO"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Based on the imported actuals and according to the [formula above](#base-actual), the computed actual for AoC step EOP reads"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedActualBaseEOP = Test.GetScope( (new ImportIdentity {DataNode = \"DT1.1\", AocType = \"EOP\", Novelty = \"C\" }, \"PR\", \"AA\", (int?)null) ); ",
- "\ncomputedActualBaseEOP"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The computed value can be compared with the expected value"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedActualBaseEOP.Value == actualBaseBOP.Value + actualBaseCF.Value + actualBaseWO.Value"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedActualBaseEOP.Value.Should().Be( actualBaseBOP.Value + actualBaseCF.Value + actualBaseWO.Value );"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "
",
- "\n",
- "\n# Deferrable Actuals"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The Deferrable Actuals (DA) are computed as follows",
- "\n",
- "\n$$",
- "\n\\text{Deferrable Actual} (\\text{AoC}) = \\left\\{",
- "\n\\begin{array}{cl}",
- "\n\\text{Actual Base}_{\\substack{\\text{Estimate Type}=\\text{A} \\\\ \\text{Amount Type}=\\text{ACA}}} (\\text{CF})",
- "\n +\\text{Actual Base}_{\\substack{\\text{Estimate Type}=\\text{A} \\\\ \\text{Amount Type}=\\text{AEA}}} (\\text{CF}) & \\text{if AoC step is CF } \\\\",
- "\n-\\text{AMF} \\cdot \\big( \\text{Deferrable Actual}(\\rm{BOP}) + \\text{Deferrable Actual}(\\rm{CF}) \\big) & \\text{if AoC step is AM } \\\\",
- "\n\\text{Deferrable Actual}(\\rm{BOP}) + \\text{Deferrable Actual}(\\rm{CF}) + \\text{Deferrable Actual}(\\rm{AM}) & \\text{if AoC step is EOP } \\\\",
- "\n\\text{Input Actual}_{\\text{Estimate Type}=\\text{DA}} (\\text{BOP}) & \\text{if AoC step is BOP } \\\\",
- "\n\\end{array}",
- "\n\\right.",
- "\n$$",
- "\n",
- "\nwhere ACA and AEA are *Aquisition* Amount Types from *Attributable Commission* and *Attributable Expenses*, respectively.",
- "\n",
- "\nNote that the **Identity** of Deferrable Actual is encompassing solely data node, Aoc type, and novelty."
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## Beginning of Period"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedDeferrableActualBOP = Test.GetScope( new ImportIdentity {DataNode = \"DT1.1\", AocType = \"BOP\", Novelty = \"I\" } );",
- "\ncomputedDeferrableActualBOP"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The deferrable Actual for the AoC step being BOP is simply the EOP Actual of the previous period. In fact, if the latter exists among the [imported Actuals](#view-imported-actuals), it is reported here below as the BOP of the current period:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedDeferrableActualBOP = Test.GetStorage().GetValue(new ImportIdentity {DataNode = \"DT1.1\", AocType = \"BOP\", Novelty = \"I\" }, (string)null, EstimateTypes.DA, (int?)null);",
- "\nexpectedDeferrableActualBOP"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The expected value is compared with the computed result: "
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedDeferrableActualBOP.Value == expectedDeferrableActualBOP"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedDeferrableActualBOP.Value.Should().Be(expectedDeferrableActualBOP);"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## Cash flow"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedDeferrableActualCF = Test.GetScope( new ImportIdentity {DataNode = \"DT1.1\", AocType = \"CF\", Novelty = \"C\" } );",
- "\ncomputedDeferrableActualCF"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The deferrable Actual for the AoC step being CF is the sum of the base Actuals with Amount Type ACA and AEA:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var actualBaseAEA = Test.GetScope( (new ImportIdentity {DataNode = \"DT1.1\", AocType = \"CF\", Novelty = \"C\" }, \"AEA\", \"A\", (int?)null) );",
- "\nactualBaseAEA"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var actualBaseACA = Test.GetScope( (new ImportIdentity {DataNode = \"DT1.1\", AocType = \"CF\", Novelty = \"C\" }, \"ACA\", \"A\", (int?)null) );",
- "\nactualBaseACA"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedDeferrableActualCF = actualBaseAEA.Value + actualBaseACA.Value;",
- "\nexpectedDeferrableActualCF"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The expected value is compared with the computed result: "
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedDeferrableActualCF.Value == expectedDeferrableActualCF"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedDeferrableActualCF.Value.Should().Be(expectedDeferrableActualCF);"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## Amortization"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedDeferrableActualAM = Test.GetScope( new ImportIdentity {DataNode = \"DT1.1\", AocType = \"AM\", Novelty = \"C\" } );",
- "\ncomputedDeferrableActualAM"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The deferrable Actual for the AoC step being AM is the sum of the deferrable Actuals for AoC step BOP and CF multiplied by the current period amortization factor:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var currentPeriodAmortizationFactor = Test.GetScope( new ImportIdentity {DataNode = \"DT1.1\", AocType = \"AM\", Novelty = \"C\" } );",
- "\ncurrentPeriodAmortizationFactor"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "Test.GetStorage().GetValue(new ImportIdentity {DataNode = \"DT1.1\", AocType = \"AM\", Novelty = \"C\" }, (string)null, \"F\", \"L\", (int?)null)"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedDeferrableActualAM = -currentPeriodAmortizationFactor.Value * (expectedDeferrableActualBOP + expectedDeferrableActualCF);",
- "\nexpectedDeferrableActualAM"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The expected value is compared with the computed result: "
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedDeferrableActualAM.Value == expectedDeferrableActualAM"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedDeferrableActualAM.Value.Should().Be( expectedDeferrableActualAM );"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## End of Period"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedDeferrableActualEOP = Test.GetScope( new ImportIdentity {DataNode = \"DT1.1\", AocType = \"EOP\", Novelty = \"C\" } );",
- "\ncomputedDeferrableActualEOP"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The deferrable Actual for the AoC step being EOP is the sum of the deferrable Actuals for AoC step BOP, CF, and AM:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var deferrableActualBOP = Test.GetScope( new ImportIdentity {DataNode = \"DT1.1\", AocType = \"BOP\", Novelty = \"I\" } );",
- "\ndeferrableActualBOP"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var deferrableActualCF = Test.GetScope( new ImportIdentity {DataNode = \"DT1.1\", AocType = \"CF\", Novelty = \"C\" } );",
- "\ndeferrableActualCF"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var deferrableActualAM = Test.GetScope( new ImportIdentity {DataNode = \"DT1.1\", AocType = \"AM\", Novelty = \"C\" } );",
- "\ndeferrableActualAM"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedDeferrableActualEOP = deferrableActualBOP.Value + deferrableActualCF.Value + deferrableActualAM.Value;",
- "\nexpectedDeferrableActualEOP"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The expected value is compared with the computed result: "
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedDeferrableActualEOP.Value == expectedDeferrableActualEOP"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedDeferrableActualEOP.Value.Should().Be(expectedDeferrableActualEOP);"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- ""
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/full-ifrs17-template/Test/SpecificationsImportCashflows.ipynb b/full-ifrs17-template/Test/SpecificationsImportCashflows.ipynb
deleted file mode 100644
index 899f899d..00000000
--- a/full-ifrs17-template/Test/SpecificationsImportCashflows.ipynb
+++ /dev/null
@@ -1,2005 +0,0 @@
-{
- "metadata": {
- "authors": [],
- "kernelspec": {
- "display_name": "Formula Framework",
- "language": "C#",
- "name": "C#"
- },
- "language_info": {
- "file_extension": ".cs",
- "mimetype": "text/plain",
- "name": "C#"
- },
- "toc-autonumbering": "True",
- "toc-showcode": "False",
- "toc-showmarkdowntxt": "False",
- "toc-showtags": "False"
- },
- "nbformat": 4,
- "nbformat_minor": 5,
- "cells": [
- {
- "cell_type": "markdown",
- "source": [
- " Import Cashflows Specifications
"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The aim of this notebook is to document the calculation of the Present Values and Amortization Factors starting from the nominal Cashflows and the Yearly Yield Curve. These starting data is imported from the corresponding csv files located in the following path Initialization/Systemorph/. The process is pictorially explained in the following flowchart. ",
- "\n",
- "\n",
- "\n
",
- "\n",
- "\nThroughout this notebook we adopt the following variable notation: we use the words *computed* vs. *expected* to differentiate the results provided by the application vs. this test notebook, respectively."
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "# Import Data"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "",
- "\n## Current Period"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Please select the target period (i.e. year and month), Reporting Node, Economic Basis, and Data Node based on the imported data:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var year = 2021 ;",
- "\nvar month = 3 ;",
- "\nvar reportingNode = \"CH\" ;",
- "\nvar economicBasis = \"C\" ;"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Import the Dimensions, Yield Curves and Nominal Cashflows from the corresponding csv files in Initialization/Systemorph/"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "#!eval-notebook \"../Initialization/InitSystemorphBaseToMemory\""
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "Workspace.InitializeFrom(DataSource);"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "---"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "[Setup IFRS17 Calculation Engine](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/Import/ImportScopeCalculation):"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "#!import \"SpecificationsSetup\""
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "---"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "At this point reference data are loaded. Import now a cashfow file with a 720 elements."
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var groupOfContract = \"GricComplex\";",
- "\nawait Import.FromFile(\"Data/CashflowComplex.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Initialization of the Test suite: the data loaded from csv files are ready to be used by the Scopes for the calculations"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var Test = await StartCalculatorAsync(reportingNode, year, month, economicBasis, Periodicity.Quarterly, ImportFormats.Cashflow);"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "",
- "\n## View loaded Data Nodes"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The imported active Data Nodes from Initialization/Systemorph/DataNodes.csv are "
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "Test.GetStorage().DataNodeDataBySystemName"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "",
- "\n## View loaded Yearly Yield Curve"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Here the correct Yield Curve is chosen among those imported from Initialization/Systemorph/Data.csv according to the [current period](#year-and-period) and the Aoc Step according the [Aoc Configuration](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/DataModel/DataStructure#aoc-configuration). In the following we retrieve the desired identity."
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var aocType = \"CL\";",
- "\nvar novelty = \"C\";"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var id = Test.GetIdentity(groupOfContract, aocType, novelty);"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var yearlyYieldCurve = Test.GetStorage().GetYearlyYieldCurve(id, economicBasis);"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "yearlyYieldCurve"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "",
- "\n## View loaded Nominal Cashflows"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The nominal Cashflows for the current period are loaded together with last period Cashflows for Group of Contract that were already existent. ",
- "\n",
- "\nThe relative files are located in: Files/.",
- "\n",
- "\nThe result is showed in the following list to be compared with the entries of the csv files"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "Test.GetStorage().GetRawVariables(groupOfContract)"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "
",
- "\n",
- "\n# Interest and Discount Rates"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The Yield Curve ${\\text{YC}_i}$ associated to the the [selected period](#year-and-period) and target currency of the Group of Contract Reporting Node is [displayed above](#view-loaded-yearly-yield-curve) and used in this section to calculate the Interest and Discount factors",
- "\n",
- "\n$$",
- "\n\\text{Interest}_i = \\big( 1 + \\text{YC}_i \\big) ^{\\frac{1}{12}} ~,",
- "\n$$",
- "\n",
- "\nand",
- "\n",
- "\n$$",
- "\n\\text{Discount}_i = \\big( 1 + \\text{YC}_i \\big) ^{-\\frac{1}{12}} ~.",
- "\n$$"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "In the Scope named *MonthlyRate* the Interest and Discount factors are computed"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedMonthlyRates = Test.GetScope( id );"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedMonthlyRates"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## Interest"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "In the following, the Interest factors computed by the application are recalculated independently according to the formula above in two different ways"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedInterest = yearlyYieldCurve.Select( yc => Math.Pow(1 + yc, 1.0 / 12.0) );",
- "\nexpectedInterest"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "from yc in yearlyYieldCurve select Math.Pow(1 + yc, 1.0 / 12.0)"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedMonthlyRates.Interest.CheckEquality( expectedInterest ).Should().Be(true);"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## Discount"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The following recalculates the Discount factors to be compared with the computed values"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedDiscount = yearlyYieldCurve.Select( yc => Math.Pow(1 + yc, -1.0 / 12.0) );",
- "\nexpectedDiscount"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedMonthlyRates.Discount.CheckEquality( expectedDiscount ).Should().Be(true);"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## Test method: Get Valid Element"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Given the present Yield Curve array has finite *length*, the extrapolation implemented is taking the last element for all successive years. This behavior is given by the function *GetValidElement*. The test in this section assures that constant extrapolation is taken for *index* > *length*"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "expectedDiscount.GetValidElement( 120 )"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "expectedDiscount.GetValidElement( 120 ).Should().Be( expectedDiscount.Last() );"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "
",
- "\n# Cashflows"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "This section deals with the calculation of the *Cumulated Discounted Cashflows* (CDC) starting from the nominal Cashflows. "
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## Choose identity"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Each loaded nominal Cashflows is assigned to a so-called *Identity* which uniquely identifies it based on the *Data Node*, *Aoc Type*, and *Novelty*. In the following cells we retrieve the desired Identity:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var aocType = \"CL\";",
- "\nvar novelty = \"C\";"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var id = Test.GetIdentity(groupOfContract, aocType, novelty);"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "",
- "\n## Nominal Cashflow"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Consider the two Amount Type *PR* and *NIC*, with Transaction Period being *Beginning of Period* (BOP) and *End of Period* (EOP), respectively. The corresponding nominal Cashflows are deposited in the Scopes named *NominalCashflow* with the Identity provided above, Calculation Type *BE*, and the aforementioned Amount Types. These nominal Cashflows correspond with those [loaded from the csv files](#view-loaded-nominal-cashflows). "
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var amountTypePR = \"PR\";",
- "\nvar amountTypeNIC = \"NIC\";",
- "\nvar estimateType = \"BE\";",
- "\nvar accidentYear = (int?)null;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var nominalPR = Test.GetScope((id, amountTypePR, estimateType, accidentYear));"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "nominalPR"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var nominalNIC = Test.GetScope((id, amountTypeNIC, estimateType, accidentYear));"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "nominalNIC"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "",
- "\n## Cumulated Discounted Cashflow"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The CDC is defined by the following recursive formulas",
- "\n",
- "\n$$",
- "\n\\text{CDC}_t = \\left\\{",
- "\n\\begin{array}{cl}",
- "\n\\text{Nominal}_t + \\text{CDC}_{t+1} \\cdot {\\text{Valid Discount}_{\\frac{t}{12}}} ~, & \\text{if Transaction Period is Beginning of Period} \\\\",
- "\n\\big( \\text{Nominal}_t + \\text{CDC}_{t+1} \\big) \\cdot {\\text{Valid Discount}_{\\frac{t}{12}}} ~, & \\text{if Transaction Period is End of Period}",
- "\n\\end{array}",
- "\n\\right.",
- "\n$$",
- "\n",
- "\nwhere the Transaction Period depends on the given cashflow Amount Type. "
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "### Beginning of Period"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The Amount Type **Premiums** (PR) has Transaction Period **Beginning of Period** (BOP). The corresponding CDC calculated by the application is"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedDiscountedPR = Test.GetScope((id, amountTypePR, estimateType, accidentYear));"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedDiscountedPR"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "In the following cell we independently evaluate the expected discounted cashflow according to the formula above:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedDiscountedPR = new double[nominalPR.Values.Length];",
- "\n",
- "\nEnumerable.Range(0, nominalPR.Values.Length).Reverse()",
- "\n .ForEach( i => expectedDiscountedPR[i] = nominalPR.Values[i] + expectedDiscountedPR.GetValidElement(i+1) * expectedDiscount.GetValidElement(i/12) );",
- "\n",
- "\nexpectedDiscountedPR = Multiply(-1d, expectedDiscountedPR); // we need a reserve view for comparison"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "expectedDiscountedPR"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "(nominalPR.Values, nominalPR.Values.Length)"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The expected cumulated discount is compared with the computed values"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedDiscountedPR.Values.CheckEquality( expectedDiscountedPR )"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedDiscountedPR.Values.CheckEquality( expectedDiscountedPR ).Should().Be(true);"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "### End Of Period"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The Amount Type **Non Investment Component** (NIC) has Transaction Period **End of Period** (EOP). The corresponding CDC calculated by the application is"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedDiscountedNIC = Test.GetScope((id, amountTypeNIC, estimateType, accidentYear));"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedDiscountedNIC"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "In the following cell we independently evaluate the expected discounted cashflow according to the formula above:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedDiscountedNIC = new double[nominalNIC.Values.Length];",
- "\n",
- "\nEnumerable.Range(0, nominalNIC.Values.Length).Reverse()",
- "\n .ForEach( i => expectedDiscountedNIC[i] = ( nominalNIC.Values[i] + expectedDiscountedNIC.GetValidElement(i+1) ) * expectedDiscount.GetValidElement(i/12) );",
- "\n",
- "\nexpectedDiscountedNIC = Multiply(-1d, expectedDiscountedNIC); // we need a reserve view for comparison"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "expectedDiscountedNIC"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The expected cumulated discount is compared with the computed values"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedDiscountedNIC.Values.CheckEquality( expectedDiscountedNIC )"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedDiscountedNIC.Values.CheckEquality( expectedDiscountedNIC ).Should().Be(true);"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "",
- "\n## Non Performance Risk Adjustment"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "In this section we treat the determination of the non-performance risk adjustment, an element offsetting partially future",
- "\nclaims according to the risk that the reinsurance company cannot fulfil the full extent of its obligations.",
- "\n",
- "\nFirstly, the discounting recursive relation can be written explicitly as",
- "\n",
- "\n$$",
- "\n\\begin{array}{l}",
- "\n\\text{CDC}_t = \\big( \\text{Nominal}_t + \\text{CDC}_{t+1} \\big) \\cdot {\\text{Valid Discount}_{\\frac{t}{12}}} \\\\",
- "\n\\Rightarrow \\text{CDC}_t = \\sum_{\\tau=t} \\big( \\text{Valid Discount}_{\\frac{t}{12}} \\big)^{\\tau-t+1} \\cdot \\text{Nominal}_\\tau ",
- "\n\\end{array}",
- "\n$$",
- "\n",
- "\nFor nominal Cashflows with Amount Type being *Claims*, the risk-adjusted Cumulated Discounted Cashflow ",
- "\nis assigned the Amount Type **Credit Default Risk** (CDR), ",
- "\nand is obtained by multiplying the right hand side of the latter formula by the corresponding risk factor",
- "\n",
- "\n$$",
- "\n\\text{CDC}_t^{\\text{Amount Type}=\\text{CDR}} = \\sum_{\\tau=t} \\big( \\text{Valid Discount}_{\\frac{t}{12}} \\big)^{\\tau-t+1} \\cdot \\text{Nominal}_\\tau^{\\text{Claim}} \\cdot \\big( e^{-\\gamma(\\tau-t)} -1 \\big)",
- "\n$$",
- "\n",
- "\nwhere $\\gamma$ is the assumed non-performance probability of the reinsurer to be provided as an [input parameter](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/DataModel/DataStructure#credit-default-rate).",
- "\n",
- "\nThis rate is constant for the whole projection period, that is, $\\gamma$ is not a function of $t$. ",
- "\nIt effectively amounts to a constant increase in the continuous discount rate by $\\gamma$. "
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "### Explicit vs recursive formula"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The explicit formula is tested versus the expected result obtained with the recursive formula"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedDiscountedNICbis = new double[nominalNIC.Values.Length];",
- "\n",
- "\n//for(int t = 0; t < 12; t++)",
- "\n// for(int tau = t; tau < 12; tau++)",
- "\n// expectedDiscountedNICbis[t] += nominalNIC.Values[tau] * Math.Pow(expectedDiscount.GetValidElement(t/12), tau-t+1);",
- "\n",
- "\nEnumerable.Range(0, nominalNIC.Values.Length)",
- "\n .ForEach( i => expectedDiscountedNICbis[i] = ",
- "\n Enumerable.Range(i, nominalNIC.Values.Length-i).Select( tau => nominalNIC.Values[tau] * Math.Pow(expectedDiscount.GetValidElement(i/12), tau-i+1) ).Sum() );",
- "\n ",
- "\nexpectedDiscountedNIC.CheckEquality( expectedDiscountedNICbis )"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "### Risk Adjusted Claims "
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The computed CDC with Amount Type being CDR reads"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedDiscountedCRD = Test.GetScope((id, \"CDR\", estimateType, accidentYear));"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedDiscountedCRD"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The starting point for the non performance risk adjustment is the computation of the sum of nominal Cashflows with Amount Type **Claims** listed below"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "Test.GetStorage().GetClaims()"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "with the corresponding nominal Cashflows being"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var nominalNIC = Test.GetScope((id, \"NIC\", estimateType, accidentYear));",
- "\nnominalNIC"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var nominalICO = Test.GetScope((id, \"ICO\", estimateType, accidentYear));",
- "\nnominalICO"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var nominalALE = Test.GetScope((id, \"ALE\", estimateType, accidentYear));",
- "\nnominalNIC"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var nominalULE = Test.GetScope((id, \"ULE\", estimateType, accidentYear));",
- "\nnominalNIC"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var nominalClaims = Sum( Sum(nominalICO.Values, nominalNIC.Values), Sum(nominalALE.Values, nominalULE.Values) );"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Secondly, the correct credit risk rate (parameter $\\gamma$ in the [formula above](#non-performance-risk-adjustment)) is retrieved from the list of imported [Partner Rating](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/DataModel/DataStructure) and [Credit Default Rates](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/DataModel/DataStructure) relative to the target [Data Node](#year-and-period)'s Partner"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "groupOfContract"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var creditDefaultRate = Test.GetStorage().GetNonPerformanceRiskRate( id );",
- "\ncreditDefaultRate"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Lastly, using the [formula above](#non-performance-risk-adjustment), the expected CDR discounted Cashflow can be computed"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedDiscountedCDR = new double[nominalNIC.Values.Length];",
- "\n",
- "\nEnumerable.Range(0, nominalClaims.Length).ForEach( t => ",
- "\n expectedDiscountedCDR[t] = Enumerable.Range(t, nominalClaims.Length-t).Select( tau => ",
- "\n nominalClaims[tau] * Math.Pow(expectedDiscount.GetValidElement(t/12), tau-t+1) * (Math.Exp(-creditDefaultRate*(tau-t)) - 1)",
- "\n ).Sum() );",
- "\n",
- "\nexpectedDiscountedCDR = Multiply(-1d, expectedDiscountedCDR); // we need a reserve view for comparison",
- "\nexpectedDiscountedCDR"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Finally, the expected cumulated discount is compared with the computed values"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedDiscountedCRD.Values.CheckEquality( expectedDiscountedCDR )"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedDiscountedCRD.Values.CheckEquality( expectedDiscountedCDR ).Should().Be(true);"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "
",
- "\n",
- "\n# Present Values"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "For an implementation of these formulas refer to the [ImportScopeCalculation notebook](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/Import/ImportScopeCalculation). "
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The company portfolio value in one period is given by the following Analysis of Change AoC steps:",
- "\n1. Beginning of Period (BoP): starting value of the portfolio as of December last year (in the Year to Date view), ",
- "\n2. Model Corrections (MC): change of the portfolio value based on the model change,",
- "\n3. Cash Flow (CF):",
- "\n4. Interest Accretion (IA): ",
- "\n5. Assumption Update (AU): ",
- "\n6. Yield Curve Update (YCU): impact of yield curve update occured during the reporting period,",
- "\n7. Credit Risk Update (CRU): impact of credit default rate update occured during the reporting period,",
- "\n8. Experience Variance (EV): value adjustments following insurance related events which took place (e.g. mortality),",
- "\n9. Combined Liabilities (CL):",
- "\n10. End of Period (EOP): portfolio value at the end of the current period.",
- "\n",
- "\nNote: the AoC steps WO, EA and AM are not included in the Present Value calculation, hence their values if inquired is zero."
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The Present Value Base (PVB) values are valid for all [Economic Basis](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/DataModel/DataStructure#economic-basis) and depends on the corresponding [AoCType](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/DataModel/DataStructure#aoc-type):",
- "\n",
- "\n$$",
- "\n\\text{PVB}_t \\big(\\text{AoC}\\big) = ",
- "\n\\left\\{",
- "\n\\begin{array}{cl}",
- "\n\\text{CDC}_t & \\text{if AoC is Beginning of Period (BOP) } \\\\",
- "\n-\\text{Nominal}_t(\\text{Parent AoC}) & \\text{if AoC is Expected Cashflow (CF) } \\\\",
- "\n\\text{InterestAccretion}_t & \\text{if AoC is Interest Accretion (IA) } \\\\",
- "\n\\text{CDC}_t(\\text{Parent AoC}) & \\text{if AoC is End of Period (EOP) } \\\\",
- "\n\\text{CDC}_{t}(\\text{current AoC}) - \\text{CDC}_{t}(\\text{parent AoC}) & \\text{otherwise}",
- "\n\\end{array}",
- "\n\\right.",
- "\n$$",
- "\n",
- "\nand the Projected Present Value (PPV) reads",
- "\n",
- "\n$$",
- "\n\\text{PPV} \\big(\\text{AoC},\\text{TS},\\text{S}\\big) = \\left\\{",
- "\n\\begin{array}{cll}",
- "\n\\text{PVB}_{S} & \\text{if AoC Valuation Period is Beginning of Period } & \\text{ (e.g. BOP, MC) } \\\\",
- "\n\\text{PVB}_{S+TS/2 -1} & \\text{if AoC Valuation Period is Mid of Period } & \\text{ (no examples in current data model) } \\\\",
- "\n\\sum_{i=S}^{S + TS -1}\\text{PVB}_{i} & \\text{if AoC Valuation Period is Delta } & \\text{ (e.g. CF, IA) } \\\\",
- "\n\\text{PVB}_{S + TS} & \\text{if AoC Valuation Period is End of Period } & \\text{ (e.g. YCU, CRU, EV, CL, EOP) } \\\\",
- "\n\\end{array}",
- "\n\\right.",
- "\n$$",
- "\n",
- "\nwhere the Shift (S) and Time Step (TS) are derived from the current [Year and Period](#year-and-period)"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var projectionPeriod = 0;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "Test.GetStorage().GetShift(projectionPeriod)"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "Test.GetStorage().GetTimeStep(projectionPeriod)"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## Load Cashflow Data"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "#!eval-notebook \"../Initialization/InitSystemorphToMemory\""
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "Workspace.InitializeFrom(DataSource);"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "At this point standard Cashflows are loaded."
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Initialization of the Test suite: the data loaded from csv files are ready to be used by the Scopes for the calculations"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var Test = await StartCalculatorAsync(reportingNode, year, month, economicBasis, Periodicity.Quarterly, ImportFormats.Cashflow);"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## Select Group of Contract",
- "\n",
- "\nHere, it is possible to select the Group of Contract used to run the next section of this Notebook."
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "groupOfContract = \"DTR1.1\" ;"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## Beginning of Period"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The computed Present Value for Aoc type Beginning of Period is:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var idBoP = Test.GetIdentity(groupOfContract, \"BOP\", \"I\");",
- "\nidBoP"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedPresentValueBoP_PR = Test.GetScope((idBoP, \"PR\", \"BE\", (int?)null));",
- "\ncomputedPresentValueBoP_PR"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "According to the [formula](#present-values) above, the expected BOP AoCType for PVB is defined to be equal to the discounted cashflows with the same Identity, Amount Type, and Calculation Type, whereas the PPV is the S-th element of the PVB."
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var discountedBoP_PR = Test.GetScope((idBoP, \"PR\", \"BE\", (int?)null));",
- "\ndiscountedBoP_PR"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedPresentValueBoP_PR = discountedBoP_PR.Values;"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "In the following cell we check whether the expected values match the computed values"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedPresentValueBoP_PR.Values.CheckEquality( expectedPresentValueBoP_PR )"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedPresentValueBoP_PR.Values.CheckEquality( expectedPresentValueBoP_PR ).Should().Be(true);"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "",
- "\n## Model Corrections"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The computed Present Value for Aoc type Model Corrections is:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var idMC = Test.GetIdentity(groupOfContract, \"MC\", \"I\");",
- "\nidMC"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedPresentValueMC_PR = Test.GetScope((idMC, \"PR\", \"BE\", (int?)null));",
- "\ncomputedPresentValueMC_PR"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "According to the [formula](#present-values) above, for MC AoCType, the PVB is equal to the difference between the CDC of the current AoCType and the CDC of its parent. Additionally, the PPV is the S-th element of the PVB."
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "Test.GetScope((idMC, \"PR\")).Values"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var discountedMC_PR = Test.GetScope((idMC, \"PR\", \"BE\", (int?)null));",
- "\ndiscountedMC_PR"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedPresentValueMC_PR = Subtract(discountedMC_PR.Values, discountedBoP_PR.Values);"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The expected PVB and PPV are compared with the computed results in the following two cells: "
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedPresentValueMC_PR.Values.CheckEquality( expectedPresentValueMC_PR )"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedPresentValueMC_PR.Value == expectedPresentValueMC_PR[0]"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedPresentValueMC_PR.Values.CheckEquality( expectedPresentValueMC_PR ).Should().Be(true);"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedPresentValueMC_PR.Value.Should().Be( expectedPresentValueMC_PR[0] );"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## Cashflow"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The computed Present Value for Aoc type Cashflow is:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var idCF = Test.GetIdentity(groupOfContract, \"CF\", \"I\");",
- "\nidCF"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedPresentValueCF_PR = Test.GetScope((idCF, \"PR\", \"BE\", (int?)null));",
- "\ncomputedPresentValueCF_PR"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "According to the [formula](#present-values) above, for CF AoCType, the PVB is equal to the nominal cashflow of its parent AoC step with opposite sign. The PPV is given by the sum of the first 3 elements."
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var cfReferenceAocStep = Test.GetScope(idCF).Value;",
- "\ncfReferenceAocStep"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var cfNominalReference_PR = Test.GetScope((idCF with {AocType = cfReferenceAocStep.AocType}, \"PR\", \"BE\", (int?)null));",
- "\ncfNominalReference_PR"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedPresentValueCF_PR = Multiply(1.0, cfNominalReference_PR.Values);"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The expected PVB and PPV are compared with the computed results in the following two cells: "
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedPresentValueCF_PR.Values.CheckEquality( expectedPresentValueCF_PR )"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedPresentValueCF_PR.Values[0] + computedPresentValueCF_PR.Values[1] + computedPresentValueCF_PR.Values[2] == computedPresentValueCF_PR.Value"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedPresentValueCF_PR.Values.CheckEquality( expectedPresentValueCF_PR ).Should().Be(true);"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedPresentValueCF_PR.Value.Should().Be( computedPresentValueCF_PR.Values[0] + computedPresentValueCF_PR.Values[1] + computedPresentValueCF_PR.Values[2] );"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "",
- "\n## Interest Accretion"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "For IA AoCType, the PVB is given by the following relation ",
- "\n",
- "\n$$",
- "\n\\text{InterestAccretion}_i = \\left\\{",
- "\n\\begin{array}{cl}",
- "\n\\big(\\text{CDC}_i(\\text{Parent AoC}) - \\text{Nominal}_i(\\text{parent AoC}) \\big) \\cdot \\big({\\text{Valid Interest}_{\\frac{i}{12}}} - 1 \\big)~, ",
- "\n & \\text{if AmountType Transaction Period is Beginning of Period} \\\\",
- "\n\\text{CDC}_i(\\text{parent AoC}) \\cdot \\big({\\text{Valid Interest}_{\\frac{i}{12}}} - 1 \\big)~, ",
- "\n & \\text{otherwise}",
- "\n\\end{array}",
- "\n\\right.",
- "\n$$",
- "\n",
- "\nwhile the PPV is given by the sum of the first S elements.",
- "\n",
- "\nWhen selecting the Identity, note that the Novelty *C* is not contemplated for Interest Accretion."
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var idIA = Test.GetIdentity(groupOfContract, \"IA\", \"I\");",
- "\nidIA"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "### Amount Type BOP"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The computed Present Value for Amount Type **Premiums** (PR) with Transaction Period **Beginning of Period** (BOP) is"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedPresentValueIA_PR = Test.GetScope((idIA, \"PR\", \"BE\", (int?)null));",
- "\ncomputedPresentValueIA_PR"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The Present Value can be recomputed independently following the aforementioned [equation](#interest-accretion) starting from the interest factors, the nominal and discounted Cashflow of the parent Aoc Step"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var iaComputedMonthlyRates = Test.GetScope( idIA );",
- "\niaComputedMonthlyRates"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var iaReferenceAocStep = Test.GetScope(idIA).Value;",
- "\niaReferenceAocStep"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var nominalIaReference_PR = Test.GetScope((idIA with {AocType = iaReferenceAocStep.AocType}, \"PR\", \"BE\", (int?)null));",
- "\nnominalIaReference_PR"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var discountedIaReference_PR = Test.GetScope((idIA with {AocType = iaReferenceAocStep.AocType}, \"PR\", \"BE\", (int?)null));",
- "\ndiscountedIaReference_PR"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedPresentValueIA_PR = discountedIaReference_PR.Values.Select((val, index) => ( val - ( -1d * nominalIaReference_PR.Values[index]) ) * ( iaComputedMonthlyRates.Interest.GetValidElement(index/12) -1));"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The expected PVB and PPV are compared with the computed results in the following two cells: "
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedPresentValueIA_PR.Values.CheckEquality( expectedPresentValueIA_PR )"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedPresentValueIA_PR.Values[0] + computedPresentValueIA_PR.Values[1] + computedPresentValueIA_PR.Values[2] == computedPresentValueIA_PR.Value"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedPresentValueIA_PR.Values.CheckEquality( expectedPresentValueIA_PR ).Should().Be(true);"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedPresentValueIA_PR.Value.Should().Be( computedPresentValueIA_PR.Values[0] + computedPresentValueIA_PR.Values[1] + computedPresentValueIA_PR.Values[2] );"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "### Amount Type EOP"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The computed Present Value for Amount Type **Non Investment Component** (NIC) with Transaction Period **End of Period** (EOP) is"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedPresentValueIA_NIC = Test.GetScope((idIA, \"NIC\", \"BE\", (int?)null));",
- "\ncomputedPresentValueIA_NIC"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The Present Value can be recomputed independently following the aforementioned [equation](#interest-accretion) starting from the interest monthly rates, the discounted Cashflow of the parent Aoc Step"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var iaReferenceAocStep = Test.GetScope(idIA).Value;",
- "\niaReferenceAocStep"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var discountedIaReference_NIC = Test.GetScope((idIA with {AocType = iaReferenceAocStep.AocType}, \"NIC\", \"BE\", (int?)null));",
- "\ndiscountedIaReference_NIC"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedPresentValueIA_NIC = discountedIaReference_NIC.Values.Select((val, index) => val * ( iaComputedMonthlyRates.Interest.GetValidElement(index/12) -1));"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The expected PVB and PPV are compared with the computed results in the following two cells: "
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedPresentValueIA_NIC.Values.CheckEquality( expectedPresentValueIA_NIC )"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedPresentValueIA_NIC.Values[0] + computedPresentValueIA_NIC.Values[1] + computedPresentValueIA_NIC.Values[2] == computedPresentValueIA_NIC.Value"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedPresentValueIA_NIC.Values.CheckEquality( expectedPresentValueIA_NIC ).Should().Be(true);"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedPresentValueIA_NIC.Value.Should().Be( computedPresentValueIA_NIC.Values[0] + computedPresentValueIA_NIC.Values[1] + computedPresentValueIA_NIC.Values[2] );"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## Yield Curve Update"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The computed Present Value for Aoc type Yield Curve Update is:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var idYcu = Test.GetIdentity(groupOfContract, \"YCU\", \"I\");",
- "\nidYcu"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedPresentValueYCU_PR = Test.GetScope((idYcu, \"PR\", \"BE\", (int?)null));",
- "\ncomputedPresentValueYCU_PR"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The Present Value can be recomputed independently following the aforementioned [equation](#interest-accretion) starting from the discount factors for beginning of period and for end of period applied to the reference Aoc step, followed by the difference between the CDC obtained with end of period discount factor and the CDC obtained with beginning of period discount factor. "
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var ycReferenceAocStep = Test.GetScope(idYcu).Value;",
- "\nycReferenceAocStep"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var ycParentAocStep = Test.GetScope((idYcu, \"PR\")).Values.Single();",
- "\nycParentAocStep"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var ycParentId = idYcu with {AocType = ycParentAocStep.AocType, Novelty = ycParentAocStep.Novelty};",
- "\nycParentId"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Here is the parent AocStep discounted with the beginning of period discount factor."
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var discountedYcParent = Test.GetScope((ycParentId, \"PR\", \"BE\", (int?)null));",
- "\ndiscountedYcParent"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Here we independently compute the CDC of the parent AocStep discounted with end of period discount factor."
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var nominalYcParent = Test.GetScope((ycParentId, \"PR\", \"BE\", (int?)null));",
- "\nnominalYcParent"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var ycComputedMonthlyRates = Test.GetScope( idYcu );",
- "\nycComputedMonthlyRates"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var ycReferenceDiscountedEop = new double[nominalYcParent.Values.Length];",
- "\n",
- "\nEnumerable.Range(0, nominalYcParent.Values.Length).Reverse()",
- "\n .ForEach( i => ycReferenceDiscountedEop[i] = nominalYcParent.Values[i] + ycReferenceDiscountedEop.GetValidElement(i+1) * ycComputedMonthlyRates.Discount.GetValidElement(i/12) );",
- "\n",
- "\nycReferenceDiscountedEop = Multiply(-1d, ycReferenceDiscountedEop); // we need a reserve view for comparison",
- "\nycReferenceDiscountedEop"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedPresentValueYCU_PR = Subtract(ycReferenceDiscountedEop, discountedYcParent.Values);"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedPresentValueYCU_PR.Values.CheckEquality( expectedPresentValueYCU_PR )"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedPresentValueYCU_PR.Value == expectedPresentValueYCU_PR[3]"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedPresentValueYCU_PR.Values.CheckEquality( expectedPresentValueYCU_PR ).Should().Be(true);"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedPresentValueYCU_PR.Value.Should().Be( expectedPresentValueYCU_PR[3] );"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## Credit Risk Update"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "This Aoc Step is relevant only in the case of a Group of Reinsurance Contract."
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The computed Present Value for Aoc type Credit Risk Update is:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var idCru = Test.GetIdentity(groupOfContract, \"CRU\", \"I\");",
- "\nidCru"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedPresentValueCRU = Test.GetScope((idCru, \"CDR\", \"BE\", (int?)null));",
- "\ncomputedPresentValueCRU"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The Present Value can be recomputed independently starting as the difference between the CDC obtained with end of period credit default risk rate and the CDC obtained with beginning of period credit default risk rate, both computed using the Nominal cashflow of the reference Aoc Step and the End Of Period discounting factors. "
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var cruReferenceAocStep = Test.GetScope(idCru).Value;",
- "\ncruReferenceAocStep"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var cruReferenceId = idCru with {AocType = cruReferenceAocStep.AocType, Novelty = cruReferenceAocStep.Novelty};",
- "\ncruReferenceId"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var cruParentAocStep = Test.GetScope((idCru, \"CDR\")).Values.Single();",
- "\ncruParentAocStep"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var cruParentId = idCru with {AocType = cruParentAocStep.AocType, Novelty = cruParentAocStep.Novelty};",
- "\ncruParentId"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Here is the parent AocStep discounted with beginning of period credit default risk rate."
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var discountedCruParent = Test.GetScope((cruParentId, \"CDR\", \"BE\", (int?)null));",
- "\ndiscountedCruParent"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var nominalCruReference = Test.GetScope((cruReferenceId, \"CDR\", \"BE\", (int?)null)).Values;",
- "\nnominalCruReference"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var creditDefaultRate = Test.GetStorage().GetNonPerformanceRiskRate( idCru );",
- "\ncreditDefaultRate"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var cruComputedMonthlyRates = Test.GetScope( idCru );",
- "\ncruComputedMonthlyRates"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Lastly, using the [formula above](#non-performance-risk-adjustment), the expected CDR discounted Cashflow can be computed"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var cruExpectedDiscountedCDR = new double[nominalCruReference.Length];",
- "\n",
- "\nEnumerable.Range(0, nominalCruReference.Length).ForEach( t => ",
- "\n cruExpectedDiscountedCDR[t] = Enumerable.Range(t, nominalCruReference.Length-t).Select( tau => ",
- "\n nominalCruReference[tau] * ",
- "\n Math.Pow(cruComputedMonthlyRates.Discount.GetValidElement(t/12), tau-t+1) * ",
- "\n (Math.Exp(-creditDefaultRate*(tau-t)) - 1)",
- "\n ).Sum() );",
- "\n",
- "\ncruExpectedDiscountedCDR = Multiply(-1d, cruExpectedDiscountedCDR); // we need a reserve view for comparison",
- "\n",
- "\ncruExpectedDiscountedCDR"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedPresentValueCRU = Subtract(cruExpectedDiscountedCDR, discountedCruParent.Values);"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedPresentValueCRU.Values.CheckEquality( expectedPresentValueCRU )"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedPresentValueCRU.Value == expectedPresentValueCRU[3]"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedPresentValueCRU.Values.CheckEquality( expectedPresentValueCRU ).Should().Be(true);"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedPresentValueCRU.Value.Should().Be( expectedPresentValueCRU[3] );"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## Combined Liabilities"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The computed Present Value for Aoc type Combined Liabilities and Amount Type PR is:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var idCL = Test.GetIdentity(groupOfContract, \"CL\", \"C\");",
- "\nidCL"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedPresentValueCL_PR = Test.GetScope((idCL, \"PR\", \"BE\", (int?)null));",
- "\ncomputedPresentValueCL_PR"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "According to the [formula](#present-values) above, for CL AoCType, the PVB is equal to the difference between the CDC of the current AoCType and the CDC of its parent(s). Additionally, the PPV is the $(\\text{S}+\\text{TS})$-th element of the PVB."
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var clParents = Test.GetScope((idCL,\"PR\")).Values;",
- "\nclParents"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedPresentValueCL_PR = Subtract(Test.GetScope((idCL, \"PR\", \"BE\", (int?)null)).Values,",
- "\n clParents.Select(aocStep => Test.GetScope((idCL with {AocType = aocStep.AocType, Novelty = aocStep.Novelty}, \"PR\", \"BE\", (int?)null)).Values).Aggregate());"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The expected PVB and PPV are compared with the computed results in the following two cells: "
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedPresentValueCL_PR.Values.CheckEquality( expectedPresentValueCL_PR )"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedPresentValueCL_PR.Value == expectedPresentValueCL_PR[3]"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedPresentValueCL_PR.Values.CheckEquality( expectedPresentValueCL_PR ).Should().Be(true);"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedPresentValueCL_PR.Value.Should().Be( expectedPresentValueCL_PR[3] );"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## End of Period"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The computed Present Value for Aoc type End of Period is:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var idEOP = Test.GetIdentity(groupOfContract, \"EOP\", \"C\");",
- "\nidEOP"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedPresentValueEOP_NIC = Test.GetScope((idEOP, \"NIC\", \"BE\", (int?)null));",
- "\ncomputedPresentValueEOP_NIC"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "According to the [formula](#present-values) above, for EOP AoCType, the PVB is equal to the CDC of the parent AoC step, while the PPV is the $(\\text{S}+\\text{TS})$-th element of the PVB."
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var eopReferenceAocStep = Test.GetScope(idEOP).Value;",
- "\neopReferenceAocStep"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var discountedCL_NIC = Test.GetScope((idEOP with {AocType = eopReferenceAocStep.AocType, Novelty = eopReferenceAocStep.Novelty}, \"NIC\", \"BE\", (int?)null));",
- "\ndiscountedCL_NIC"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedPresentValueEOP_NIC = discountedCL_NIC.Values;"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The expected PVB and PPV are compared with the computed results in the following two cells: "
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedPresentValueEOP_NIC.Values.CheckEquality( expectedPresentValueEOP_NIC )"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedPresentValueEOP_NIC.Value == expectedPresentValueEOP_NIC[3]"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedPresentValueEOP_NIC.Values.CheckEquality( expectedPresentValueEOP_NIC ).Should().Be(true);"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedPresentValueEOP_NIC.Value.Should().Be( expectedPresentValueEOP_NIC[3] );"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## Check for zero PVB values"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "### Amortization"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "For AM AoCType, the PVB values are zero, i.e. Amortization is not part of the Present Value computation. In this subsection we check whether the corresponding values are zero accordingly. "
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var idAM = Test.GetIdentity(groupOfContract, \"AM\", \"C\");",
- "\nidAM"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedPresentValueAM_PR = Test.GetScope((idAM, \"PR\", \"BE\", (int?)null));",
- "\ncomputedPresentValueAM_PR"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedPresentValueAM_PR = Test.GetScope((idAM, \"NIC\", \"BE\", (int?)null));",
- "\ncomputedPresentValueAM_PR"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "
",
- "\n",
- "\n# Amortization Factors"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The amortization factors (AMF) are calculated from the corresponding Nominal and Discounted Cashflows with Calculation Type being *Coverage Units* (CU). ",
- "\nThe monthly AMF is",
- "\n",
- "\n$$",
- "\n\\text{AMF}^{\\text{Monthly}}_t = 1 - \\frac{ \\text{Nominal}^{\\text{Coverage Units}}_t } { \\text{CDC}^{\\text{Coverage Units}}_t } ~,",
- "\n$$",
- "\n",
- "\nwhile the AMF related to the current period is",
- "\n",
- "\n$$",
- "\n\\text{AMF} = 1 - \\prod _{t = \\text{S}}^{\\text{S}+\\text{TS}-1} \\text{AMF}^{\\text{Monthly}}_t ~.",
- "\n$$",
- "\n",
- "\nwhere the shift S and Time Step TS for the [current period](#year-and-period) are"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var projectionPeriod = 0;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var shift = Test.GetStorage().GetShift(projectionPeriod);",
- "\nshift"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var timeStep = Test.GetStorage().GetTimeStep(projectionPeriod);",
- "\ntimeStep"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## Monthly Amortization"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The computed monthly and current period Amortization Factors derived from a non-zero [imported](#year-and-period) nominal cashflows and its corresponding discounted are shown in the following"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var idAM = Test.GetIdentity(groupOfContract, \"CL\", \"C\");",
- "\nidAM"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var nominalCashflowAmortizationFactorTest = Test.GetScope( (idAM, default(string), \"CU\", (int?)null) );",
- "\nnominalCashflowAmortizationFactorTest"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var discountedCashflowAmortizationFactorTest = Test.GetScope(idAM);",
- "\ndiscountedCashflowAmortizationFactorTest"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedMonthlyAmortizationFactor = Test.GetScope(idAM with {AocType = \"AM\"});",
- "\ncomputedMonthlyAmortizationFactor"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "In the following cell we independently evaluate the expected monthly amortization factor according to the [formula above](#amortization-factor) and we check whether expected vs computed match"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedMonthlyAmortizationFactor = nominalCashflowAmortizationFactorTest.Values.Zip(discountedCashflowAmortizationFactorTest.Values, ",
- "\n (nominal, discountedCumulated) => 1 - (-nominal) / discountedCumulated ).ToArray();"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "expectedMonthlyAmortizationFactor.RepeatOnce()"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedMonthlyAmortizationFactor.MonthlyAmortizationFactors.CheckEquality( expectedMonthlyAmortizationFactor )"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedMonthlyAmortizationFactor.MonthlyAmortizationFactors.CheckEquality( expectedMonthlyAmortizationFactor ).Should().Be(true);"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## Current Period"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The computed current period amortization factor is"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedCurrentPeriodAmortizationFactor = Test.GetScope(idAM with {AocType = \"AM\"});",
- "\ncomputedCurrentPeriodAmortizationFactor"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Conversely, the current period Amortization factor can be independently computed using the [formula above](#amortization-factor) as"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedCurrentPeriodAmortizationFactor = 1d - expectedMonthlyAmortizationFactor.Skip(shift).Take(timeStep).Aggregate(1d, (x, y) => x * y);"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "expectedCurrentPeriodAmortizationFactor"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedCurrentPeriodAmortizationFactor.Value == expectedCurrentPeriodAmortizationFactor"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedCurrentPeriodAmortizationFactor.Value.Should().Be( expectedCurrentPeriodAmortizationFactor );"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "
",
- "\n",
- "\n# Results persisted"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The last step during the Cashflow import is to save, namely *persist* the Present Values computed with *locked* (L) and *current* (C) economic basis, and calculation type being *Best Estimate* (BE). ",
- "\n",
- "\nThese data is the starting point of the [Contractual Service Margin calculation](\"SpecificationsCSM\")."
- ]
- },
- {
- "cell_type": "code",
- "source": [
- ""
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/full-ifrs17-template/Test/SpecificationsSetup.ipynb b/full-ifrs17-template/Test/SpecificationsSetup.ipynb
deleted file mode 100644
index b9f1e2f4..00000000
--- a/full-ifrs17-template/Test/SpecificationsSetup.ipynb
+++ /dev/null
@@ -1,125 +0,0 @@
-{
- "metadata": {
- "authors": [],
- "kernelspec": {
- "display_name": "Formula Framework",
- "language": "C#",
- "name": "C#"
- },
- "language_info": {
- "file_extension": ".cs",
- "mimetype": "text/plain",
- "name": "C#"
- },
- "toc-autonumbering": "True",
- "toc-showcode": "False"
- },
- "nbformat": 4,
- "nbformat_minor": 5,
- "cells": [
- {
- "cell_type": "markdown",
- "source": [
- " Specifications Setup
"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "public interface Universe : IMutableScopeWithStorage{}",
- "\n",
- "\npublic async Task StartCalculatorAsync(string reportingNode, int year, int month, string economicBasis, Periodicity period, string format) ",
- "\n{",
- "\n ",
- "\n var importArgs = new ImportArgs(reportingNode, year, month, period, null, format);",
- "\n Workspace.Reset();",
- "\n Workspace.Initialize(x => x.FromSource(DataSource)",
- "\n .DisableInitialization()",
- "\n .DisableInitialization());",
- "\n",
- "\n var partition = (await DataSource.Query().Where(p => p.ReportingNode == importArgs.ReportingNode &&",
- "\n p.Year == importArgs.Year &&",
- "\n p.Month == importArgs.Month &&",
- "\n p.Scenario == importArgs.Scenario",
- "\n ).ToArrayAsync()).Single().Id;",
- "\n await DataSource.Partition.SetAsync(partition);",
- "\n",
- "\n //Set Workspace as when the parsing is completed.",
- "\n if(importArgs.ImportFormat == ImportFormats.Actual)",
- "\n { ",
- "\n await Workspace.UpdateAsync(await DataSource.Query()",
- "\n .Where(x => x.Partition == partition && ",
- "\n new string[]{EstimateTypes.A, EstimateTypes.AA, EstimateTypes.OA}.Contains(x.EstimateType) && ",
- "\n new string[]{AocTypes.CF, AocTypes.WO}.Contains(x.AocType))",
- "\n .ToArrayAsync());",
- "\n }",
- "\n else if(importArgs.ImportFormat == ImportFormats.Opening)",
- "\n { ",
- "\n await Workspace.UpdateAsync(await DataSource.Query()",
- "\n .Where(x => x.Partition == partition && ",
- "\n new string[]{ EstimateTypes.C, EstimateTypes.L, EstimateTypes.LR, EstimateTypes.AA, EstimateTypes.OA, EstimateTypes.DA}.Contains(x.EstimateType) && ",
- "\n x.AocType == AocTypes.BOP && x.Novelty == Novelties.I)",
- "\n .ToArrayAsync());",
- "\n }",
- "\n else",
- "\n {",
- "\n await Workspace.UpdateAsync(await DataSource.Query().Where(x => x.Partition == partition).ToArrayAsync());",
- "\n }",
- "\n var storage = new ImportStorage(importArgs, DataSource, Workspace);",
- "\n await storage.InitializeAsync();",
- "\n return Scopes.ForStorage(storage).WithContext(economicBasis).ToScope();",
- "\n}",
- "\n",
- "\npublic static ImportIdentity GetIdentity (this Universe universe, string dataNode, string aocType, string novelty) ",
- "\n => universe.GetScope(dataNode).Identities.Single( x => x.AocType == aocType && x.Novelty == novelty );",
- "\n",
- "\nstatic T GetValidElement(this IList array, int index) => GetElementOrDefault(array, index);",
- "\n",
- "\nstatic T GetValidElement(this IEnumerable array, int index) => GetElementOrDefault(array.ToArray(), index);",
- "\n",
- "\nstatic void ForEach(this IEnumerable self, Action action) => self.ToList().ForEach(action);",
- "\n",
- "\npublic static IfrsVariable FromPvToIfrsVariable(this PresentValue scope)",
- "\n => new IfrsVariable{ EconomicBasis = scope.EconomicBasis, ",
- "\n EstimateType = scope.Identity.EstimateType, ",
- "\n DataNode = scope.Identity.Id.DataNode, ",
- "\n AocType = scope.Identity.Id.AocType, ",
- "\n Novelty = scope.Identity.Id.Novelty, ",
- "\n AccidentYear = scope.Identity.AccidentYear,",
- "\n AmountType = scope.Identity.AmountType,",
- "\n Value = scope.Value,",
- "\n Partition = scope.GetStorage().TargetPartition };",
- "\n",
- "\npublic static IfrsVariable FromCsmToIfrsVariable(this ContractualServiceMargin scope)",
- "\n => new IfrsVariable{ EstimateType = scope.EstimateType, ",
- "\n DataNode = scope.Identity.DataNode, ",
- "\n AocType = scope.Identity.AocType, ",
- "\n Novelty = scope.Identity.Novelty, ",
- "\n Value = scope.Value,",
- "\n Partition = scope.GetStorage().TargetPartition };",
- "\n",
- "\npublic static IfrsVariable FromLcToIfrsVariable(this LossComponent scope)",
- "\n => new IfrsVariable{ EstimateType = scope.EstimateType, ",
- "\n DataNode = scope.Identity.DataNode, ",
- "\n AocType = scope.Identity.AocType, ",
- "\n Novelty = scope.Identity.Novelty, ",
- "\n Value = scope.Value,",
- "\n Partition = scope.GetStorage().TargetPartition };",
- "\n",
- "\npublic static IfrsVariable FromLoReCoToIfrsVariable(this LossRecoveryComponent scope)",
- "\n => new IfrsVariable{ EstimateType = scope.EstimateType, ",
- "\n DataNode = scope.Identity.DataNode, ",
- "\n AocType = scope.Identity.AocType, ",
- "\n Novelty = scope.Identity.Novelty, ",
- "\n Value = scope.Value,",
- "\n Partition = scope.GetStorage().TargetPartition };"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- ""
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/full-ifrs17-template/Test/SpecificationsTechnicalMargin.ipynb b/full-ifrs17-template/Test/SpecificationsTechnicalMargin.ipynb
deleted file mode 100644
index f8cc0f73..00000000
--- a/full-ifrs17-template/Test/SpecificationsTechnicalMargin.ipynb
+++ /dev/null
@@ -1,1768 +0,0 @@
-{
- "metadata": {
- "authors": [],
- "kernelspec": {
- "display_name": "Formula Framework",
- "language": "C#",
- "name": "C#"
- },
- "language_info": {
- "file_extension": ".cs",
- "mimetype": "text/plain",
- "name": "C#"
- },
- "toc-autonumbering": "True",
- "toc-showcode": "False"
- },
- "nbformat": 4,
- "nbformat_minor": 5,
- "cells": [
- {
- "cell_type": "markdown",
- "source": [
- " Technical Margin Specifications
"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The aim of this notebook is to document the Technical Margin (TM) and its allocation to the Contractual Service Margin (CSM), Loss Component (LC), or Loss Recovery Component (LoReCo). The process is pictorially explained in the following flowchart. ",
- "\n",
- "\n",
- "\n
",
- "\n",
- "\nThroughout this notebook we adopt the following variable notation: we use the words *computed* vs. *expected* to differentiate the results provided by the application vs. this test notebook, respectively."
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "# Import Data"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "",
- "\n## Current Period"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Please select the target period (i.e. year and month) and Reporting Node based on the imported data:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var year = 2021 ;",
- "\nvar month = 3 ;",
- "\nvar reportingNode = \"CH\" ;",
- "\nvar economicBasis = \"L\" ;"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Import the Dimensions, Parameters, Nominal Cashflows, and Actuals from the corresponding csv files in Initialization/Systemorph/"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "#!eval-notebook \"../Initialization/InitSystemorphToMemory\""
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "---"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "[Setup IFRS17 Calculation Engine](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/Import/ImportScopeCalculation):"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "#!import \"SpecificationsSetup\""
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "---"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Initialization of the Test Suite: the data loaded from csv files are ready to be used by the Scopes for the calculations"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var Test = await StartCalculatorAsync(reportingNode, year, month, economicBasis, Periodicity.Quarterly, ImportFormats.Cashflow);"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "",
- "\n## View loaded Data Nodes"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The imported active Data Nodes from Initialization/Systemorph/DataNodes.csv are "
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "Test.GetStorage().DataNodeDataBySystemName"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "whereas the Data Nodes of your imported Cashflows are"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "Test.GetStorage().DataNodesByImportScope[ImportScope.Primary]"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Please select here below the target Data Node for executing the tests below:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var dataNode = \"DT1.1\";"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## View list of Identities"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Based on the Cashflows imported, the list of all possible identities, i.e. combinations of valid Data Nodes, Aoc steps, and Novelties, is contructed and reported here below:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var allIdentities = Test.GetScopes(Test.GetStorage().DataNodesByImportScope[ImportScope.Primary]).SelectMany(s => s.Identities).ToArray();"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "allIdentities"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "
",
- "\n",
- "\n# Present Value"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Projected Present Values (PPVs) are calculated for each Amount Type (AT) either with the *locked-in* (L) and with the *current* (C) Yield Curves. While the former is the latest available as per end of the DataNode's inception year, the latter is the latest available as per the current period. ",
- "\nPPVs for both Economic Basis L and C have been defined [here](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/Import/ImportScopeCalculation#present-value) and tested [here](SpecificationsImportCashflows#present-values). ",
- "\n",
- "\nAccording to the BBA methodology, the CSM calculation uses the PV with locked-in Yield Curve simply defined as",
- "\n",
- "\n$$",
- "\n\\text{PV Locked}(\\text{AoC}, \\text{AT}) = \\text{PPV}(\\text{AoC}, \\text{AT}) \\big|_{\\substack{ \\text{Calculation Type = BE} \\\\ \\text{Economic Base = L} } }",
- "\n$$"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var pvsLocked = allIdentities.SelectMany(id => Test.GetScope(id).PresentValues",
- "\n .Where(x => Math.Abs(x.Value) >= Precision)",
- "\n .Select(x => x.FromPvToIfrsVariable())).ToArray();"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Below a view of the computed locked-in PV "
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "Report.ForObjects(pvsLocked)",
- "\n .WithQuerySource(Workspace)",
- "\n .GroupColumnsBy(x => x.EconomicBasis)",
- "\n .GroupColumnsBy(x => x.AmountType)",
- "\n .GroupRowsBy(x => x.Novelty)",
- "\n .GroupRowsBy(x => x.AocType)",
- "\n .WithGridOptionsForIfrsVariable()",
- "\n .ToReport()"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Aggregated values are also available as the sum over all [Amount Types](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/DataModel/DataStructure#amount-type):",
- "\n",
- "\n$$",
- "\n\\text{PV Locked Value}(\\text{AoC}) = \\sum_{\\text{AT}} \\text{PV Locked}(\\text{AoC}, \\text{AT})",
- "\n$$"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Here below an example"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var id_BoP_I = Test.GetIdentity(dataNode, \"BOP\", \"I\");"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "id_BoP_I"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "Test.GetScope( id_BoP_I ).Value"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "
",
- "\n",
- "\n# Risk Adjustment"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The CSM calculation also uses locked-in Risk Adjustment (RA Locked) which is retrieved from the corresponding Present Value with [Calculation Type](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/DataModel/DataStructure#calculation-type) being RA defined [here](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/Import/ImportScopeCalculation#present-value) and tested [here](SpecificationsImportCashflows#present-values). ",
- "\n",
- "\nRisk Adjustment values can be written as",
- "\n",
- "\n$$",
- "\n\\text{RA Locked Value}(\\text{AoC}) = \\text{PV}(\\text{AoC})|_{\\substack{ \\text{Calculation Type = RA} \\\\ \\text{Economic Base = L} }}",
- "\n$$",
- "\n",
- "\nwhere the imported Cashflows for the RA Calculation Type are already aggregated over all [Amount Types](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/DataModel/DataStructure#amount-type)."
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Here below an example"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var id_BoP_I = Test.GetIdentity(dataNode, \"BOP\", \"I\");"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "id_BoP_I"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "Test.GetScope( id_BoP_I ).Value"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The RA Locked per Data Node imported are"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var rasLocked = allIdentities.SelectMany(id => Test.GetScope(id).PresentValues",
- "\n .Where(x => Math.Abs(x.Value) >= Precision)",
- "\n .Select(x => x.FromPvToIfrsVariable())).ToArray();"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "Report.ForObjects(rasLocked)",
- "\n .WithQuerySource(Workspace)",
- "\n .GroupColumnsBy(x => x.EconomicBasis)",
- "\n .GroupColumnsBy(x => x.DataNode)",
- "\n .GroupRowsBy(x => x.Novelty)",
- "\n .GroupRowsBy(x => x.AocType)",
- "\n .WithGridOptionsForIfrsVariable()",
- "\n .ToReport()"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "
",
- "\n",
- "\n# Technical Margin"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "For the computation of the CSM or LC components for each AoC step, it is convenient to introduce the notion of technical margin (TM).",
- "\n",
- "\nFirstly, it is useful to define the so-called Aggregated Technical Margin (ATM)",
- "\n",
- "\n$$",
- "\n\\text{ATM} (\\text{AoC}) = \\sum_{s\\in\\text{previous AoC steps}} \\text{TM}(s) ~,",
- "\n$$",
- "\n",
- "\nand the Interest Accretion Factor (IAF) ",
- "\n",
- "\n$$",
- "\n\\text{IAF} = \\prod_{i=1}^{\\text{TS}} (1 + \\text{YC}_i) - 1 ~.",
- "\n$$",
- "\n",
- "\nThe TM is defined as",
- "\n",
- "\n$$",
- "\n\\text{TM}(\\text{AoC}) = \\left\\{",
- "\n\\begin{array}{rl}",
- "\n\\text{TM}(\\rm{EOP}) \\text{ of the previous period} ~ & \\text{if }s = \\text{BOP and Novelty is In-Force}. \\\\",
- "\n0 ~ & \\text{if }s = \\text{CF}. \\\\",
- "\n\\text{IAF} \\cdot ~ \\text{ATM}(\\text{AoC}) ~ & \\text{if }s = \\text{IA}. \\\\",
- "\n\\rm{Premiums} + \\text{Attributable Expense and Commissions} + \\text{Investment Claims} ~ & \\text{if }s = \\text{EA}. \\\\",
- "\n-\\text{AMF} \\cdot ~ \\text{ATM}(\\text{AoC}) ~ & \\text{if }s = \\text{AM}. \\\\",
- "\n\\text{PV Locked Value}(\\text{AoC}) ",
- "\n\\bigg|_{\\substack{\\text{Non Attributable} \\\\ ",
- "\n \\text{Amount Types} \\\\ ",
- "\n \\text{excluded}}} ",
- "\n+ \\text{RA Locked Value}(\\text{AoC}) ~ & \\text{otherwise} ",
- "\n\\end{array}",
- "\n\\right.",
- "\n$$",
- "\n",
- "\nwhere AMF is the Amortization Factor that is defined [here](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/Import/ImportScopeCalculation#amortization-factor) and tested [here](SpecificationsImportCashflows#amortization-factor), with YC being the [Yield Curve](#yield-curves) and TS is the Time-Step, ",
- "\nand the Premiums, Attributable Expense and Commissions and Investment Claims terms are given by:",
- "\n",
- "\n$$",
- "\n\\begin{array}{lcl}",
- "\n\\rm{Premiums} &=& \\text{Premium Allocation Factor} \\cdot \\sum_{\\text{Amount Type}\\in\\{\\text{PR and its children}\\}}",
- "\n \\big(\\text{PV}_{\\text{Novelty = I}} + \\text{PV}_{\\text{Novelty = N}} \\big) - ",
- "\n \\big(\\text{Actual}_{\\text{Novelty=C}} + \\text{Advance Actual}_{\\text{Novelty=C}} + \\text{Overdue Actual}_{\\text{Novelty=C}} \\big) ~, \\\\",
- "\n\\text{Attributable Expense and Commissions} &=& \\sum_{\\text{Amount Type}\\in\\{\\rm{ACA}, \\rm{AEA}\\}}",
- "\n \\big(\\text{PV}_{\\text{Novelty = I}} + \\text{PV}_{\\text{Novelty = N}} \\big) - \\text{Actual}_{\\text{Novelty=C}} ~, \\\\",
- "\n\\text{Investment Claims } &=& \\sum_{\\text{Amount Type}\\in\\{\\text{ICO and its children}\\}}",
- "\n \\big(\\text{PV}_{\\text{Novelty = I}} + \\text{PV}_{\\text{Novelty = N}} \\big) - ",
- "\n \\big( \\text{Actual}_{\\text{Novelty=C}} + \\text{Advance Actual}_{\\text{Novelty=C}} + \\text{Overdue Actual}_{\\text{Novelty=C}} \\big) ~.",
- "\n\\end{array}",
- "\n$$",
- "\n",
- "\nThe AoC Type **CF** is implicit for all formulas, PV is the [present value](#present-value) with Calculation Type **BE**, and Actuals have Estimate Types **A**, **OA** and **AA** (see details [here](https://portal.stage.systemorph.cloud/project/ifrs17ce/env/dev/Import/ImportScopeCalculation#actual-base))."
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## Beginning of Period"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var id_BoP_I = Test.GetIdentity(dataNode, \"BOP\", \"I\");"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "id_BoP_I"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedTM_BoP_I = Test.GetScope(id_BoP_I);"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedTM_BoP_I.Value"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The TM for BOP is equal to the TM for EOP of the previous period, that is, the sum of Csm, Loss Component and LoReCo as of at the end of last period (see the corresponding [formula](#technical-margins)). ",
- "\n",
- "\nThe corresponding **IFRS Variables** can be loaded directly from the *Storage*"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var valueCsm = Test.GetStorage().GetValue(id_BoP_I, null, EstimateTypes.C, null);",
- "\nvalueCsm"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var valueLc = Test.GetStorage().GetValue(id_BoP_I, null, EstimateTypes.L, null);",
- "\nvalueLc"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var valueLr = Test.GetStorage().GetValue(id_BoP_I, null, EstimateTypes.LR, null);",
- "\nvalueLr"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedTM_BoP_I = -valueCsm + valueLc + valueLr;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "expectedTM_BoP_I"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedTM_BoP_I.Value.Should().BeApproximately( expectedTM_BoP_I, Precision );"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "",
- "\n## Model Corrections"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var id_MC_I = Test.GetIdentity(dataNode, \"MC\", \"I\");"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "id_MC_I"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedTM_MC_I = Test.GetScope(id_MC_I);"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedTM_MC_I.Value"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The TM for MC is given by the default [formula](#technical-margins), i.e. it is equal to the sum of PV and RA Locked, where the former does not encompass the *NonAttributable* Amount Types"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedTM_MC_I = Test.GetScope(id_MC_I).Value + Test.GetScope( id_MC_I ).Value;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "expectedTM_MC_I"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedTM_MC_I.Value.Should().BeApproximately( expectedTM_MC_I, Precision );"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## Cash Flow"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var id_CF_I = Test.GetIdentity(dataNode, \"CF\", \"I\");"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "id_CF_I"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedTM_CF_I = Test.GetScope(id_CF_I);"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedTM_CF_I.Value"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "According to the [formula](#technical-margins) above, the tecnical margin is 0 for the Cash Flow AoC step "
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedTM_CF_I.Value.Should().BeApproximately( 0, Precision );"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "",
- "\n## Interest Accretion"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var id_IA_I = Test.GetIdentity(dataNode, \"IA\", \"I\");"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "id_IA_I"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedTM_IA_I = Test.GetScope(id_IA_I);"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedTM_IA_I.Value"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "According to the [formula](#technical-margins) above, for the AoC step IA, the TM is equal to sum of the TMs of its previous AoC step multiplied by the IAF. "
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The IAF associated to the current period (i.e. shift and time step) can be calculated from the shift, the time Step, and the Interest Rates"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var projectionPeriod = 0;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var shift = Test.GetStorage().GetShift(projectionPeriod);"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var timeStep = Test.GetStorage().GetTimeStep(projectionPeriod);"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "(shift, timeStep)"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var monthlyRates = Test.GetScope(id_IA_I);"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "monthlyRates"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var IAF = Enumerable.Range(shift,timeStep).Select(i => monthlyRates.Interest.GetValidElement(i/12)).Aggregate(1.0d, (x, y) => x * y ) - 1.0d;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "IAF"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Since the previous AoC steps are"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var previousAocStep = Test.GetScope((id_IA_I, InputSource.Cashflow)).Values;",
- "\npreviousAocStep"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "the expected TM for the Amortization step reads"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedTM_IA_I = IAF * previousAocStep.Sum(aoc => Test.GetScope(id_IA_I with {AocType = aoc.AocType, Novelty = aoc.Novelty}).Value);"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "expectedTM_IA_I"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedTM_IA_I.Value.Should().BeApproximately( expectedTM_IA_I, Precision );"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## Combined Liabilities"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var id_CL_C = Test.GetIdentity(dataNode, \"CL\", \"C\");"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "id_CL_C"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedTM_CL_C = Test.GetScope(id_CL_C);"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedTM_CL_C.Value"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "According to the default TM [formula](#technical-margins), for the CL step the TM is equal to the sum of PV and RA Locked, where the former does not encompass the *NonAttributable* Amount Types"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedTM_CL_C = Test.GetScope(id_CL_C).Value + Test.GetScope( id_CL_C ).Value;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "expectedTM_CL_C"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedTM_CL_C.Value.Should().BeApproximately( expectedTM_CL_C, Precision );"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## Experience Adjustment"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var id_EA_C = Test.GetIdentity(dataNode, \"EA\", \"C\");"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "id_EA_C"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedTM_EA_C = Test.GetScope(id_EA_C);"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedTM_EA_C.Value"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "According to the [formula](#technical-margins) above, for the AoC step EA, the TM is equal to sum of the Premiums, Attributable Expense and Commissions, and Investment Claims. Here below we calculate these terms individually."
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The Premiums, Attributable Expense and Commissions and Investment Claims Present Values and Actuals are calculated using the CF AoC step. Therefore, as first step we define the relevant AoC step and Novelties:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var referenceAoCType = Test.GetScope(id_EA_C).Value.AocType;",
- "\nvar referenceAoC = Test.GetStorage().GetNovelties().Select(n => new AocStep(referenceAoCType, n));"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "referenceAoC"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "**Premiums**"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The list of Premiums Amount Type defined in the imported dimensions and the Premium Allocation Factor can be retrieved"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "Test.GetStorage().GetPremiums()"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var premiumAllocationFactor = Test.GetStorage().GetPremiumAllocationFactor(id_EA_C);"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "premiumAllocationFactor"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Lastly, the Premiums term is"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var premiums = premiumAllocationFactor * Test.GetStorage().GetPremiums()",
- "\n .Sum(p => referenceAoC.Sum(aoc => Test.GetScope((Test.GetIdentity(dataNode, aoc.AocType, aoc.Novelty), p, EstimateTypes.BE, (int?)null), o => o.WithContext(economicBasis)).Value)",
- "\n -referenceAoC.Sum(aoc => Test.GetScope((Test.GetIdentity(dataNode, aoc.AocType, aoc.Novelty), p, EstimateTypes.A, (int?)null)).Value)",
- "\n -referenceAoC.Sum(aoc => Test.GetScope((Test.GetIdentity(dataNode, aoc.AocType, aoc.Novelty), p, EstimateTypes.AA, (int?)null)).Value)",
- "\n -referenceAoC.Sum(aoc => Test.GetScope((Test.GetIdentity(dataNode, aoc.AocType, aoc.Novelty), p, EstimateTypes.OA, (int?)null)).Value)",
- "\n );"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "premiums"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "**Attributable Expense and Commissions**"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Analogously, the Attributable Expense and Commissions term can be computed"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var attributableExpenseAndCommissions = new string[] {AmountTypes.ACA, AmountTypes.AEA}",
- "\n .Sum(d => referenceAoC.Sum(s => Test.GetScope((Test.GetIdentity(dataNode, s.AocType, s.Novelty), d, EstimateTypes.BE, (int?)null), o => o.WithContext(economicBasis)).Value)",
- "\n -referenceAoC.Sum(s => Test.GetScope((Test.GetIdentity(dataNode, s.AocType, s.Novelty), d, EstimateTypes.A, (int?)null)).Value));"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "attributableExpenseAndCommissions"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "**Investment Claims**"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Finally the Investment Claims term reads"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var investmentClaims = Test.GetStorage().GetInvestmentClaims()",
- "\n .Sum(ic => referenceAoC.Sum(s => Test.GetScope((Test.GetIdentity(dataNode, s.AocType, s.Novelty), ic, EstimateTypes.BE, (int?)null), o => o.WithContext(economicBasis)).Value)",
- "\n -referenceAoC.Sum(s => Test.GetScope((Test.GetIdentity(dataNode, s.AocType, s.Novelty), ic, EstimateTypes.A, (int?)null)).Value)",
- "\n -referenceAoC.Sum(s => Test.GetScope((Test.GetIdentity(dataNode, s.AocType, s.Novelty), ic, EstimateTypes.AA, (int?)null)).Value)",
- "\n -referenceAoC.Sum(s => Test.GetScope((Test.GetIdentity(dataNode, s.AocType, s.Novelty), ic, EstimateTypes.OA, (int?)null)).Value)",
- "\n );"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "investmentClaims"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "**Expected TM**"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedTM_EA_C = premiums + attributableExpenseAndCommissions + investmentClaims;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "expectedTM_EA_C"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedTM_EA_C.Value.Should().BeApproximately( expectedTM_EA_C, Precision );"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## Amortization"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var id_AM_C = Test.GetIdentity(dataNode, \"AM\", \"C\");"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "id_AM_C"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedTM_AM_C = Test.GetScope(id_AM_C);"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedTM_AM_C.Value"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedTM_AM_C"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "According to the [formula](#technical-margins) above, for the AoC step AM, the TM is equal to sum of the TMs of its previous AoC step multiplied by the amortization factor with opposite sign. ",
- "\n",
- "\nThe AoC step previous to Amortization are"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var previousAocStep = Test.GetScope((id_AM_C, InputSource.Cashflow)).Values;",
- "\npreviousAocStep"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "while the Amortization Factor can be retrieved in the following"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "Test.GetScope(id_AM_C)"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Therefore, the expected TM for the Amortization step reads"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedTM_AM_C = -Test.GetScope(id_AM_C).Value * ",
- "\n previousAocStep.Sum(aoc => Test.GetScope(id_AM_C with {AocType = aoc.AocType, Novelty = aoc.Novelty}).Value);"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "expectedTM_AM_C"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedTM_AM_C.Value.Should().BeApproximately( expectedTM_AM_C, Precision );"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## End of Period"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var id_EoP_C = Test.GetIdentity(dataNode, \"EOP\", \"C\");"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "id_EoP_C"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedTM_EoP_C = Test.GetScope(id_EoP_C);"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedTM_EoP_C.Value"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedTM_EoP_C = Test.GetScope( id_EoP_C ).Value + Test.GetScope( id_EoP_C ).Value;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "expectedTM_EoP_C"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedTM_EoP_C.Value.Should().BeApproximately( expectedTM_EoP_C, Precision );"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "
",
- "\n",
- "\n# Switch Logic "
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The CSM and LC figures are allocated for each AoC step based on the sign of the ATM. Specifically, for positive (negative) ATM, the TM of the current step is allocated to the LC (CSM), unless the TM flips the sign of the ATM. This special circumstance is named **switch**. It can happen at any AoC step with the only exception of Amortization where there is no switch from the previous step.",
- "\nWhen a switch occurs the total contribution to the CSM (LC) prior the switching step is brought to 0 and the remaing amount is allocated to LC (CSM).",
- "\n",
- "\nIn the following the AoC chain is investigated."
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## Beginning of Period",
- "\n",
- "\nFor the BOP, the last period is considered, which dictates that the corresponding EOP figures considered have necessarily Novelty of type *In-Force*.",
- "\n",
- "\n$$",
- "\n\\begin{array}{rcl}",
- "\n\\text{CSM}(\\text{BOP}) &=& \\text{CSM}(\\text{EOP}) \\text{ of the previous period, for Novelty In-Force} \\\\",
- "\n\\text{LC}(\\text{BOP}) &=& \\text{LC}(\\text{EOP}) \\text{ of the previous period, for Novelty In-Force}",
- "\n\\end{array}",
- "\n$$"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var id_BoP_I = Test.GetIdentity(dataNode, \"BOP\", \"I\");"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "id_BoP_I"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedCSM_BoP_I = Test.GetScope(id_BoP_I).Value;",
- "\nvar computedLC_BoP_I = Test.GetScope(id_BoP_I).Value;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "(computedCSM_BoP_I, computedLC_BoP_I)"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "To understand where the BOP is allocated, we retrieve the corresponding TM and, based on its sign, we expect the CSM or the LC to be non-zero according to the [formula](#switch-logic) above"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var TM_BOP_I = Test.GetScope(id_BoP_I).Value;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "TM_BOP_I"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedCSM_BoP_I = TM_BOP_I < 0 ? -TM_BOP_I : 0;",
- "\nvar expectedLC_BoP_I = TM_BOP_I > 0 ? +TM_BOP_I : 0;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "(expectedCSM_BoP_I, expectedLC_BoP_I)"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "computedCSM_BoP_I.CheckEquality(computedCSM_BoP_I).Should().Be(true);",
- "\nexpectedLC_BoP_I.CheckEquality(computedLC_BoP_I).Should().Be(true);"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## Following AoC steps"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "From the BOP up to the CL step, the switch logic is applied separately to the In-Force and New Business novelties."
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var id_MC_I = Test.GetIdentity(dataNode, \"MC\", \"I\");"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "id_MC_I"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedCSM_MC_I = Test.GetScope(id_MC_I).Value;",
- "\nvar computedLC_MC_I = Test.GetScope(id_MC_I).Value;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "(computedCSM_MC_I, computedLC_MC_I)"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "According to the [formula](#switch-logic) above this AoC step is allocated either to CSM or to LC based on the sign of ATM + TM. Both these two terms can be retrieved from the **TechnicalMargin** Scope."
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var TM_MC_I = Test.GetScope(id_MC_I);"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "TM_MC_I"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The correctness of the ATM can be checked by firstly withdrawing the previous AoC steps"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var previousAocStep = Test.GetScope((id_MC_I, InputSource.Cashflow)).Values;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "previousAocStep"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "and then evaluating the sum of the corresponding TMs"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var expectedATM = previousAocStep.Sum(aoc => Test.GetScope(id_MC_I with {AocType = aoc.AocType, Novelty = aoc.Novelty}).Value);"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "expectedATM"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Therefore, the following condition for ATM calculated by the **TechnicalMargin** Scope needs to be fullfilled"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "TM_MC_I.AggregatedValue.Should().BeApproximately( expectedATM, Precision );"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The CSM and LC can be allocated according to the [Switch Logic](#switch-logic)."
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "double expectedCSM_MC_I; ",
- "\ndouble expectedLC_MC_I; "
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var aggregated = TM_MC_I.Value + TM_MC_I.AggregatedValue;"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "If there is no switch from LC, i.e. $\\text{ATM} (\\text{AoC}) > 0$ and $\\text{ATM} (\\text{AoC}) + \\text{TM}(\\text{AoC}) \\ge 0 $, then:",
- "\n",
- "\n$$",
- "\n\\begin{array}{rcl}",
- "\n\\text{CSM}(\\text{AoC}) &=& 0 ~, \\\\",
- "\n\\text{LC}(\\text{AoC}) &=& \\text{TM}(\\text{AoC}) ~.",
- "\n\\end{array}",
- "\n$$"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "if(TM_MC_I.AggregatedValue > 0 && aggregated >= 0) {",
- "\n expectedCSM_MC_I = 0 ;",
- "\n expectedLC_MC_I = TM_MC_I.Value ;",
- "\n} "
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "If there is no switch from CSM, i.e. $\\text{ATM} (\\text{AoC}) \\le 0$ and $\\text{ATM} (\\text{AoC}) + \\text{TM}(\\text{AoC}) \\le 0 $, then:",
- "\n",
- "\n$$",
- "\n\\begin{array}{rcl}",
- "\n\\text{CSM}(\\text{AoC}) &=& -\\text{TM}(\\text{AoC}) ~, \\\\",
- "\n\\text{LC}(\\text{AoC}) &=& 0 ~.",
- "\n\\end{array}",
- "\n$$"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "if(TM_MC_I.AggregatedValue < 0 && aggregated <= 0) {",
- "\n expectedCSM_MC_I = -TM_MC_I.Value ;",
- "\n expectedLC_MC_I = 0 ;",
- "\n}"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "If $\\text{ATM} (\\text{AoC}) > 0$ and $\\text{ATM} (\\text{AoC}) + \\text{TM}(\\text{AoC}) \\le 0$, then there is a switch to CSM:",
- "\n",
- "\n$$",
- "\n\\begin{array}{rcl}",
- "\n\\text{CSM}(\\text{AoC}) &=& -\\text{TM}(\\text{AoC}) -\\text{ATM} (\\text{AoC}) ~, \\\\",
- "\n\\text{LC}(\\text{AoC}) &=& -\\text{ATM} (\\text{AoC}) ~.",
- "\n\\end{array}",
- "\n$$"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "if(TM_MC_I.AggregatedValue > 0 && aggregated <= 0) {",
- "\n expectedCSM_MC_I = -aggregated;",
- "\n expectedLC_MC_I = -TM_MC_I.AggregatedValue ;",
- "\n}"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "On the other hand, if $\\text{ATM} (\\text{AoC}) \\le 0$ and $\\text{ATM} (\\text{AoC}) + \\text{TM}(\\text{AoC}) > 0$, ",
- "\nthen the switch is to LC:",
- "\n",
- "\n$$",
- "\n\\begin{array}{rcl}",
- "\n\\text{CSM}(\\text{AoC}) &=& \\text{ATM} (\\text{AoC}) ~, \\\\",
- "\n\\text{LC}(\\text{AoC}) &=& \\text{TM}(\\text{AoC}) + \\text{ATM} (\\text{AoC}) ~.",
- "\n\\end{array}",
- "\n$$"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "if(TM_MC_I.AggregatedValue <= 0 && aggregated > 0) {",
- "\n expectedCSM_MC_I = TM_MC_I.AggregatedValue ;",
- "\n expectedLC_MC_I = aggregated ;",
- "\n}"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Therefore, the expected CSM and LC for this step are"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "(expectedCSM_MC_I, expectedLC_MC_I)"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "expectedCSM_MC_I.CheckEquality(computedCSM_MC_I).Should().Be(true);",
- "\nexpectedLC_MC_I.CheckEquality(computedLC_MC_I).Should().Be(true);"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "",
- "\n## Combined Liabilities"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The CL Aoc Step brings both contributions to CSM and LC together as the novelities are summed.",
- "\n",
- "\nFor the CL step, the logic is similar to the one above, except that a switch from LC to CSM can happen **because of New Business and despite of In-Force**, in which case we have:",
- "\n",
- "\n$$",
- "\n\\begin{array}{rcl}",
- "\n\\text{CSM}(\\text{AoC}) &=& -\\text{TM}(\\text{AoC}) - \\text{ATM}(\\text{Last In-Force AoC step}) - \\text{TM}(\\text{Last In-Force AoC step}) \\\\",
- "\n\\text{LC}(\\text{AoC}) &=& -\\text{ATM}(\\text{Last In-Force AoC step}) - \\text{TM}(\\text{Last In-Force AoC step})",
- "\n\\end{array}",
- "\n$$",
- "\n",
- "\nIf, on the other hand, the switch from LC to CSM happens **because of In-Force and despite of New Business**, then we have:",
- "\n",
- "\n$$",
- "\n\\begin{array}{rcl}",
- "\n\\text{CSM}(\\text{AoC}) &=& - \\text{TM}(\\text{AoC}) - \\text{ATM}(\\text{Last NB AoC step}) - \\text{TM}(\\text{Last NB AoC step}) \\\\",
- "\n\\text{LC}(\\text{AoC}) &=& - \\text{ATM}(\\text{Last NB AoC step}) - \\text{TM}(\\text{Last NB AoC step})",
- "\n\\end{array}",
- "\n$$",
- "\n",
- "\nFor the switch in the other direction, i.e. from CSM to LC the formulas are similar except that LC and CSM are swapped."
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var id_CL_C = Test.GetIdentity(dataNode, \"CL\", \"C\");"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "id_CL_C"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedCSM_CL_C = Test.GetScope(id_CL_C).Value;",
- "\nvar computedLC_CL_C = Test.GetScope(id_CL_C).Value;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "(computedCSM_CL_C, computedLC_CL_C)"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "The CL step considers the last step of both the New Business and the In Force Novelties to decide what to allocate to CSM or LC. "
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var lastAocSteps = Test.GetScope((id_CL_C, InputSource.Cashflow)).Values.GroupBy(x => x.Novelty).Select(g => g.Last());"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "lastAocSteps"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Selecting the corresponding AocTypes:"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var lastAocTypeNb = lastAocSteps.Single(x => x.Novelty == Novelties.N).AocType;",
- "\nvar lastAocTypeI = lastAocSteps.Single(x => x.Novelty == Novelties.I).AocType;",
- "\n(lastAocTypeI, lastAocTypeNb)"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var lastTM_NewBusiness = Test.GetScope(id_CL_C with {AocType = lastAocTypeNb, Novelty = Novelties.N});"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "lastTM_NewBusiness"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var lastTM_InForce = Test.GetScope(id_CL_C with {AocType = lastAocTypeI, Novelty = Novelties.I});"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "lastTM_InForce"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Conversely the TM and ATM for the CL step is"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var TM_Combined = Test.GetScope(id_CL_C);"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "TM_Combined"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "where the ATM of CL is given by the sum of the ATMs of the New Business and In Force Novelties"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var aggregatedNewBusiness = lastTM_NewBusiness.Value + lastTM_NewBusiness.AggregatedValue;",
- "\nvar aggregatedInForce = lastTM_InForce.Value + lastTM_InForce.AggregatedValue;",
- "\nvar sum = aggregatedNewBusiness + aggregatedInForce;",
- "\nsum"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "( (sum - TM_Combined.AggregatedValue)/sum < 1.0e-12).Should().Be(true);"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "In order to decide where the TM of the CL step is allocated, one has to check the sign of the ATM + TM for both the New Business and the In Force"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var aggregatedCombined = TM_Combined.Value + TM_Combined.AggregatedValue;",
- "\naggregatedCombined"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "According to the [formulas above](#combined-liabilities), for a positive (negative) aggregated CL value, the CL TM has to be allocated to LC (CSM). ",
- "\n
In case the one of last Aoc step of the novelties (I, NB) has the sign of the CL ATM opposite to the CL ATM, the CL AocStep is used to introduce a balancing item to bring the ATM of the novelty with opposite sign to 0. ",
- "\n
This is equivalent to execute the switch logic with a balancing item = ATM of the last AocStep having opposite sign to CL ATM. ",
- "\n
Note that if CL TM is zero this results in allocating the same amount with opposite sign to CSM(note that the sign of the CSM componet is flipped) and LC."
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "double expectedCSM_CL_C; ",
- "\ndouble expectedLC_CL_C; "
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var balancingItem = aggregatedCombined < 0 ? aggregatedNewBusiness : aggregatedInForce;",
- "\nbalancingItem"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "",
- "\nif(aggregatedCombined > 0) {",
- "\n expectedCSM_CL_C = balancingItem ;",
- "\n expectedLC_CL_C = TM_Combined.Value + balancingItem;",
- "\n} else {",
- "\n expectedLC_CL_C = - balancingItem ;",
- "\n expectedCSM_CL_C = TM_Combined.Value - balancingItem ;",
- "\n}"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "(expectedCSM_CL_C, expectedLC_CL_C)"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "expectedCSM_CL_C.CheckEquality(computedCSM_CL_C).Should().Be(true);",
- "\nexpectedLC_CL_C.CheckEquality(computedLC_CL_C).Should().Be(true);"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## End Of Period",
- "\n",
- "\nFor the last AoC step, the EOP is the sum of all previous steps",
- "\n",
- "\n$$",
- "\n\\begin{array}{rcl}",
- "\n\\text{CSM}(\\text{EOP}) &=& \\sum_{s~\\in~\\text{previous AoC steps}} \\text{CSM}(s) ~, \\\\",
- "\n\\text{LC}(\\text{EOP}) &=& \\sum_{s~\\in~\\text{previous AoC steps}} \\text{LC}(s) ~.",
- "\n\\end{array}",
- "\n$$"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var id_EoP_C = Test.GetIdentity(dataNode, \"EOP\", \"C\");"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "id_EoP_C"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var computedCSM_EoP_C = Test.GetScope(id_EoP_C).Value;",
- "\nvar computedLC_EoP_C = Test.GetScope(id_EoP_C).Value;"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "(computedCSM_EoP_C, computedLC_EoP_C)"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "
",
- "\n",
- "\nFor the reinsurance case, the switch logic is identical to the one described above, except that it uses the corresponding gross case TM to allocate the figure either to CSM or to LoReCo. The reinsurance gross TM multiplied by the weights coming from the Reinsurance Coverage Parameter (Data Node Parameters). In case a GRIC has multiple GICs, then these weighted TMs are aggregated.",
- "\n
"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- ""
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "
",
- "\n",
- "\n# Contractual Service Margin and Loss Component"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "Here below a view of the CSM and Loss Component results are shown. ",
- "\n",
- "\nNote: the Data Nodes with LiabilityType being *LIC* are excluded."
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var allIdentitiesWoLic = allIdentities.Where(id => Test.GetStorage().DataNodeDataBySystemName[id.DataNode].LiabilityType != \"LIC\").ToArray();"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var csm = allIdentitiesWoLic.SelectMany(id => Test.GetScope(id).RepeatOnce()",
- "\n .Where(x => Math.Abs(x.Value) >= Precision)",
- "\n .Select(x => x.FromCsmToIfrsVariable())).ToArray();"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## Gross case"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var allInsuranceIdentitiesWoLic = allIdentitiesWoLic.Where(id => !id.IsReinsurance).ToArray();"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var lc = allInsuranceIdentitiesWoLic.SelectMany(id => Test.GetScope(id).RepeatOnce()",
- "\n .Where(x => Math.Abs(x.Value) >= Precision)",
- "\n .Select(x => x.FromLcToIfrsVariable())).ToArray();"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## Re-Insurance case (LoReCo)"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var allReInsuranceIdentitiesWoLic = allIdentitiesWoLic.Where(id => id.IsReinsurance).ToArray();"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "var loreco = allReInsuranceIdentitiesWoLic.SelectMany(id => Test.GetScope(id).RepeatOnce()",
- "\n .Where(x => Math.Abs(x.Value) >= Precision)",
- "\n .Select(x => x.FromLoReCoToIfrsVariable())).ToArray();"
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## Summary"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "Report.ForObjects( csm.Concat(lc).Concat(loreco) )",
- "\n .WithQuerySource(Workspace)",
- "\n .GroupColumnsBy(x => x.DataNode)",
- "\n .GroupColumnsBy(x => x.EstimateType)",
- "\n .GroupRowsBy(x => x.Novelty)",
- "\n .GroupRowsBy(x => x.AocType)",
- "\n .WithGridOptionsForIfrsVariable()",
- "\n .ToReport()"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- ""
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/full-ifrs17-template/Test/Tests.ipynb b/full-ifrs17-template/Test/Tests.ipynb
index 47f5ea85..06b5b7d7 100644
--- a/full-ifrs17-template/Test/Tests.ipynb
+++ b/full-ifrs17-template/Test/Tests.ipynb
@@ -59,36 +59,6 @@
"---"
]
},
- {
- "cell_type": "code",
- "source": [
- "#!eval-notebook \"SpecificationsImportCashflows\""
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "#!eval-notebook \"SpecificationsImportActuals\""
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "#!eval-notebook \"SpecificationsTechnicalMargin\""
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "#!eval-notebook \"SpecificationsFinancialPerformance\""
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "---"
- ]
- },
{
"cell_type": "code",
"source": [
diff --git a/ifrs17/Constants/Validations.ipynb b/ifrs17/Constants/Validations.ipynb
index afd2e82e..3ee38f17 100644
--- a/ifrs17/Constants/Validations.ipynb
+++ b/ifrs17/Constants/Validations.ipynb
@@ -156,7 +156,7 @@
"source": [
"public static string Get (Warning w, params string[] s) => (w, s.Length) switch {",
"\n // Import",
- "\n (Warning.ActiveDataNodeWithCashflowBOPI , _) => $\"Cashflows for active DataNode has been parsed with AocType {AocTypes.BOP} and Novelty {Novelties.I} \",",
+ "\n (Warning.ActiveDataNodeWithCashflowBOPI , 1) => $\"Cash flow with AocType: {AocTypes.BOP} and Novelty: {Novelties.I} for Group of Contract {s[0]} is not allowed because previous period data are available.\",",
"\n // Default",
"\n (Warning.Generic , _) => $\"{s[0]}\",",
"\n (_ , _) => $\"Warning not found.\"",
diff --git a/ifrs17/DataModel/DataStructure.ipynb b/ifrs17/DataModel/DataStructure.ipynb
index cd9bb7a3..636e87a9 100644
--- a/ifrs17/DataModel/DataStructure.ipynb
+++ b/ifrs17/DataModel/DataStructure.ipynb
@@ -149,13 +149,10 @@
"source": [
"public interface IHierarchy",
"\n{",
- "\n [Display(Order = 10)]",
"\n public string Name { get; init; }",
"\n ",
- "\n [Display(Order = 20)]",
"\n public string Parent { get; init; }",
"\n ",
- "\n [Display(Order = 30)]",
"\n public string Child { get; init; }",
"\n}"
]
@@ -1067,13 +1064,11 @@
"\n ",
"\n [NotVisible] ",
"\n [Dimension(typeof(Currency))]",
- "\n //[Required] // TODO: check",
- "\n //[Immutable] // TODO: Not available yet",
+ "\n //[Immutable]",
"\n public string ContractualCurrency { get; init; }",
"\n ",
"\n [NotVisible] ",
"\n [Dimension(typeof(Currency))]",
- "\n //[Required] // TODO: check",
"\n //[Immutable]",
"\n public string FunctionalCurrency { get; init; }",
"\n ",
diff --git a/ifrs17/Export/ExportConfiguration.ipynb b/ifrs17/Export/ExportConfiguration.ipynb
index e3fa8ad4..6ce27a87 100644
--- a/ifrs17/Export/ExportConfiguration.ipynb
+++ b/ifrs17/Export/ExportConfiguration.ipynb
@@ -17,6 +17,12 @@
"nbformat": 4,
"nbformat_minor": 5,
"cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ " Export Configuration
"
+ ]
+ },
{
"cell_type": "code",
"source": [
diff --git a/ifrs17/Images/BigPicture.PNG b/ifrs17/Images/BigPicture.PNG
index 9e7bfe68..d4a66991 100644
Binary files a/ifrs17/Images/BigPicture.PNG and b/ifrs17/Images/BigPicture.PNG differ
diff --git a/ifrs17/Import/ImportScopeCalculation.ipynb b/ifrs17/Import/ImportScopeCalculation.ipynb
index 6a5269f3..f930054f 100644
--- a/ifrs17/Import/ImportScopeCalculation.ipynb
+++ b/ifrs17/Import/ImportScopeCalculation.ipynb
@@ -571,9 +571,9 @@
"\n### Telescoping Difference",
"\n",
"\n",
- "\nPresent Value figures for a specific period are typically reported through an analysis of change, where for each [AocStep](#aoc-steps-structure) the variation with respect to the preceding AocStep is shown.",
+ "\nPresent Value figures for a specific period are typically reported through an analysis of change, where for each [AocStep](#aoc-step-structure) the variation with respect to the preceding AocStep is shown.",
"\n",
- "\nThe Telescoping Difference is basically the delta between two adjacent AoC steps, whereby the [ParentAocStep](#aoc-steps-structure) is used to determine the AoC step. ",
+ "\nThe Telescoping Difference is basically the delta between two adjacent AoC steps, whereby the [ParentAocStep](#aoc-step-structure) is used to determine the AoC step. ",
"\n",
"\nIt is defined as follows:",
"\n",
@@ -1061,10 +1061,10 @@
"\n## Actual Values",
"\n",
"\nWe consider 4 types of Actual values, which are distinguished through their [Estimate Type](../DataModel/DataStructure#estimate-type):",
- "\n- Actuals (A)",
- "\n- Advance Actuals (AA)",
- "\n- Overdue Actuals (OA)",
- "\n- Deferrable Actuals (DA)",
+ "\n- [Actuals](#actuals) (A)",
+ "\n- [Advance Actuals](#advance-actuals) (AA)",
+ "\n- [Overdue Actuals](#overdue-actuals) (OA)",
+ "\n- [Deferrable Actuals](#deferrable-actuals) (DA)",
"\n",
"\nwith the Estimate Type's system name shown between parenthesis above.",
"\n",
@@ -1778,7 +1778,7 @@
{
"cell_type": "markdown",
"source": [
- "The scopes below are simply used to set the appropriate Estimate Type (C for $CSM$, L for $LC$ and LR for $LCR$), as well as to set $CSM$ values to be positive:"
+ "The scopes below are simply used to set the appropriate Estimate Type (C for $CSM$, L for $LC$ and LR for $LoReCo$), as well as to set $CSM$ values to be positive:"
]
},
{
@@ -1982,11 +1982,7 @@
"\n Value = x.Value,",
"\n Partition = GetStorage().TargetPartition",
"\n });",
- "\n",
- "\n /*private double validateSingleEoP => Math.Abs(ValueCsm) > Precision && Math.Abs(ValueLc) > Precision ",
- "\n ? (double)ApplicationMessage.Log(Error.MultipleEoP)",
- "\n : default;",
- "\n */",
+ "\n ",
"\n IEnumerable CalculatedIfrsVariables => GetStorage().ImportFormat switch {",
"\n ImportFormats.Actual => Actual.Concat(AdvanceActual).Concat(OverdueActual).Concat(ActEAForPremium)",
"\n .Concat(DeferrableActual).Concat(Csms).Concat(Loss),",
diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb
index 7aeb86d5..c8659d4f 100644
--- a/ifrs17/Import/Importers.ipynb
+++ b/ifrs17/Import/Importers.ipynb
@@ -35,7 +35,10 @@
{
"cell_type": "markdown",
"source": [
- "# Parsing Storage"
+ "# Parsing Storage",
+ "\n",
+ "\nThe Parsing storage collects data required for the import of a file. ",
+ "\nSuch storage is then passed to parsing format definitions to map the content of the file into variables."
]
},
{
@@ -210,7 +213,9 @@
{
"cell_type": "markdown",
"source": [
- "# Basics"
+ "# Basics",
+ "\n",
+ "\nBasic methods to delete variable and update variables to the data source are defined."
]
},
{
@@ -308,15 +313,16 @@
{
"cell_type": "markdown",
"source": [
- "The Analysis of Change configuration is parsed from the input file and complemented with defaults to allow for an easy insertion of new AOC steps. ",
+ "The [Analysis of Change configuration](../DataModel/DataStructure#aoc-step-configuration) is parsed from the input file and complemented with defaults to allow for an easy insertion of new Aoc steps. ",
"\n",
- "\nAfter having checked that the AocTypes loaded in the target DataSource are including all the compulsory ones, default configurations are generated on the basis of the AocTypes ordering. ",
+ "\nAfter having checked that the [AocTypes](../DataModel/DataStructure#aoc-variable-type) loaded in the target DataSource are including all the compulsory ones, default configurations are generated on the basis of the AocTypes ordering. ",
"\n",
- "\nThe following categories have been identified based on the *Order* of the novel AOC step:",
+ "\nThe following categories have been identified based on the *Order* of the novel Aoc step:",
"\n",
- "\n| Category | Default added with same configuration of |",
- "\n| --------------------- | ----------------------------------------------------- |",
- "\n| Order < RCU | MC with Novelty I |",
+ "\n**Category** $$\\hspace{2.8cm}$$ **Default added with same configuration of**",
+ "\n| | |",
+ "\n|-----------------------|-------------------------------------------------------|",
+ "\n| Order < RCU $$\\phantom{.......................}$$ | MC with Novelty I |",
"\n| RCU < Order < CF | RCU with Novelty I |",
"\n| IA < Order < YCU | AU with both Novelty I and N |",
"\n| CRU < Order < WO | EV with Novelty I and N |",
@@ -325,6 +331,18 @@
"\nThe new Aoc Configurations are created with the same order of the Aoc Types. "
]
},
+ {
+ "cell_type": "code",
+ "source": [
+ ""
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ ""
+ ]
+ },
{
"cell_type": "code",
"source": [
@@ -405,7 +423,9 @@
{
"cell_type": "markdown",
"source": [
- "## Parse Main Tab and return Args"
+ "## Parse Main Tab and return Args",
+ "\n",
+ "\nThe main table of our custom import formats contains the information which are required to identify the data partition. These information are temporarily stored in [Args](../DataModel/DataStructure#args) and used in the next methods. "
]
},
{
@@ -450,7 +470,9 @@
{
"cell_type": "markdown",
"source": [
- "## Parse and Upload: Data Nodes"
+ "## Parse and Upload: Data Nodes",
+ "\n",
+ "\n[Portfolios](../DataModel/DataStructure#portfolios) and [Group of Contracts](../DataModel/DataStructure#group-of-contracts) are imported in the same file. "
]
},
{
@@ -760,7 +782,14 @@
{
"cell_type": "markdown",
"source": [
- "## Parse and Upload: Variables"
+ "## Parse and Upload: Variables",
+ "\n",
+ "\nVariables are created upon import of Cash flow and Actual file.",
+ "\n
Cash flows are firstly mapped into [RawVariables](../DataModel/DataStructure#raw-variables-cashflows). These are then used as input for the [calculation](ImportScopeCalculation) of the IFRS 17 business logic which computes [IfrsVariables](../DataModel/DataStructure#ifrs-variable).",
+ "\n
Actuals are directly mapped into [IfrsVariables](../DataModel/DataStructure#ifrs-variable). ",
+ "\n",
+ "\nSome computed variables depend on both cash flow and actual input, requiring recalculation at each new import. ",
+ "\n
In order to improve performance and maximize computational efficiency, we only (re)compute the set of variables that are expected to change given the underlying business logic. "
]
},
{
@@ -820,7 +849,7 @@
"\n ",
"\n // Filter out cashflows for DataNode that were created in the past and are still active and come with AocType = BOPI",
"\n if(dataNodeData.Year < args.Year && aocType == AocTypes.BOP && novelty == Novelties.I) {",
- "\n ApplicationMessage.Log(Warning.ActiveDataNodeWithCashflowBOPI);",
+ "\n ApplicationMessage.Log(Warning.ActiveDataNodeWithCashflowBOPI, dataNode);",
"\n return null;",
"\n }",
"\n ",
@@ -990,7 +1019,12 @@
{
"cell_type": "markdown",
"source": [
- "# Simple Value Import"
+ "# Simple Value Import",
+ "\n",
+ "\nSimple Value import is a special import that imports [IfrsVariables](../DataModel/DataStructure#ifrs-variable).",
+ "\n
It can be used in two very different scenarios: ",
+ "\n- Simple Value : to import final figures as computed by an independent tool. In this case our IFRS 17 calculation is not applied and variable are stored in the Database for being consumed in reports with our powerful reporting tooling. ",
+ "\n- Opening value : in the **fair value approach** this importer allows the import of in force opening values (Aoc step BOP and novelty I) for EstimateTypes C, L, LR, AA, OA, DA."
]
},
{
diff --git a/ifrs17/OverviewCalculationEngine.ipynb b/ifrs17/OverviewCalculationEngine.ipynb
index 866c5502..651ab74b 100644
--- a/ifrs17/OverviewCalculationEngine.ipynb
+++ b/ifrs17/OverviewCalculationEngine.ipynb
@@ -28,11 +28,11 @@
"source": [
"# Introduction",
"\n",
- "\nSystemorph's IFRS 17 Calculation Engine is a tool and a solution to conduct all the essential IFRS 17 calculations based on some key input: modeled future **cashflows** and actual amounts for **groups of insurance contracts** and other relevant parameters (Yield Curve, FX rates, etc...). The output is a set of calculated results (CSM, Loss Component, Financial Performance, etc...) that are needed for IFRS 17 reporting, analysis, accounting, steering and other management information.",
+ "\nSystemorph's IFRS 17 Calculation Engine is a tool and a solution to conduct all the essential IFRS 17 calculations based on some key input: modeled future **cashflows** and actual amounts for **groups of insurance contracts** and other relevant parameters (Yield Curve, FX rates, etc...). The output is a set of calculated results (Contractual Service Margin, Loss Component, Financial Performance, etc...) that are needed for IFRS 17 reporting, analysis, accounting, steering and other management information.",
"\n",
"\nThis notebook provides an **overview** of Systemorph's IFRS 17 Calculation Engine with brief introductions to all the main steps.",
"\n",
- "\nThere are numerous **links** to several notebooks of the Calculation Engine. These notebooks contain specifications, code and also some detailed explanations with formulas in markdown blocks. The most important ones in this respect are [DataModel/DataStructure](./DataModel/DataStructure#data-structure), [ImportScopes](./Import/ImportScopeCalculation#import-scope-calculation) and [ReportScopes](./Report/ReportScopes#report-scopes)."
+ "\nThere are numerous **links** to several notebooks of the Calculation Engine. These notebooks contain specifications, code and also some detailed explanations with formulas in markdown blocks. The most important ones in this respect are [DataStructure](./DataModel/DataStructure#data-structure), [ImportScopes](./Import/ImportScopeCalculation#import-scope-calculation) and [ReportScopes](./Report/ReportScopes#report-scopes)."
]
},
{
@@ -43,7 +43,7 @@
"\n",
"\nIFRS 17 is a new accounting standard for insurance contracts. The previous standard IFRS 4, which is based on nominal accounting, is replaced by the economic accounting standard IFRS 17.",
"\n",
- "\nExplanatory **videos** on **IFRS 17** and a **demo application** can be found on Systemorph's website. Some key points are repeated here briefly.",
+ "\nSome key points are repeated here briefly.",
"\n",
"\nIFRS 17 deals with insurance contracts which are on the liability side of the balance sheet. Other accounting standards deal with other parts of the business, primarily IFRS 9 for invested assets.",
"\n",
@@ -74,7 +74,7 @@
"",
"\n# Data Model, Data Import",
"\n",
- "\nThe IFRS 17 calculations are based on a well-defined **data model**. The data input files are set up according to the data model, and the data import and all the ensuing calculations up to the final report generation respect the data model.",
+ "\nThe IFRS 17 calculations are based on a well-defined [DataModel](./DataModel/DataStructure#data-structure). The data input files are set up according to the data model, and the data import and all the ensuing calculations up to the final report generation respect the data model.",
"\n",
"\nThe IFRS 17 calculations start by importing data input files, and the more complex IFRS 17 Business Logic is defined in the [ImportScopes](./Import/ImportScopeCalculation#import-scope-calculation) notebook. This basis will later be used to calculate and generate different reports."
]
@@ -87,9 +87,9 @@
"\n",
"\nThe data model includes the definition of reporting nodes and dimensions to be used, including identities, amount types, group of insurance contracts and many more.",
"\n",
- "\nThe notebook [DataModel/DataStructure](./DataModel/DataStructure#data-structure) defines the data records, dimensions and interfaces of the data model. There is a long section on the many [dimensions](./DataModel/DataStructure#dimensions) used to characterize the business and its IFRS 17 model.",
+ "\nThe notebook [DataStructure](./DataModel/DataStructure#data-structure) defines the data records, dimensions and interfaces of the data model. There is a long section on the many [dimensions](./DataModel/DataStructure#dimensions) used to characterize the business and its IFRS 17 model.",
"\n",
- "\nThe [input files](#data-input-dim-nodes) ReportingNodes and especially DimensionsAndPartitions provide an overview of data structures actually used. Some dimensions are hierarchical, so some entries have parent entries.",
+ "\nThe [input files](#data-input-dim-nodes) for ReportingNodes and especially Dimensions provide an overview of data structures actually used. Some dimensions are hierarchical, so some entries have parent entries.",
"\n",
"\nMany abbreviations and acronyms used later in the documentation and the code are the **system names**, where the corresponding display names can be found in the corresponding input files together with the attributes."
]
@@ -100,13 +100,11 @@
"",
"\n## Data import and related calculations",
"\n",
- "\nSeveral notebooks organize the data import. Methods for importing and accessing data are in the class [ImportStorage](./Import/ImportStorage#import-storage). Methods for further calculations to be done upon import are in [ImportScopeCalculation](./Import/ImportScopeCalculation#import-scope-calculation).",
+ "\nSeveral notebooks organize the data import. Methods for importing and accessing data are in the [Importers](./Import/Importers) notebook. The [ImportStorage](./Import/ImportStorage#import-storage) prepare the data to perfom the calculation required. Finally, methods for the calculations are in [ImportScopeCalculation](./Import/ImportScopeCalculation#import-scope-calculation).",
"\n",
- "\nHowever, the import as such is conducted by other notebooks which use the methods of ImportStorage and ImportScopeCalculation in a chain of notebook imports:",
+ "\nHowever, the import as such is conducted by other notebooks which use the methods of Importers, ImportStorage and ImportScopeCalculation in a chain of notebook imports:",
"\n",
- "\nImportStorage --> ImportScopeCalculation --> [Importers](./Import/Importers#importers) --> [InitSystemorphBaseToMemory](./Initialization/InitSystemorphBaseToMemory#init-base-to-memory) --> [InitSystemorphToMemory](./Initialization/InitSystemorphToMemory#init-base-to-memory).",
- "\n",
- "\nThe latter two notebooks initialize and store the imported and derived data in memory for further usage. To store the data in a physical database, [InitSystemorphToDatabase](./Initialization/InitSystemorphToDatabase#init-to-database) can be employed.",
+ "\nImportStorage --> ImportScopeCalculation --> Importers",
"\n",
"\nThe calculations of ImportScopeCalculation cover a large part of the IFRS 17 methodology and are explained in the section below."
]
@@ -121,20 +119,33 @@
"\n",
"\nThe main concepts and parts of ImportScopeCalculation are listed here, with links.",
"\n- Structure and sequence of the **[Analysis of Change (AoC)](./Import/ImportScopeCalculation#aoc-step-structure)** steps for the given period",
+ "\n$$",
+ "\n$$",
"\n- **[Discounting](./Import/ImportScopeCalculation#discounting-calculation)** projected cash flows using [yield curves](#data-input-parameters) (current or locked in)",
+ "\n$$",
+ "\n$$",
"\n- **[Nominal](./Import/ImportScopeCalculation#nominal-values)** cash flow amounts per AoC step",
+ "\n$$",
+ "\n$$",
"\n- **[Present Values (PV)](./Import/ImportScopeCalculation#present-values)** of cash flow amounts for all AoC steps:",
"\n - [Cumulated discounted](./Import/ImportScopeCalculation#cumulated-discounted-cashflows) cash flow amounts for all AoC steps",
"\n - [Telescoping difference](./Import/ImportScopeCalculation#telescopic-difference) calculation of cumulated discounted cashflows per AoC step, where the total PV change over the period is the telescoping sum of all these differences",
- "\n - [Present Value calculation](./Import/ImportScopeCalculation#present-value) at the beginning and end of the period, with its underlying [PV base](./Import/ImportScopeCalculation#present-value-base) calculations for different AoC types and for [current and locked-in](./Import/ImportScopeCalculation#current-and-locked) yield curves",
+ "\n - [Present Value calculation](./Import/ImportScopeCalculation#present-value) at the beginning and end of the period, with its underlying [Present value base](./Import/ImportScopeCalculation#present-value-base) calculations for different AoC types and for [current and locked-in](./Import/ImportScopeCalculation#current-and-locked) yield curves",
"\n - [Interest accretion](./Import/ImportScopeCalculation#interest-accretion) cash flow calculation (one of the AoC steps)",
"\n- **[Risk Adjustment (RA)](./Import/ImportScopeCalculation#risk-adjustment)** calculation, a requirement of the IFRS 17 standard",
+ "\n$$",
+ "\n$$",
"\n- **[Amortization](./Import/ImportScopeCalculation#amortization)**, the AoC step dealing with the reduction of the remaining exposure over the period:",
"\n - [Coverage Unit (CU)](./Import/ImportScopeCalculation#coverage-units), the quantity of services provided by a given GIC, considering one period (reflecting the run-off pattern of the GIC)",
"\n - [Amortization factor](./Import/ImportScopeCalculation#amortization-factor), the relative size of the amortization of a GIC, monthly and for a longer time interval",
+ "\n$$",
+ "\n$$",
"\n- **[Actuals](./Import/ImportScopeCalculation#actual-values)**, treatment of actual values per GIC or GRIC, distinguished according to by their Estimate Type: Ordinary Actuals, Advance Actuals, Overdue Actuals and Deferrable Actuals",
"\n - Calculation of [Actuals Base](./Import/ImportScopeCalculation#actual-base) values for a given GIC and per Estimate Type and Amount Type",
"\n - Different Estimate Types of Actuals and their calculations: Ordinary [Actuals](./Import/ImportScopeCalculation#actuals), [Advance Actuals](./Import/ImportScopeCalculation#advance-actuals) paid before the due date which is inside the AoC period, [Overdue Actuals](./Import/ImportScopeCalculation#overdue-actuals) paid after the AoC period, [Deferrable Actuals](./Import/ImportScopeCalculation#overdue-actuals) whose recognition is deferred (typically used for expenses of different kinds)",
+ "\n",
+ "\n$$",
+ "\n$$",
"\n- **[Contractual Service Margin (CSM), Loss Component LC) and Loss Recovery Component (LRC)](./Import/ImportScopeCalculation#csm)**, modeling the treatment of unearned profits (CSM) and losses (LC, LRC) as required by the IFRS 17 standard, per GIC or GRIC:",
"\n - [Fulfillment Cashflow (FCF)](./Import/ImportScopeCalculation#fulfillment-cashflow), same as the aforementioned cumulated discounted cashflow, now adding the risk adjustment component as a basis for CSM and LC calculations",
"\n - [Technical Margin](./Import/ImportScopeCalculation#technical-margin), which is the FCF with special rules for different AoC steps including the Amortization step, also using and calculating the Interest Accretion Factor, Premiums, Deferrals and Investment Claims",
@@ -153,13 +164,7 @@
"\n",
"\nSome reports of ReportScopes just present existing data from the database, namely the imported data and the results already calculated using the methods of [ImportScopes](#model-calc).",
"\n",
- "\nSome other reports related to **[Financial Performance](./Report/ReportScopes#financial-performance)** (profit & loss) require further calculations provided by ReportScopes. An IFRS 17 financial performance report has at least four sections: Insurance Revenue, Insurance Service Expense, Insurance Finance Income/Expense and Other Comprehensive Income. Formulas are provided [here](./Report/ReportScopes#financial-performance)."
- ]
- },
- {
- "cell_type": "code",
- "source": [
- ""
+ "\nSome other reports related to **[Financial Performance](./Report/ReportScopes#ifrs-17-financial-performance)** (profit & loss) require further calculations provided by ReportScopes. An IFRS 17 financial performance report has at least four sections: Insurance Revenue, Insurance Service Expense, Insurance Finance Income/Expense and Other Comprehensive Income. Formulas are provided [here](./Report/ReportScopes#ifrs-17-financial-performance)."
]
}
]
diff --git a/ifrs17/README.md b/ifrs17/README.md
index 9891b004..10015d5e 100644
--- a/ifrs17/README.md
+++ b/ifrs17/README.md
@@ -1,7 +1,8 @@
-
+
+
+
-
-**IFRS17 Calculation Engine**
+IFRS 17 Calculation Engine
Systemorph's IFRS 17 Calculation Engine is a tool to conduct all the essential IFRS 17 calculations given some key figures, future cashflows and actual amounts, for groups of insurance contracts and other basic information. The result is a set of reports needed for IFRS 17 accounting and management information.
@@ -9,21 +10,24 @@ Systemorph's IFRS 17 Calculation Engine is a tool to conduct all the essential I
Systemorph portal allows Users to create their own projects powered by the Vertex 10 technology.
-## Overview
+# Overview
-
+
+
+
-If you want to know more about the Calculation Engine than just its standard technical use, you are recommended to look at [OverviewCalculationEngine](OverviewCalculationEngine).
+If you want to know more about the Calculation Engine than just its standard technical use, you are recommended to look at [OverviewCalculationEngine](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/OverviewCalculationEngine).
You will be introduced to
-- [DataModel](./DataModel/DataStructure) with links to detailed description of individual data types, dimensions and partitions employed
-- [Calculation](./Import/ImportScopeCalculation) with in detail description using mathematical formulas and links to supporting material
-- [Reports](./Report/ReportScopes) for data analysis and drill down to the lowest data granularity. With links to discover the calculation of the [Financial Performance](./Report/ReportScopes#ifrs-17-financial-performance)
+- [DataModel](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure) with links to detailed description of individual data types, dimensions and partitions employed
+- [Calculation](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/Import/ImportScopeCalculation) with in detail description using mathematical formulas and links to supporting material
+
+# Got Questions
+For support around the IFRS 17 CalculationEngine get in contact with our [Community](). -TODO link to the community page(IFRS17 landing page)-
-## Got Questions
+# Contributing
-For support around the IFRS 17 CalculationEngine get in contact with our Community:
+All work on the **Full IFRS 17 Template** happens directly on [GitHub](https://github.com/Systemorph/IFRS17CalculationEngine).
-- [Community]() -link to the community page-
-- [Evangelists]() -link to Evangelists page-
\ No newline at end of file
+This project adheres to overall [General Terms & Conditions for Systemorph Cloud]() TODO link to terms and conditions file.
\ No newline at end of file
diff --git a/ifrs17/Report/ReportScopes.ipynb b/ifrs17/Report/ReportScopes.ipynb
index 7a5efd50..f4f56181 100644
--- a/ifrs17/Report/ReportScopes.ipynb
+++ b/ifrs17/Report/ReportScopes.ipynb
@@ -180,7 +180,7 @@
"",
"\n### Best Estimate",
"\n",
- "\nBest Estimate of Present Value (PV) report includes contributions from the [Present Value](../Import/ImportScopeCalculation#current-and-locked) calculation. The result of the Locked-in calculation is used when the Valuation Approach is BBA and the flag for Oci is active."
+ "\nBest Estimate of Present Value (PV) report includes contributions from the [Present Value](../Import/ImportScopeCalculation#present-values) calculation. The result of the Locked-in calculation is used when the Valuation Approach is BBA and the flag for Oci is active."
]
},
{
@@ -368,7 +368,7 @@
"",
"\n## LIC Actuarial (Actuarial Liability for Incurred Claims)",
"\n",
- "\nLiability of Incurred Claims (LIC Actuarial) report includes the contributions from [Fulfillment cashflow](#fulfillment-cashflows)."
+ "\nActuarial Liability of Incurred Claims (LIC Actuarial) report includes the contributions from [Fulfillment cashflow](#fulfillment-cashflows)."
]
},
{
@@ -413,7 +413,7 @@
"",
"\n## LRC Actuarial (Actuarial Liability for Remaining Coverage)",
"\n",
- "\nLiability for Remaining Coverage (LRC) report includes all the contributions from [Fulfillment cashflow](#fulfillment-cashflows), [Contructual Sevice Margin](#technical-margin), [Loss Component](#technical-margin), and [Loss Recovery Component](#technical-margin)."
+ "\nActuarial Liability for Remaining Coverage (LRC) report includes all the contributions from [Fulfillment cashflow](#fulfillment-cashflows), [Contructual Sevice Margin](#technical-margin), [Loss Component](#technical-margin), and [Loss Recovery Component](#technical-margin)."
]
},
{
@@ -459,7 +459,7 @@
{
"cell_type": "markdown",
"source": [
- "",
+ "",
"\n# IFRS 17 Financial Performance"
]
},
diff --git a/ifrs17/Utils/Extensions.ipynb b/ifrs17/Utils/Extensions.ipynb
index 0eb9c443..e006c87e 100644
--- a/ifrs17/Utils/Extensions.ipynb
+++ b/ifrs17/Utils/Extensions.ipynb
@@ -17,6 +17,12 @@
"nbformat": 4,
"nbformat_minor": 5,
"cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ " Extention Methods
Import Calculation Methods
Queries Test Helper Methods