与信戦略と最小期待損失

Pythonで学ぶクレジットリスクモデリング

Michael Crabtree

Data Scientist, Ford Motor Company

受理率の選定

  • 最初の受理率は85%に設定。ただし他の率も選択可
  • 別の率を試す方法は2つ:
    • しきい値、不良率、損失を手計算
    • これらの値の表を自動作成し、受理率を選択
  • すべての候補値の表を戦略テーブルと呼ぶ
Pythonで学ぶクレジットリスクモデリング

戦略テーブルの準備

  • 各値を格納する配列/リストを用意
# Set all the acceptance rates to test
accept_rates = [1.0, 0.95, 0.9, 0.85, 0.8, 0.75, 0.7, 0.65, 0.6, 0.55,
                0.5, 0.45, 0.4, 0.35, 0.3, 0.25, 0.2, 0.15, 0.1, 0.05]
# Create lists to store thresholds and bad rates 
thresholds = []
bad_rates = []
Pythonで学ぶクレジットリスクモデリング

表の値を計算

  • 全受理率についてしきい値と不良率を算出
for rate in accept_rates:
    # Calculate threshold
    threshold = np.quantile(preds_df['prob_default'], rate).round(3)
    # Store threshold value in a list
    thresholds.append(np.quantile(preds_gbt['prob_default'], rate).round(3))
    # Apply the threshold to reassign loan_status
    test_pred_df['pred_loan_status'] = \ 
        test_pred_df['prob_default'].apply(lambda x: 1 if x > thresh else 0)
    # Create accepted loans set of predicted non-defaults
    accepted_loans = test_pred_df[test_pred_df['pred_loan_status'] == 0]
    # Calculate and store bad rate
    bad_rates.append(np.sum((accepted_loans['true_loan_status']) 
             / accepted_loans['true_loan_status'].count()).round(3))
Pythonで学ぶクレジットリスクモデリング

戦略テーブルの見方

strat_df = pd.DataFrame(zip(accept_rates, thresholds, bad_rates),
                        columns = ['Acceptance Rate','Threshold','Bad Rate'])

戦略テーブルと不良率バーの例

Pythonで学ぶクレジットリスクモデリング

受理件数の追加

  • 各受理率で受理される貸付件数
    • len() または .count() を使用

受理件数付きの戦略テーブル

Pythonで学ぶクレジットリスクモデリング

平均貸付額の追加

  • テストデータの平均 loan_amnt

平均貸付額付きの戦略テーブル

Pythonで学ぶクレジットリスクモデリング

ポートフォリオ価値の推定

  • 受理した非デフォルトの平均値 − 受理したデフォルトの平均値
  • 各デフォルトは loan_amnt の損失と仮定

推定ポートフォリオ価値付きの戦略テーブル

Pythonで学ぶクレジットリスクモデリング

合計期待損失

  • ポートフォリオ内デフォルトによる期待損失額

合計期待損失の式

# Probability of default (PD)
test_pred_df['prob_default']
# Exposure at default = loan amount (EAD)
test_pred_df['loan_amnt']
# Loss given default = 1.0 for total loss (LGD)
test_pred_df['loss_given_default']
Pythonで学ぶクレジットリスクモデリング

演習に進みましょう!

Pythonで学ぶクレジットリスクモデリング

Preparing Video For Download...