Single Probablity of Default

Overview

The simplest way to estimate the probability of default from a set of historical loan records is to mark the loans that have defaulted with a 1 and a 0 on loans that have not defaulted, and then to take the average of this column.

Note, once a loan has defaulted, the records of the defaulted loan after the default time should be removed. That is, there should be only one record per account that has 1 in the default column. The code below includes a filter function which filters out all records

The code given here is given in the script named "estimate" in the desktop.

Script

The estimate function takes an array of dictionaries with the following properties (columns)

  • account - is an id that identifies the account
  • date
  • default - is 1 if the loan has defaulted at the given date, and 0 otherwise
  • grade


def estimate_by_grade(data, periods = 1): grouped = defaultdict(list) for item in data: grouped[item['grade']].append(item) result = {} for grade in grouped: list2 = grouped[grade] result[grade] = estimate(list2, periods) return result

Transition Matrix

The Transition Matrices approach models a loan as having a certain probability of transitioning from one loan grade to another.