認識信用風險

以 Python 進行信用風險建模

Michael Crabtree

Data Scientist, Ford Motor Company

什麼是信用風險?

  • 借款人可能無法全額償還的可能性
  • 放款給個人與購買政府公債的風險差異(經計算)
  • 借款人未依約還款稱為「違約」
  • 借款人發生違約的可能性稱為違約機率(PD)
以 Python 進行信用風險建模

什麼是信用風險?

  • 借款人可能無法全額償還的可能性
  • 放款給個人與購買政府公債的風險差異(經計算)
  • 借款人未依約還款稱為「違約」
  • 借款人發生違約的可能性稱為違約機率(PD)
Payment Payment Date Loan Status
$100 Jun 15 Non-Default
$100 Jul 15 Non-Default
$0 Aug 15 Default
以 Python 進行信用風險建模

預期損失(Expected loss)

  • 因貸款違約造成的金額損失
  • 三個主要組成:
    • 違約機率(PD)
    • 違約曝險金額(EAD)
    • 違約損失率(LGD)

預期損失公式:

expected_loss = PD * EAD * LGD
以 Python 進行信用風險建模

使用的資料類型

主要使用兩類資料:

  • 申請資料
  • 行為資料
Application Behavioral
Interest Rate Employment Length
Grade Historical Default
Amount Income
以 Python 進行信用風險建模

資料欄位

  • 混合行為與申請兩類
  • 包含模擬聯徵中心資料的欄位
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
以 Python 進行信用風險建模

用交叉表探索資料

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

以平均利率呈現房屋持有與貸款狀態的交叉表

以 Python 進行信用風險建模

用視覺化探索資料

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()

貸款利率與個人收入的散佈圖

以 Python 進行信用風險建模

一起來練習吧!

以 Python 進行信用風險建模

Preparing Video For Download...