probdefault
Likelihood of default for given dataset for a
compactCreditScorecard
object
Description
computes the probability of default for the pd
= probdefault(csc
,data
)compactCreditScorecard
(csc
) based on the
data
.
Examples
Calculate the Probability of Default for a compactCreditScorecard
Object with New Data
To create a compactCreditScorecard
object, first create a creditscorecard
object using the CreditCardData.mat
file to load the data
(using a dataset from Refaat 2011).
load CreditCardData.mat
sc = creditscorecard(data)
sc = creditscorecard with properties: GoodLabel: 0 ResponseVar: 'status' WeightsVar: '' VarNames: {'CustID' 'CustAge' 'TmAtAddress' 'ResStatus' 'EmpStatus' 'CustIncome' 'TmWBank' 'OtherCC' 'AMBalance' 'UtilRate' 'status'} NumericPredictors: {'CustID' 'CustAge' 'TmAtAddress' 'CustIncome' 'TmWBank' 'AMBalance' 'UtilRate'} CategoricalPredictors: {'ResStatus' 'EmpStatus' 'OtherCC'} BinMissingData: 0 IDVar: '' PredictorVars: {'CustID' 'CustAge' 'TmAtAddress' 'ResStatus' 'EmpStatus' 'CustIncome' 'TmWBank' 'OtherCC' 'AMBalance' 'UtilRate'} Data: [1200x11 table]
Before creating a compactCreditScorecard
object, you must use autobinning
and fitmodel
with the creditscorecard
object.
sc = autobinning(sc); sc = fitmodel(sc);
1. Adding CustIncome, Deviance = 1490.8527, Chi2Stat = 32.588614, PValue = 1.1387992e-08 2. Adding TmWBank, Deviance = 1467.1415, Chi2Stat = 23.711203, PValue = 1.1192909e-06 3. Adding AMBalance, Deviance = 1455.5715, Chi2Stat = 11.569967, PValue = 0.00067025601 4. Adding EmpStatus, Deviance = 1447.3451, Chi2Stat = 8.2264038, PValue = 0.0041285257 5. Adding CustAge, Deviance = 1441.994, Chi2Stat = 5.3511754, PValue = 0.020708306 6. Adding ResStatus, Deviance = 1437.8756, Chi2Stat = 4.118404, PValue = 0.042419078 7. Adding OtherCC, Deviance = 1433.707, Chi2Stat = 4.1686018, PValue = 0.041179769 Generalized linear regression model: logit(status) ~ 1 + CustAge + ResStatus + EmpStatus + CustIncome + TmWBank + OtherCC + AMBalance Distribution = Binomial Estimated Coefficients: Estimate SE tStat pValue ________ ________ ______ __________ (Intercept) 0.70239 0.064001 10.975 5.0538e-28 CustAge 0.60833 0.24932 2.44 0.014687 ResStatus 1.377 0.65272 2.1097 0.034888 EmpStatus 0.88565 0.293 3.0227 0.0025055 CustIncome 0.70164 0.21844 3.2121 0.0013179 TmWBank 1.1074 0.23271 4.7589 1.9464e-06 OtherCC 1.0883 0.52912 2.0569 0.039696 AMBalance 1.045 0.32214 3.2439 0.0011792 1200 observations, 1192 error degrees of freedom Dispersion: 1 Chi^2-statistic vs. constant model: 89.7, p-value = 1.4e-16
Use the creditscorecard
object with compactCreditScorecard
to create a compactCreditScorecard
object.
csc = compactCreditScorecard(sc)
csc = compactCreditScorecard with properties: Description: '' GoodLabel: 0 ResponseVar: 'status' WeightsVar: '' NumericPredictors: {'CustAge' 'CustIncome' 'TmWBank' 'AMBalance'} CategoricalPredictors: {'ResStatus' 'EmpStatus' 'OtherCC'} PredictorVars: {'CustAge' 'ResStatus' 'EmpStatus' 'CustIncome' 'TmWBank' 'OtherCC' 'AMBalance'}
Then use probdefault
with the compactCreditScorecard
object. For the purpose of illustration, suppose that a few rows from the original data are our "new" data. Use the data
input argument in the probdefault
function to obtain the probability of default using the newdata
.
newdata = data(10:20,:); pd = probdefault(csc,newdata)
pd = 11×1
0.3047
0.3418
0.2237
0.2793
0.3615
0.1653
0.3799
0.4055
0.4269
0.1915
⋮
Input Arguments
csc
— Compact credit scorecard model
compactCreditScorecard
object
Credit scorecard model, specified as a compactCreditScorecard
object.
To create a compactCreditScorecard
object, use
compactCreditScorecard
or compact
from
Financial Toolbox™.
data
— Dataset to apply probability of default rules
table
Dataset to apply probability of default rules, specified as a
MATLAB® table, where each row corresponds to individual
observations. The data must contain columns for each of the predictors
in the compactCreditScorecard
object.
Data Types: table
Output Arguments
pd
— Probability of default
array
Probability of default, returned as a
NumObs
-by-1
numerical array of
default probabilities.
More About
Default Probability
After the unscaled scores are computed (see Algorithms for Computing and Scaling Scores), the probability of the points being “Good” is represented by the following formula:
ProbGood = 1./(1 + exp(-UnscaledScores))
Thus, the probability of default is
pd = 1 - ProbGood
References
[1] Refaat, M. Credit Risk Scorecards: Development and Implementation Using SAS. lulu.com, 2011.
Version History
Introduced in R2019a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)