Perform a slot backtest to determine whether a portfolio's expected loss (EL) rate is greater than its mean realized loss rate for the year 2024. Use loss-given-default (LGD) data from the year 2024, and default data from the lookback period between years 2020 to 2024.
Load the portfolio LGD data.
The LGDData table contains loss-given-default (LGD) data for the portfolio. Each row of LGDData corresponds to a defaulted loan whose recovery period closed in 2023 or 2024. The RealizedLGD and RecoveryClosedYear table variables contain the realized LGD and the year the recovery period was closed.
Create a table that contains only the data for the year 2024.
Load the portfolio default data.
defaultData contains portfolio observations made in the lookback period between 2020 to 2024. The table variable Default indicates whether a loan defaulted in the year contained in ObservationYear. Each row of defaultData corresponds to a loan and observation year pair.
Use the groupsummary function to calculate the number of defaults in each observation year.
lookbackDefault=5×3 table
2020 100 22
2021 100 16
2022 100 37
2023 100 35
2024 100 40
lookbackDefault contains table variables ObservationYear, GroupCount, and sum_Default. For each year in ObservationYear, GroupCount and sum_Default, respectively, contain counts for the total number of loans and the number of defaulted loans in the portfolio.
Perform the hypothesis test using an EL rate of 0.177, the number of defaults and loans in lookbackDefault, and the realized LGDs in observationLGD. The EL rate is set by the portfolio's corresponding regulatory body.
Output = struct with fields:
RejectTest: 1
PValue: 0.0028
TestStatistic: 2.7652
CriticalValue: 1.6449
MeanDefaultRate: 0.3000
MeanDefaultRateVariance: 4.2000e-04
MeanObservedLGDRate: 0.7638
MeanObservedLGDRateVariance: 0.0012
MeanLossRate: 0.2292
MeanLossRateVariance: 3.5570e-04
ExpectedLossRate: 0.1770
ConfidenceLevel: 0.9500
The output shows that enough evidence exists to reject the null hypothesis that the portfolio's EL is greater than its mean loss rate.