FRTB P&L Attribution Tests and Backtesting
Accelerator Cube Specification and File Format
Overview
This page describes the implementation of P&L Attribution Tests and Backtesting in the ActiveViam FRTB Accelerator.
Supported Use Cases
The P&L Attribution Tests and Backtesting have been designed to enable the following use cases.
- Monitoring historical VaR and P&L values at the desk and firm-wide 1 levels, as required by regulation.
- Calculating desk and firm-wide VaR values from trade level VaR P&L vectors.
- Customising 2 trade level inputs and analytics to support analysing recent exceptions/outliers.
Definitions 3
-
T-1: the most recent close of business. This is the AsOfDate in the cube.
- T-n: close of business for the nth preceding business day.
-
Actual P&L [APL]. As-of T-1, the daily P&L (from T-2 to T-1) of the desk (or firm-wide) based on actual prices 4 and including trading activity 5.
-
Hypothetical P&L [HPL]. As-of T-1, the daily P&L value (from T-2 to T-1) of the desk (or firm-wide) based on actual prices for the T-2 portfolio 6.
-
Risk-Theoretical P&L [RTPL]. As-of T-1, the daily P&L (from T-2 to T-1) of the desk (or firm-wide) based on model-generated prices for the T-2 portfolio.
-
VaR measures. As-of T-1, the model-generated one-day value-at-risk measures for the T-1 portfolio.
Note: the as-of T-1 VaR measures are interpreted as a prediction of P&L for COB T. So, when comparing with the P&L values, the VaR measures need to be shifted by one day.
-
p-values 7: As-of T-1, the empirical probability of observing a profit that is less than (or loss greater than) the actual (or hypothetical) P&L 8.
Cube Overview
There are two cubes which are tied together via FRTBCombinedCube:
- The PLCube for recent data at the trade level (where investigations and sign-off can take place)
- The PLSummaryCube for historical data at the book and legal entity levels (to fill out one-year history)
- The FRTBCombinedCube seamlessly ties the two together.
The PL Cube:
- Collects recent data at the trade (or position) level, including the VaR P&L vectors.
- It is expected that this cube will be customised to support analysing exceptions/outliers.
- PL Cube data can be exported via PLCubeExport DEE Template Order found within the
directory
frtb-starter/src/main/resources/DEETemplateOrders/PLCubeExport.json
read more.
The PL Summary Cube:
- Collects aggregated data with a long history (at least the 1 year required by the regulations) at the desk and firm-wide levels. Including:
- Daily P&L values (actual, hypothetical, and risk-theoretical).
- Daily VaR P&L vectors
Combined Cube:
- Includes the analytics required for P&L Attribution Tests and Backtesting. Including:
- The Spearman correlation metric; i.e. the correlation between Risk-Theoretical P&L and Hypothetical P&L.
- The Kolmogorov-Smirnov test metric, i.e. the similarity of the distributions of Risk-Theoretical P&L and Hypothetical P&L.
- A count of the number of exceptions when comparing the Actual P&L and Hypothetical P&L against the VaR at the 97.5% and 99% confidence levels.
PL Cube
The PL cube is aimed at calculating desk and firm-wide VaR values from trade level VaR P&L vectors and, with customisation, supporting the analysis of recent exceptions/outliers.
Input Files
PL_VaR_Vector.csv
File pattern match: PL_VaR_Vector*.csv The VaR P&L vectors
Field | Type | Description |
---|---|---|
AsOfDate | Date [YYYY-MM-DD] | The as-of date (T-1). |
Trade | String | The trade ID (or Position ID for fungible instrument) |
Currency | String | Currency of VaR P&L Vector values |
Actual PL | Double | Actual P&L value (for desk, as-of T-1) |
Hypothetical PL | Double | Hypothetical P&L value (for desk, as-of T-1) |
Theoretical PL | Double | Risk-Theoretical P&L value (for desk, as-of T-1) |
PL | Vector | VaR P&L vector (for desk, as-of T-1) |
PL_VaR_Scenario.csv
File pattern match: PL_VaR_Scenario*.csv A description of the VaR scenarios.
Field | Type | Description |
---|---|---|
AsOfDate | Date [YYYY-MM-DD] | The as-of date (T-1). |
Index | Unsigned Integer | The index of the VaR scenario (within the VaR P&L vector) |
Scenario | String | The name of the VaR scenario |
Shared files
The following files are shared with the IMA cube and used to map the trades into the organisation hierarchies.
- Trade_Attributes.csv
- BookParentChild.csv
- LegalEntityParentChild.csv
Hierarchies
Hierarchy | Level | Comments |
---|---|---|
Dates (slicing hierarchy) | AsOfDate | The as-of date (T-1). From the AsOfDate field in the VaR P&L Vectors file. |
Scenarios (analysis hierarchy) | Scenario | The scenario name. Used for expanding the VaR P&L Vectors. |
Additionally, the following organisational hierarchies are shared with the IMA cube:
- Books
- Desks
- FRTBModel
- Trades
- Legal Entities
- BookHierarchy
PL Summary Cube
The PL Summary cube is aimed at desk and firm-wide monitoring of the P&L Attribution Tests and Backtesting.
It contains aggregated data with at least a year of history including:
- Daily P&L values (Actual, Hypothetical, and Risk-Theoretical)
- Daily VaR P&L vectors
This cube can be customised to add KPIs to monitor the above metrics, and workflows to manage exceptions.
Input Files
PL_Summary.csv
File pattern match: PL_Summary*.csv
This file contains all the data for the PL Summary cube.
Field | Type | Description |
---|---|---|
AsOfDate | Date [YYYY-MM-DD] | The as-of date (T-1). |
Book | String | The Book |
Legal Entity | String | The Legal Entity |
CCY | String | Currency of P&L and VaR values |
Actual P&L | Double | Actual P&L value (for desk, as-of T-1) |
Hypothetical P&L | Double | Hypothetical P&L value (for desk, as-of T-1) |
Theoretical P&L | Double | Risk-Theoretical P&L value (for desk, as-of T-1) |
PL | Vector | VaR P&L vector (for desk, as-of T-1) |
The key fields for this file are AsOfDate, Book and Legal Entity .
Hierarchies
Hierarchy | Level | Comments |
---|---|---|
Dates (slicing hierarchy) | AsOfDate | The as-of date (T-1). From the AsOfDate field in the input file. |
Book (slicing hierarchy)** | Desk | The Book field in the input file. |
Legal Entity (slicing hierarchy)** | Legal Entity | The Legal Entity field in the input file. |
Lookback (analysis hierarchy) | Lookback | The past date. Used for expanding the P&L values for P&L Attribution Test analytics. |
Measures
Both Cubes share the same measures which are seamlessly tied together within the FRTBCombinedCube.
-
Common Measures:
- VaR PL: A technical vector-valued measure from the PL field in the input files (after currency conversion).
- VaR PL Expand: VaR PL Vector expanded along the Scenario analysis hierarchy.
- Hypothetical PL: from input file (after currency conversion).
- Actual PL: from input file (after currency conversion).
- Theoretical PL: from input file (after currency conversion).
- Unexplained PL: difference between Theoretical PL and Hypothetical PL.
- VaR 99: The value-at-risk with 99% confidence level [^9].
- VaR 97.5: The value-at-risk with 97.5% confidence level
- VaR 99 (previous day): VaR 99 of previous day (T-2)
- VaR 97.5 (previous day): VaR 97.5 of previous day (T-2)
- ES 99: The Expected Shortfall with 99% confidence level
- ES 97.5: The Expected Shortfall with 97.5% confidence level
- p-value (Actual): p value for Actual PL given PL Vector input as distribution.
- p-value (Hypothetical): p value for Hypothetical PL given PL Vector input as distribution.
- Exception 99 (Actual): Exception at 99% confidence level for Actual P&L
- 1 if Actual PL < VaR 99 (previous day);
- 0 otherwise.
- Exception 99 (Hypothetical): Exception at 99% confidence level for Hypothetical P&L
- 1 if Hypothetical PL < VaR 99 (previous day);
- 0 otherwise.
- Exception 97.5 (Actual): Exception at 97.5% confidence level for Actual P&L
- 1 if Actual PL < VaR 97.5 (previous day);
- 0 otherwise.
- Exception 97.5 (Hypothetical): Exception at 97.5% confidence level for Hypothetical P&L
- 1 if Hypothetical PL < VaR 97.5 (previous day);
- 0 otherwise.
- Outlier 99: MAX(Exception 99 (Actual), Exception 99 (Hypothetical)).
- Outlier 97.5: MAX(Exception 97.5 (Actual), Exception 97.5 (Hypothetical)).
-
FRTBCombinedCube Measures
- For PL Attribution Tests:
- Spearman Correlation Metric: the correlation between RTPL and HPL
- Kolmogorov-Smirnov Test Metric: the similarity of the distributions of RTPL and HPL.
- Hypothetical PL Lookback: The Hypothetical PL values expanded along the Lookback analysis hierarchy.
- Theoretical PL Lookback: The Theoretical PL values expanded along the Lookback analysis hierarchy.
- Variance Hypothetical PL: The Variance of historical Hypothetical PL data.
- For Backtesting
- Exception 99 Count (Actual) The number of Exceptions at the 99% confidence level over the past year using Actual PL.
- Exception 97.5 Count (Actual) The number of Exceptions at the 97.5% confidence level over the past year using Actual PL.
- Exception 99 Dates (Actual) An array of dates of the Exceptions at the 99% confidence level over the past year using Actual PL.
- Exception 97.5 Dates (Actual) An array of dates of the Exceptions at the 97.5% confidence level over the past year using Actual PL.
- Exception 99 Count (Hypothetical) The number of Exceptions at the 99% confidence level over the past year using Hypothetical PL.
- Exception 97.5 Count (Hypothetical) The number of Exceptions at the 97.5% confidence level over the past year using Hypothetical PL.
- Exception 99 Dates (Hypothetical) An array of dates of the Exceptions at the 99% confidence level over the past year using Hypothetical PL.
- Exception 97.5 Dates (Hypothetical) An array of dates of the Exceptions at the 97.5% confidence level over the past year using Hypothetical PL.
- Exception 99 Count MAX(Exception 99 Count (Actual) , Exception 99 Count (Hypothetical)).
- Exception 97.5 Count MAX(Exception 97.5 Count (Actual), Exception 97.5 Count (Hypothetical)).
- Extras
- Outlier 97.5 Count: The number of Exceptions at the 97.5% confidence level over the past year.
- Outlier 99 Count: The number of Exceptions at the 99% confidence level over the past year.
- For PL Attribution Tests:
FRTBCombinedCube Context Values
- PLALookback the number of business days to look back when calculating the Spearman correlation and KS test metrics for PLA Tests. This may also be expressed as a period, to look back a number of calendar days, for example, “1M”, “3M”, “1Y”.
- BackTestingLookback the number of business days to look back when counting the number of exceptions in the VaR backtesting. This may also be expressed as a period, to look back a number of calendar days, for example, “1M”, “3M”, “1Y”.
-
All IMA desks (i.e. excluding SA desks), as per the FAQ: BCBS 395 section 2.7 Q1. ↩︎
-
This use case relies heavily on custom inputs (for example, asset class) beyond what can be included in the Accelerator. ↩︎
-
Based on BCBS 352 paragraph 183 and Appendix B; BCBS 395/437 FAQs; and clarifications in BCBS 436. ↩︎
-
From BCBS 352 Appendix B: “the mark-to-market value of the trading desk’s instruments derived from the bank’s pricing models including all risk factors”. ↩︎
-
Excluding fees and commissions. ↩︎
-
Assuming no trading activity (from T-2 to T-1). ↩︎
-
Not required by regulations, but mentioned in BCBS 352 paragraph 182 (b) as something the supervisor may request. ↩︎
-
According to the model ↩︎