Overrides

You can temporarily override any value in your dataset. This can be very useful to perform analysis. An override consists of three fields:

  1. The Field (ie the column where you seek to override values). Note: at the time of writing you can only override bool, str, number, list of numbers types of columns.
  2. The New Value.
  3. The Filters. ie when to override the existing with the new value.

Let's do a couple of examples. Notice that under BCBS page 59 table 2. the default risk weight is almost the same as under CRR2. Assuming that AA is Credit Quality Step 1, if we change the risk weight to 0.005 we would expect to get the same outcome. Let's test this out:


request = dict(
    filters=[],
    groupby=["RiskClass", "Desk"],
    overrides=[
        {
            "field": "SensWeights",
            "value": "[0.005]",
            "filters": [
                [{"op": "Eq", "field": "RiskClass", "value": "DRC_nonSec"}],
                [{"op": "Eq", "field": "CreditQuality", "value": "AA"}],
            ],
        }
    ],
    measures=[["DRC nonSec CapitalCharge", "scalar"]],
    hide_zeros=True,
    calc_params={
        "jurisdiction": "BCBS",
        "drc_offset": "false",
    },
)
result = ds.compute(request)

request = dict(
print(result)

Note that SensWeights is a list of numbers column (because of multiple tenors) and therefore we write it as a list [0.005].

Let's compare this to a run without overrides but with jurisdiction == CRR2:

request = dict(
    filters=[],
    groupby=["RiskClass", "Desk"],
    measures=[["DRC nonSec CapitalCharge", "scalar"]],
    hide_zeros=True,
    calc_params={
        "jurisdiction": "CRR2",
        "drc_offset": "false",
    },
)
result = ds.compute(request)
print(result)

Results should match!