Main Content

Create saccr Object and Compute Regulatory Values for Multiple Portfolios Containing Multiple Asset Classes

This example shows how to create a saccr object for trades from three portfolios (Portfolios 7, 8, 9), each containing multiple asset classes with a netting set, collateral set, and collateral positions. The trades are:

Portfolio 7

  • Tr001 — Asset class (IR), 10 Year Interest Rate Swap in EUR

  • Tr002 — Asset class (FX), EUR/GBP Forward FX Swap (Trade Decomposition "1b")

  • Tr003 — Asset class (CR_SN), Single name CDS on Spain (Short Protection)

  • Tr004 — Asset class (CR_IX), CDS iTraxx Europe Crossover Index Receiver Option

  • Tr005 — Asset class (EQ_SN), Long Call Option on AAPL

  • Tr006 — Asset class (EQ_IX), Long Put Option on S&P500 Index

  • Tr007_SOpt — Asset class (CO), Long Put Option on CORN (sold option with premium paid)

Portfolio 7 has one netting set (N001), one collateral set (CSA01), and three collateral positions (ColPos01, ColPos02, ColPos03).

Portfolio 8

  • Tr008 — Asset class (EQ_IX), Long Variance Swap on EURO STOXX 50 (EQUITY_VOL trade)

  • Tr009 — Asset class (IR), 10 Year FedFunds / 3M SOFR Basis Swap (USD_BASIS trade)

Portfolio 8 has one netting set (N002), one collateral set (CSA02), and two collateral positions (ColPos04, ColPos05).

Portfolio 9

  • Tr010 — Asset class (CO), Short WTI Crude Futures Put Option

  • Tr011 — Asset class (CO), Long Gold Futures Call Option

  • Tr012 — Asset class (CO), Long Bitcoin Futures Call Option

Portfolio 9 has one netting set (N003), one collateral set (CSA03), and no collateral positions.

Define Data

Define the foreign exchange (FX) spot currency exchange rate table.

format("default");
Base = ["EUR";"GBP";"GBP"];
Quote = ["USD";"USD";"EUR"];
SpotRate = [1.0543;1.2195;1.1567];
FXSpotTable = table(Base,Quote,SpotRate)
FXSpotTable=3×3 table
    Base     Quote    SpotRate
    _____    _____    ________

    "EUR"    "USD"     1.0543 
    "GBP"    "USD"     1.2195 
    "GBP"    "EUR"     1.1567 

Define the SA-CCR CRIF file.

SACCRCRIF = "SACCR_CRIF_Ports_7_8_9.csv";

Create saccr Object

Construct the saccr object from SACCRCRIF.

mySACCR = saccr(SACCRCRIF, DomesticCurrency="USD", FXSpot=FXSpotTable)
mySACCR = 
  saccr with properties:

                         CRIF: [42x19 table]
                NumPortfolios: 3
                 PortfolioIDs: [3x1 string]
              CounterpartyIDs: [3x1 string]
                   Portfolios: [3x1 saccr.Portfolio]
                   Regulation: "Basel_CRE52"
             DomesticCurrency: "USD"
                        Alpha: [3x1 double]
                  FXSpotRates: [3x3 table]
          TradeDecompositions: [5x2 table]
           CollateralHaircuts: [200x6 table]
        SupervisoryParameters: [19x7 table]
    MaturityBusinessDaysFloor: 10
          NumBusinessDaysYear: 250

Display the contents of the SA-CCR CRIF file.

mySACCR.CRIF
ans=42×19 table
    PortfolioID     TradeID      CounterpartyName    CounterpartyID    NettingSetNumber    RiskType     Category                Qualifier               Bucket       Label1       Label2        Amount      AmountCurrency    AmountUSD        Regulation        Model      ValuationDate    EndDate    Label3
    ___________    __________    ________________    ______________    ________________    ________    ___________    _____________________________    _________    _________    _________    __________    ______________    __________    ________________    ________    _____________    _______    ______

    "Port_007"     "ColPos01"       <missing>          <missing>         "N001_CSA01"      "COLL"      "VM"           <missing>                        <missing>    <missing>    "CASH"            2e+05      "USD"                2e+05    "Basel (CRE 52)"    "SA-CCR"     2023-10-16        NaN        NaN 
    "Port_007"     "ColPos02"       <missing>          <missing>         "N001_CSA01"      "COLL"      "VM"           <missing>                        <missing>    <missing>    "CASH"          1.5e+05      "EUR"           1.5814e+05    "Basel (CRE 52)"    "SA-CCR"     2023-10-16        NaN        NaN 
    "Port_007"     "ColPos03"       <missing>          <missing>         "N001_CSA01"      "COLL"      "IM"           "SOVEREIGN"                      "AAA"        <missing>    "BOND"            5e+05      "USD"                5e+05    "Basel (CRE 52)"    "SA-CCR"     2023-10-16        1.5        NaN 
    "Port_007"     "CSA01"          <missing>          <missing>         "N001_CSA01"      "COLL"      "DIRECTION"    <missing>                        <missing>    "MUTUAL"     <missing>           NaN      <missing>              NaN    "Basel (CRE 52)"    "SA-CCR"     2023-10-16        NaN        NaN 
    "Port_007"     "CSA01"          <missing>          <missing>         "N001_CSA01"      "COLL"      "MPOR"         <missing>                        <missing>    "10"         <missing>           NaN      <missing>              NaN    "Basel (CRE 52)"    "SA-CCR"     2023-10-16        NaN        NaN 
    "Port_007"     "CSA01"          <missing>          <missing>         "N001_CSA01"      "COLL"      "MTA"          <missing>                        <missing>    <missing>    <missing>             0      "USD"                    0    "Basel (CRE 52)"    "SA-CCR"     2023-10-16        NaN        NaN 
    "Port_007"     "CSA01"          <missing>          <missing>         "N001_CSA01"      "COLL"      "TA"           <missing>                        <missing>    <missing>    <missing>             0      "USD"                    0    "Basel (CRE 52)"    "SA-CCR"     2023-10-16        NaN        NaN 
    "Port_007"     "Tr001"          <missing>          <missing>         "N001_CSA01"      "IR"        "EUR"          "EUR"                            <missing>    "0"          "10"         3.1478e+07      "EUR"           3.3187e+07    "Basel (CRE 52)"    "SA-CCR"     2023-10-16         10          1 
    "Port_007"     "Tr001"          <missing>          <missing>         "N001_CSA01"      "PV"        <missing>      <missing>                        <missing>    <missing>    <missing>       -5650.7      "EUR"              -5957.5    "Basel (CRE 52)"    "SA-CCR"     2023-10-16        NaN        NaN 
    "Port_007"     "Tr002_01"       <missing>          <missing>         "N001_CSA01"      "FX"        "EURGBP"       "EURGBP"                         <missing>    "0.5"        "0.5"             1e+06      "EUR"           1.0543e+06    "Basel (CRE 52)"    "SA-CCR"     2023-10-16        0.5         -1 
    "Port_007"     "Tr002_02"       <missing>          <missing>         "N001_CSA01"      "FX"        "EURGBP"       "EURGBP"                         <missing>    "0.5"        "1"               1e+06      "EUR"           1.0543e+06    "Basel (CRE 52)"    "SA-CCR"     2023-10-16          1          1 
    "Port_007"     "Tr002"          <missing>          <missing>         "N001_CSA01"      "PV"        <missing>      <missing>                        <missing>    <missing>    <missing>        1702.2      "GBP"               2075.9    "Basel (CRE 52)"    "SA-CCR"     2023-10-16        NaN        NaN 
    "Port_007"     "Tr003"          <missing>          <missing>         "N001_CSA01"      "CR_SN"     "CREDIT"       "SPAIN"                          "A"          "0"          "5"           2.212e+07      "EUR"           2.3321e+07    "Basel (CRE 52)"    "SA-CCR"     2023-10-16          5         -1 
    "Port_007"     "Tr003"          <missing>          <missing>         "N001_CSA01"      "PV"        <missing>      <missing>                        <missing>    <missing>    <missing>        -62783      "EUR"               -66192    "Basel (CRE 52)"    "SA-CCR"     2023-10-16        NaN        NaN 
    "Port_007"     "Tr004"          <missing>          <missing>         "N001_CSA01"      "CR_IX"     "CREDIT"       "CDS iTraxx Europe Crossover"    "SG"         "0.5"        "4.5"        3.5359e+07      "EUR"           3.7279e+07    "Basel (CRE 52)"    "SA-CCR"     2023-10-16        4.5       -0.4 
    "Port_007"     "Tr004"          <missing>          <missing>         "N001_CSA01"      "PV"        <missing>      <missing>                        <missing>    <missing>    <missing>    5.2464e+05      "EUR"           5.5313e+05    "Basel (CRE 52)"    "SA-CCR"     2023-10-16        NaN        NaN 
      ⋮

Display Three Portfolios and Trades

Display the number of portfolios and their IDs.

mySACCR.NumPortfolios
ans = 
3
mySACCR.PortfolioIDs
ans = 3x1 string
    "Port_007"
    "Port_008"
    "Port_009"

Display the properties of each of the three Portfolio objects (Port_007, Port_008, Port_009).

mySACCR.Portfolios(1)
ans = 
  Portfolio with properties:

                ID: "Port_007"
    CounterpartyID: ""
            Trades: [7x1 saccr.Trade]
       NettingSets: [1x1 saccr.NettingSet]
      AssetClasses: [7x1 string]

mySACCR.Portfolios(2)
ans = 
  Portfolio with properties:

                ID: "Port_008"
    CounterpartyID: ""
            Trades: [2x1 saccr.Trade]
       NettingSets: [1x1 saccr.NettingSet]
      AssetClasses: [2x1 string]
       HedgingSets: [2x1 string]

mySACCR.Portfolios(3)
ans = 
  Portfolio with properties:

                ID: "Port_009"
    CounterpartyID: "Exchange"
            Trades: [3x1 saccr.Trade]
       NettingSets: [1x1 saccr.NettingSet]
      AssetClasses: "CO"
       HedgingSets: [3x1 string]

Display Trades

Display some of the trades (Tr001, Tr004, Tr007_SOpt) for Portfolio 1 (Port_007).

mySACCR.Portfolios(1).Trades(1)
ans = 
  Trade with properties:

                                ID: "Tr001"
                      NettingSetID: "N001"
                   CollateralSetID: "CSA01"
                        AssetClass: "IR"
                          SubClass: <missing>
                        HedgingSet: "EUR"
                         Qualifier: "EUR"
                  AdjustedNotional: 3.1478e+07
          AdjustedNotionalCurrency: "EUR"
               AdjustedNotionalUSD: 3.3187e+07
                                PV: -5.6507e+03
                        PVCurrency: "EUR"
                             PVUSD: -5.9575e+03
                         StartTime: 0
                           EndTime: 10
                      MaturityTime: 10
                  SupervisoryDelta: 1
                      InputVariant: "1a"
                        SoldOption: 0
    MaturityFactorUncollateralized: 1
      MaturityFactorCollateralized: 0.3000
                    MaturityBucket: "B3: > 5Y"

mySACCR.Portfolios(1).Trades(4)
ans = 
  Trade with properties:

                                ID: "Tr004"
                      NettingSetID: "N001"
                   CollateralSetID: "CSA01"
                        AssetClass: "CR_IX"
                          SubClass: "SG"
                        HedgingSet: "CREDIT"
                         Qualifier: "CDS iTraxx Europe Crossover"
                  AdjustedNotional: 3.5359e+07
          AdjustedNotionalCurrency: "EUR"
               AdjustedNotionalUSD: 3.7279e+07
                                PV: 5.2464e+05
                        PVCurrency: "EUR"
                             PVUSD: 5.5313e+05
                         StartTime: 0.5000
                           EndTime: 4.5000
                      MaturityTime: 4.5000
                  SupervisoryDelta: -0.4000
                      InputVariant: "1a"
                        SoldOption: 0
    MaturityFactorUncollateralized: 1
      MaturityFactorCollateralized: 0.3000
                    MaturityBucket: [0x1 string]

mySACCR.Portfolios(1).Trades(7)
ans = 
  Trade with properties:

                                ID: "Tr007_SOpt"
                      NettingSetID: "N001"
                   CollateralSetID: "CSA01"
                        AssetClass: "CO"
                          SubClass: "AGRICULTURAL"
                        HedgingSet: "AGRI"
                         Qualifier: "CORN"
                  AdjustedNotional: 1.0435e+05
          AdjustedNotionalCurrency: "USD"
               AdjustedNotionalUSD: 1.0435e+05
                                PV: -9.7215e+03
                        PVCurrency: "USD"
                             PVUSD: -9.7215e+03
                         StartTime: 0
                           EndTime: 0.5000
                      MaturityTime: 0.5000
                  SupervisoryDelta: -0.3600
                      InputVariant: "1a"
                        SoldOption: 1
    MaturityFactorUncollateralized: 0.7071
      MaturityFactorCollateralized: 0.3000
                    MaturityBucket: [0x1 string]

Display trades (Tr008, Tr009) for Portfolio 2 (Port_008).

mySACCR.Portfolios(2).Trades(1)
ans = 
  Trade with properties:

                                ID: "Tr008"
                      NettingSetID: "N002"
                   CollateralSetID: "CSA02"
                        AssetClass: "EQ_IX"
                          SubClass: <missing>
                        HedgingSet: "EQUITY_VOL"
                         Qualifier: "STOXX50.VOL"
                  AdjustedNotional: 1000000
          AdjustedNotionalCurrency: "EUR"
               AdjustedNotionalUSD: 1054300
                                PV: 2.7244e+05
                        PVCurrency: "EUR"
                             PVUSD: 2.8723e+05
                         StartTime: 0
                           EndTime: 5
                      MaturityTime: 5
                  SupervisoryDelta: 1
                      InputVariant: "1a"
                        SoldOption: 0
    MaturityFactorUncollateralized: 1
      MaturityFactorCollateralized: 0.4243
                    MaturityBucket: [0x1 string]

mySACCR.Portfolios(2).Trades(2)
ans = 
  Trade with properties:

                                ID: "Tr009"
                      NettingSetID: "N002"
                   CollateralSetID: "CSA02"
                        AssetClass: "IR"
                          SubClass: <missing>
                        HedgingSet: "USD_BASIS"
                         Qualifier: "FedFunds_3MSOFR"
                  AdjustedNotional: 7.8694e+07
          AdjustedNotionalCurrency: "USD"
               AdjustedNotionalUSD: 7.8694e+07
                                PV: 8.9342e+05
                        PVCurrency: "USD"
                             PVUSD: 8.9342e+05
                         StartTime: 0
                           EndTime: 10
                      MaturityTime: 10
                  SupervisoryDelta: -1
                      InputVariant: "1a"
                        SoldOption: 0
    MaturityFactorUncollateralized: 1
      MaturityFactorCollateralized: 0.4243
                    MaturityBucket: "B3: > 5Y"

Display trades (Tr010, Tr011, Tr012) for Portfolio 3 (Port_009).

mySACCR.Portfolios(3).Trades(1)
ans = 
  Trade with properties:

                                ID: "Tr010"
                      NettingSetID: "N003"
                   CollateralSetID: "CA03"
                        AssetClass: "CO"
                          SubClass: "OIL/GAS"
                        HedgingSet: "ENERGY"
                         Qualifier: "WTI"
                  AdjustedNotional: 2000000
          AdjustedNotionalCurrency: "USD"
               AdjustedNotionalUSD: 2000000
                                PV: 0
                        PVCurrency: "USD"
                             PVUSD: 0
                         StartTime: 0
                           EndTime: 0.7500
                      MaturityTime: 0.7500
                  SupervisoryDelta: 0.6100
                      InputVariant: "1a"
                        SoldOption: 0
    MaturityFactorUncollateralized: 0.8660
      MaturityFactorCollateralized: 0.3000
                    MaturityBucket: [0x1 string]

mySACCR.Portfolios(3).Trades(2)
ans = 
  Trade with properties:

                                ID: "Tr011"
                      NettingSetID: "N003"
                   CollateralSetID: "CA03"
                        AssetClass: "CO"
                          SubClass: "METALS"
                        HedgingSet: "METALS"
                         Qualifier: "XAU"
                  AdjustedNotional: 3.3526e+05
          AdjustedNotionalCurrency: "USD"
               AdjustedNotionalUSD: 3.3526e+05
                                PV: 0
                        PVCurrency: "USD"
                             PVUSD: 0
                         StartTime: 0
                           EndTime: 0.5000
                      MaturityTime: 0.5000
                  SupervisoryDelta: 0.4200
                      InputVariant: "1a"
                        SoldOption: 0
    MaturityFactorUncollateralized: 0.7071
      MaturityFactorCollateralized: 0.3000
                    MaturityBucket: [0x1 string]

mySACCR.Portfolios(3).Trades(3)
ans = 
  Trade with properties:

                                ID: "Tr012"
                      NettingSetID: "N003"
                   CollateralSetID: "CA03"
                        AssetClass: "CO"
                          SubClass: "OTHER"
                        HedgingSet: "OTHER"
                         Qualifier: "BITCOIN"
                  AdjustedNotional: 1.4791e+05
          AdjustedNotionalCurrency: "USD"
               AdjustedNotionalUSD: 1.4791e+05
                                PV: 0
                        PVCurrency: "USD"
                             PVUSD: 0
                         StartTime: 0
                           EndTime: 0.7500
                      MaturityTime: 0.7500
                  SupervisoryDelta: 0.5800
                      InputVariant: "1a"
                        SoldOption: 0
    MaturityFactorUncollateralized: 0.8660
      MaturityFactorCollateralized: 0.3000
                    MaturityBucket: [0x1 string]

Display Netting Sets for Three Portfolios

Display the NettingSet object (N001) for Portfolio 1 (Port_007).

mySACCR.Portfolios(1).NettingSets
ans = 
  NettingSet with properties:

                ID: "N001"
    CollateralSets: [1x1 saccr.CollateralSet]

Display the NettingSet object (N002) for Portfolio 2 (Port_008).

mySACCR.Portfolios(2).NettingSets
ans = 
  NettingSet with properties:

                ID: "N002"
    CollateralSets: [1x1 saccr.CollateralSet]

Display the NettingSet object (N003) for Portfolio 3 (Port_009).

mySACCR.Portfolios(3).NettingSets
ans = 
  NettingSet with properties:

                ID: "N003"
    CollateralSets: [1x1 saccr.CollateralSet]

Display Collateral Sets for Three Portfolios

Display details for the CollateralSet object (CSA01) for Portfolio 1 (Port_007).

mySACCR.Portfolios(1).NettingSets.CollateralSets
ans = 
  CollateralSet with properties:

                     ID: "CSA01"
           NettingSetID: "N001"
              Direction: "MUTUAL"
              Threshold: 0
      ThresholdCurrency: "USD"
                    MTA: 0
            MTACurrency: "USD"
                   MPOR: 10
                    STM: 0
    CollateralPositions: [3x1 saccr.CollateralPosition]

Display details for the CollateralSet object (CSA02) for Portfolio 2 (Port_008).

mySACCR.Portfolios(2).NettingSets.CollateralSets
ans = 
  CollateralSet with properties:

                     ID: "CSA02"
           NettingSetID: "N002"
              Direction: "MUTUAL"
              Threshold: 1000000
      ThresholdCurrency: "USD"
                    MTA: 100000
            MTACurrency: "USD"
                   MPOR: 20
                    STM: 0
    CollateralPositions: [2x1 saccr.CollateralPosition]

Display details for the CollateralSet object (CSA03) for Portfolio 3 (Port_009).

mySACCR.Portfolios(3).NettingSets.CollateralSets
ans = 
  CollateralSet with properties:

                     ID: "CA03"
           NettingSetID: "N003"
              Direction: "MUTUAL"
              Threshold: 500000
      ThresholdCurrency: "USD"
                    MTA: 50000
            MTACurrency: "USD"
                   MPOR: 10
                    STM: 0
    CollateralPositions: [0x1 saccr.CollateralPosition]

Display Collaterl Positions for Three Portfolios

Display the CollateralPosition objects (ColPos01, ColPos02, ColPos03) for Portfolio 1 (Port_007).

mySACCR.Portfolios(1).NettingSets.CollateralSets.CollateralPositions(1)
ans = 
  CollateralPosition with properties:

                  ID: "ColPos01"
        NettingSetID: "N001"
     CollateralSetID: "CSA01"
          MarginType: "VM"
            Currency: "USD"
            Notional: 200000
         NotionalUSD: 200000
        MaturityTime: NaN
          Segregated: 0
              Rating: <missing>
           AssetType: "CASH"
             SubType: <missing>
    ResidualMaturity: [0x0 string]

mySACCR.Portfolios(1).NettingSets.CollateralSets.CollateralPositions(2)
ans = 
  CollateralPosition with properties:

                  ID: "ColPos02"
        NettingSetID: "N001"
     CollateralSetID: "CSA01"
          MarginType: "VM"
            Currency: "EUR"
            Notional: 150000
         NotionalUSD: 158145
        MaturityTime: NaN
          Segregated: 0
              Rating: <missing>
           AssetType: "CASH"
             SubType: <missing>
    ResidualMaturity: [0x0 string]

mySACCR.Portfolios(1).NettingSets.CollateralSets.CollateralPositions(3)
ans = 
  CollateralPosition with properties:

                  ID: "ColPos03"
        NettingSetID: "N001"
     CollateralSetID: "CSA01"
          MarginType: "IM"
            Currency: "USD"
            Notional: 500000
         NotionalUSD: 500000
        MaturityTime: 1.5000
          Segregated: 0
              Rating: "AAA"
           AssetType: "BOND"
             SubType: "SOVEREIGN"
    ResidualMaturity: "> 1Y, <= 3Y"

Display the CollateralPosition objects (ColPos04, ColPos05) for Portfolio 2 (Port_008).

mySACCR.Portfolios(2).NettingSets.CollateralSets.CollateralPositions(1)
ans = 
  CollateralPosition with properties:

                  ID: "ColPos04"
        NettingSetID: "N002"
     CollateralSetID: "CSA02"
          MarginType: "VM"
            Currency: "USD"
            Notional: 100000
         NotionalUSD: 10000
        MaturityTime: NaN
          Segregated: 0
              Rating: <missing>
           AssetType: "EQUITY"
             SubType: "MAININDEX"
    ResidualMaturity: [0x0 string]

mySACCR.Portfolios(2).NettingSets.CollateralSets.CollateralPositions(2)
ans = 
  CollateralPosition with properties:

                  ID: "ColPos05"
        NettingSetID: "N002"
     CollateralSetID: "CSA02"
          MarginType: "IM"
            Currency: "USD"
            Notional: 250000
         NotionalUSD: 25000
        MaturityTime: NaN
          Segregated: 0
              Rating: <missing>
           AssetType: "GOLD"
             SubType: <missing>
    ResidualMaturity: [0x0 string]

Compute Replacement Cost

Compute replacement cost (RC) component results using rc.

RCResults = rc(mySACCR)
RCResults = 
  RCResults with properties:

         NumPortfolios: 3
          PortfolioIDs: [3x1 string]
       CounterpartyIDs: [3x1 string]
            Regulation: "Basel_CRE52"
      DomesticCurrency: "USD"
    RCUncollateralized: [3x1 double]
      RCCollateralized: [3x1 double]

RCResults.RCUncollateralized
ans = 3×1
106 ×

    0.2397
    1.1806
         0

RCResults.RCCollateralized
ans = 3×1
106 ×

         0
    1.1555
    0.5500

Create a bar chart of portfolio RC values using rcChart.

rcChart(mySACCR,Style="comparison")
ax = gca;
ax.YAxis.Exponent = 0;
ytickformat('%.0f')

Figure contains an axes object. The axes object with title Final, Uncollateralized and Collateralized RCs, xlabel Portfolio IDs, ylabel USD contains 3 objects of type bar. These objects represent Final RC, Uncollateralized RC, Collateralized RC.

Compute Add-On Component

Compute add-on component results using addOn.

AddOnResults = addOn(mySACCR)
AddOnResults = 
  AddOnResults with properties:

                        NumPortfolios: 3
                         PortfolioIDs: [3x1 string]
                      CounterpartyIDs: [3x1 string]
                           Regulation: "Basel_CRE52"
                     DomesticCurrency: "USD"
       AddOnAggregateUncollateralized: [3x1 double]
         AddOnAggregateCollateralized: [3x1 double]
    AddOnAssetClassesUncollateralized: [1x1 saccr.AddOnAssetClassResults]
      AddOnAssetClassesCollateralized: [1x1 saccr.AddOnAssetClassResults]

AddOnResults.AddOnAggregateUncollateralized
ans = 3×1
106 ×

    1.1177
    1.2510
    0.2215

AddOnResults.AddOnAggregateCollateralized
ans = 3×1
105 ×

    3.3218
    5.3077
    0.7812

Create a bar chart of portfolio add-on values using addOnChart.

addOnChart(mySACCR,Style="breakdown")
ax = gca;
ax.YAxis.Exponent = 0;
ytickformat('%.0f')

Figure contains an axes object. The axes object with title Add-On Contribution Breakdown, xlabel Portfolio IDs, ylabel USD contains 5 objects of type bar. These objects represent IR Add-On, FX Add-On, CR Add-On, EQ Add-On, CO Add-On.

Compute PFE

Compute potential future exposure (PFE) component results using pfe.

PFEResults = pfe(mySACCR)
PFEResults = 
  PFEResults with properties:

                 NumPortfolios: 3
                  PortfolioIDs: [3x1 string]
               CounterpartyIDs: [3x1 string]
                    Regulation: "Basel_CRE52"
              DomesticCurrency: "USD"
           PFEUncollateralized: [3x1 double]
             PFECollateralized: [3x1 double]
    MultiplierUncollateralized: [3x1 double]
      MultiplierCollateralized: [3x1 double]
                  AddOnResults: [1x1 saccr.AddOnResults]

PFEResults.PFEUncollateralized
ans = 3×1
106 ×

    1.1177
    1.2510
    0.2215

PFEResults.PFECollateralized
ans = 3×1
105 ×

    2.6710
    5.3077
    0.7812

Create a bar chart of portfolio PFE values using pfeChart.

pfeChart(mySACCR,Style="breakdown")
ax = gca;
ax.YAxis.Exponent = 0;
ytickformat('%.0f')

Figure contains an axes object. The axes object with title PFE Contribution Breakdown, xlabel Portfolio IDs, ylabel USD contains 2 objects of type bar. These objects represent Aggregate Add-On, Multiplier Effect.

Compute EAD and Display Results

Compute exposure at default (EAD) results using ead and show the results table.

EADResults = ead(mySACCR)
EADResults = 
  EADResults with properties:

       NumPortfolios: 3
        PortfolioIDs: [3x1 string]
     CounterpartyIDs: [3x1 string]
          Regulation: "Basel_CRE52"
    DomesticCurrency: "USD"
                 EAD: [3x1 double]
               Alpha: [3x1 double]
                  RC: [3x1 double]
                 PFE: [3x1 double]
          Multiplier: [3x1 double]
      AddOnAggregate: [3x1 double]
           RCResults: [1x1 saccr.RCResults]
          PFEResults: [1x1 saccr.PFEResults]
        ResultsTable: [3x17 table]

EADResults.ResultsTable
ans=3×17 table
    PortfolioIDs    CounterpartyIDs     Regulation      DomesticCurrency       EAD        Alpha        RC           PFE        Multiplier    AddOnAggregate    AddOnIR    AddOnFX    AddOnCR     AddOnEQ       AddOnCO      Collateralized    UsedCollateral
    ____________    _______________    _____________    ________________    __________    _____    __________    __________    __________    ______________    _______    _______    _______    __________    __________    ______________    ______________

     "Port_007"       ""               "Basel_CRE52"         "USD"          3.7394e+05     1.4              0     2.671e+05     0.80408        3.3218e+05       49780        0        65013     2.1536e+05        2028.6        true              true      
     "Port_008"       ""               "Basel_CRE52"         "USD"          2.3608e+06     1.4     1.1555e+06    5.3077e+05           1        5.3077e+05       83467        0            0      4.473e+05             0        true              true      
     "Port_009"       "Exchange"       "Basel_CRE52"         "USD"          3.1006e+05     1.4              0    2.2147e+05           1        2.2147e+05           0        0            0              0    2.2147e+05        true              false     

Create a bar chart of portfolio EAD values using eadChart.

eadChart(mySACCR,Style="breakdown")
ax = gca;
ax.YAxis.Exponent = 0;
ytickformat('%.0f')

Figure contains an axes object. The axes object with title EAD Contribution Breakdown, xlabel Portfolio IDs, ylabel USD contains 3 objects of type bar. These objects represent RC, PFE, Alpha Scaling Effect.

Aggregate EAD Results by Counterparty

Aggregate EAD results using aggregateByCounterparty.

aggregateByCounterparty(EADResults)
ans=2×2 table
    CounterpartyID    CounterpartyEAD
    ______________    _______________

      ""                2.7348e+06   
      "Exchange"        3.1006e+05   

Aggregate Total EAD Results

Aggregate total EAD using aggregate.

aggregate(EADResults)
ans = 
3.0449e+06

See Also

| | | | | | | |

Related Examples

More About