Understanding credit risk

Credit Risk Modeling in Python

Michael Crabtree

Data Scientist, Ford Motor Company

What is credit risk?

  • The possibility that someone who has borrowed money will not repay it all
  • Calculated risk difference between lending someone money and a government bond
  • When someone fails to repay a loan, it is said to be in default
  • The likelihood that someone will default on a loan is the probability of default (PD)
Credit Risk Modeling in Python

What is credit risk?

  • The possibility that someone who has borrowed money will not repay it all
  • Calculated risk difference between lending someone money and a government bond
  • When someone fails to repay a loan, it is said to be in default
  • The likelihood that someone will default on a loan is the probability of default (PD)
Payment Payment Date Loan Status
$100 Jun 15 Non-Default
$100 Jul 15 Non-Default
$0 Aug 15 Default
Credit Risk Modeling in Python

Expected loss

  • The dollar amount the firm loses as a result of loan default
  • Three primary components:
    • Probability of Default (PD)
    • Exposure at Default (EAD)
    • Loss Given Default (LGD)

Formula for expected loss:

expected_loss = PD * EAD * LGD
Credit Risk Modeling in Python

Types of data used

Two Primary types of data used:

  • Application data
  • Behavioral data
Application Behavioral
Interest Rate Employment Length
Grade Historical Default
Amount Income
Credit Risk Modeling in Python

Data columns

  • Mix of behavioral and application
  • Contain columns simulating credit bureau data
Column Column
Income Loan grade
Age Loan amount
Home ownership Interest rate
Employment length Loan status
Loan intent Historical default
Percent Income Credit history length
Credit Risk Modeling in Python

Exploring with cross tables

pd.crosstab(cr_loan['person_home_ownership'], cr_loan['loan_status'],
            values=cr_loan['loan_int_rate'], aggfunc='mean').round(2)

Cross table of home ownership of loan status with average interest rate

Credit Risk Modeling in Python

Exploring with visuals

plt.scatter(cr_loan['person_income'], cr_loan['loan_int_rate'],c='blue', alpha=0.5)
plt.xlabel("Personal Income")
plt.ylabel("Loan Interest Rate")
plt.show()

Scatter plot of loan interest rate and person income

Credit Risk Modeling in Python

Let's practice!

Credit Risk Modeling in Python

Preparing Video For Download...