\documentclass[mnsc,nonblindrev]{informs3noheader}

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{bm}
\usepackage{booktabs}
\usepackage{paralist}
\usepackage{caption}
\usepackage{multirow}
\usepackage{mathtools}
\usepackage{subcaption}
\usepackage{etoolbox} % used by \numrel command
\usepackage[inline]{enumitem} % for enumerate* environment
\usepackage{pgfplots}
\usepackage{tikz}
\usepackage{floatrow}%

\setcounter{MaxMatrixCols}{20}

\usepackage{endnotes}


%% Natbib setup for author-year style
\usepackage{natbib}
 \bibpunct[, ]{(}{)}{,}{a}{}{,}%
 \def\bibfont{\small}%
 \def\bibsep{\smallskipamount}%
 \def\bibhang{24pt}%
 \def\newblock{\ }%
 \def\BIBand{and}%

\TheoremsNumberedThrough     % Preferred (Theorem 1, Lemma 1, Theorem 2)

\EquationsNumberedThrough    % Default: (1), (2), ...

\usetikzlibrary{pgfplots.groupplots}


\newcommand{\myvector}[1]{{\bm #1}}
\newcommand{\vecgamma}{\myvector{\gamma}}
\newcommand{\vecp}{\myvector{p}}

%\graphicspath{{../figures/}{../../../figures/}{../../../output/}{../../../R-output/}}

\begin{document}

\RUNAUTHOR{Cohen, Guetta, Jiao and Provost}

\RUNTITLE{Data-Driven Investment Strategies for Peer-to-Peer Lending}

\TITLE{Data-Driven Investment Strategies for Peer-to-Peer Lending \\
  \large Student Handout}

\ARTICLEAUTHORS{%
\AUTHOR{Maxime C. Cohen}
\AFF{NYU Stern School of Business, New York, NY 10012, \EMAIL{maxcohen@nyu.edu}}
\AUTHOR{C. Daniel Guetta}
\AFF{Columbia Business School, New York, NY 10027, \EMAIL{guetta@gsb.columbia.edu}}
\AUTHOR{Kevin Jiao}
\AFF{NYU Stern School of Business, New York, NY 10012, \EMAIL{jjiao@stern.nyu.edu}}
\AUTHOR{Foster Provost}
\AFF{NYU Stern School of Business, New York, NY 10012, \EMAIL{fprovost@stern.nyu.edu}}
}

\maketitle

In this case, we follow Jasmin Gonzales, a young professional looking to diversify her investment portfolio.\footnote{The story used in this case is fictitious and was chosen to illustrate a real-world situation. Consequently, any details herein bearing resemblance to real people or events is purely coincidental. Furthermore, the content of this article reflects only one approach to the problem. The investment strategies and results obtained are by no means the only way to solve the problem at hand, with the goal of providing material for educational purposes.} Jasmin graduated from a Masters in Data Science program, and after four successful years as a product manager in a tech company, she had managed to save a sizable amount of money.  She now wants to start diversifying her savings portfolio. So far, she has focused on traditional investments (stocks, bonds, etc.) and she now wants to look further afield.

One asset class she is particularly interested in is peer-to-peer loans issued on online platforms. The high returns advertised by these platforms seem to be an attractive value proposition, and Jasmin is especially excited by the large amount of data these platforms make publicly available. With her data science background, she is hoping to use machine learning tools on this data to come up with lucrative investment strategies. In this case, we follow Jasmin as she develops such an investment strategy.

\section{Background on Peer-to-Peer Lending}

Peer-to-peer lending refers to the practice of lending money to individuals (or small businesses) via online services that match anonymous lenders with borrowers. Lenders can typically earn higher returns relative to savings and investment products offered by banking institutions. However, there is of course the risk that the borrower defaults on his or her loan.

Interest rates are usually set by an intermediary platform on the basis of analyzing the borrower's credit (using features such as FICO score, employment status, annual income, debt-to-income ratio, number of open credit lines). The intermediary platform generates revenue by collecting a one-time fee on funded loans (from borrowers) and by charging a loan servicing fee to investors.

The peer-to-peer lending industry in the U.S. started in February 2006 with the launch of Prosper,\footnote{\url{https://www.prosper.com/}} followed by LendingClub.\footnote{\url{https://www.lendingclub.com/}} 
In 2008, the Securities and Exchange Commission (SEC) required that peer-to-peer companies register their offerings as securities, pursuant to the Securities Act of 1933. Both Prosper and LendingClub gained approval from the SEC to offer investors notes backed by payments received on the loans.

By June 2012, LendingClub was the largest peer-to-peer lender in the U.S. based on issued loan volume and revenue, followed by Prosper.\footnote{\url{https://en.wikipedia.org/wiki/Lending_Club}} In  December 2015, LendingClub reported that \$15.98 billion in loans had been originated through its platform. With very high year-over-year growth, peer-to-peer lending has been one of the fastest growing investments. According to InvestmentZen, as of May 2017, the interest rates range from 6.7\%-22.8\%, depending on the loan term and the rating of the borrower, and default rates vary between 1.3\% and 10.6\%.\footnote{\url{http://www.investmentzen.com/peer-to-peer-lending-for-investors/lendingclub} (date accessed: June 2018)}

LendingClub issues loans between \$1,000 to \$40,000 for a duration of either 36 months or 60 months. As mentioned, the interest rates for borrowers are determined based on personal information such as credit score and annual income. A screenshot of the LendingClub homepage is shown in Figure~\ref{homepage}. In addition, LendingClub categorizes its loans using a grading scheme (grades A, B, C, D, E, and F, where grade A corresponds to the loans judged to be ``safest'' by LendingClub). Individual investors can browse loan listings online before deciding which loans(s) to invest in (see Figure~\ref{listings}). Each loan is split into multiples of \$25, called notes (for example for a \$2,000 loan, there will be 80 notes of \$25 each). Investors can obtain more detailed information on each loan by clicking on the loan -- Figure~\ref{detailed_listing} shows an example of the additional information available for a given loan. Investors can then purchase these notes in a similar fashion to ``shares'' of a stock in an equity market. Of course, the safer the loan the lower the interest rate, and so investors have to balance risk and return when deciding which loans to invest in. 

\begin{figure} 
	\centering
	\includegraphics[scale = 0.16]{LC.png}
	\caption{Screenshot of the LendingClub homepage.}\label{homepage}
\end{figure}

\begin{figure} 
	\centering
	\includegraphics[scale = 0.37]{invest.png}
	\caption{Example of loan listings (source: LendingClub website, date accessed: May 2018).}\label{listings}
\end{figure}

\begin{figure}
	\centering
	\includegraphics[scale = 0.6]{detailed_listing.jpg}
	\caption{Example of a detailed loan listing, for a grade A loan. Information available to investors include the length of the borrower's employment, the borrower's credit score range, and their gross income, among others (source: LendingClub website, date accessed: July 2018).}\label{detailed_listing}
\end{figure}
One of the interesting features of the peer-to-peer lending market is the richness of the historical data available. The two largest U.S. platforms (LendingClub and Prosper) have chosen to give free access to their data to potential investors. This then raises a whole host of questions for investors like Jasmin:
\begin{itemize}
\item Is this data valuable when selecting loans to invest in?
\item How could an investor use this data to develop machine learning tools to guide investment decisions?
\item What is the impact of using data-driven tools on the portfolio performance relative to ad-hoc investment strategies?
\item What average returns can an investor expect from informed investments in peer-to-peer loans?
\end{itemize}
The goal of this case study is to provide answers to the questions above. In particular, we investigate how data analytics and machine learning tools can be used in the context of peer-to-peer lending investments. We will use the historical data from loans that were issued on LendingClub between January 2009 and November 2017.

\section{Datasets and Descriptive Statistics}

As mentioned, the datasets from LendingClub (and Prosper) are publicly available online.\footnote{The analysis in this case study will focus on the LendingClub data. However, a similar analysis can be conducted using Prosper data.} These datasets contain comprehensive information on all loans issued between 2007 and the third quarter of 2017 (a new updated dataset is uploaded every quarter). The data records hundreds of features including the following, for each loan:
\begin{enumerate}
	\item Interest rate,
	\item Loan amount,
	\item Monthly installment amount,
	\item Loan status (e.g., fully-paid, default, charged-off),
	\item Several additional attributes related to the borrower such as type of house ownership, annual income, monthly FICO score, debt-to-income ratio, and number of open credit lines.  
\end{enumerate}
The dataset we will be using in this case study contains over 750,000 loan listings with a total value exceeding \$10.7 billion. In this dataset, 99.8\% of the loans were fully funded (at LendingClub, partially funded loans are issued only if the borrower agrees to receive a partial loan). Note that there is a significantly larger number of listings starting from 2016 relative to previous years. 
 
The definition of each loan status is summarized in Table~\ref{table:status}. \emph{Current} refers to a loan that is still being reimbursed in a timely manner. \emph{Late} corresponds to a loan on which a payment is between 16 and 120 days overdue. If the payment is delayed by more than 121 days, the loan is considered as being in \emph{Default}.
If LendingClub has decided that the loan will not be paid off, then it is given the status of \emph{Charged-Off}.\footnote{Note that sometimes the ``Charged-Off'' status will occur before ``Default'' if/when the borrower has filed bankruptcy or has notified the intermediary platform.}

\begin{table}[H]
\begin{center}
\scalebox{0.88}{
	\begin{tabular}{cc} \toprule
		Number of Days Past Due & Status   \\ \midrule
		0 & Current  \\ 
		16-120 & Late   \\  
		121-150 & Default \\ 
		150+ & Charged-Off \\ \bottomrule
		\hline	
\end{tabular}\caption{Loan statuses in LendingClub.}\label{table:status}}
\end{center}
\end{table}

These dynamics imply that five months after the term of each loan has ended, every loan ends in one of two LendingClub states -- fully paid or charged-off\footnote{For example, if a borrower defaults on a loan in the last month of a 36-month loan, it would take another five months for the loan to be charged-off.}. To conform with the common meaning of the word, we call these two statuses \emph{fully paid} and \emph{defaulted} respectively, and we refer to a loan that has reached one of these statuses as \emph{expired}.

One way to simplify the problem is to only consider loans that have expired at the time of analysis. For example, for an analysis carried out in April 2018, this implies looking at all 36-month loans issued on or prior to October 31st 2014 and all 60-month loans issued on or prior to October 31st 2012. 

As illustrated in Figure~\ref{fig:pie1}, a significant portion (13.5\%) of loans ended in \emph{Default} status; depending on how much of the loan was paid back, these loans might have resulted in a significant loss to investors who had invested in them. The remainder were \emph{Fully Paid} -- the borrower fully reimbursed the loan's outstanding balance with interest, and the investor earned a positive return on his or her investment. Therefore, to avoid unsuccessful investments, our goal is to estimate which loans are more (resp. less) likely to default and which will yield low (resp. high) returns. To address this question, we investigate several machine learning tools and show how one can use historical data to construct informed investment strategies.

\begin{figure}
	\centering
	\includegraphics[scale = 0.51]{pie_1.png}
	\caption{Proportion of \emph{Fully Paid} versus \emph{Default} for terminated loans (by November 2017).}\label{fig:pie1}
\end{figure}

\section{Investment Strategies and Portfolio Construction}

Making predictions and constructing a portfolio in the context of online peer-to-peer lending can be challenging. The volume of data available provides an opportunity to develop sophisticated data-driven methods. In practice, an investor like Jasmin would seek to construct a portfolio with the highest possible return, subject to constraints imposed by her risk tolerance, budget, diversification requirements (e.g., no more than 25\% of loans with grades E or F). In this case study, we investigate the extent to which using appropriate predictive models can increase portfolio performance. 

On important thing that Jasmin will encounter, as in many real applications of predictive analytics, is that it is far from trivial to progress from building a predictive model to using the model to make intelligent decisions.  In her prior classes, Jasmin's exercises often ended with estimating the predictive ability of models on out-of-sample data.  She will do that here as well---but then she will have to figure out how to estimate the return to expect from an investment.  She will find that even with a seemingly good predictive model in hand, estimating the return of an investment requires additional analysis.

\bibliographystyle{informs2014}
\bibliography{LC_case}

\newpage

\section*{Pre-Class Questions}

Consider the following questions after reading the case:
\begin{enumerate}
	\item Fundamentally, what decisions will Jasmin need to make?
	\item What is Jasmin's objective when making these decisions? How will she be able to distinguish `better' decisions from `worse' ones?
	\item Why would we even think past data would be helpful here? How could Jasmin use past data to help make these decisions?
\end{enumerate}

\newpage

\section*{Downloading and Exploring the Data}

Together with this case, you should have received a copy of LendingClub's data. Download it.

\begin{enumerate}
	\item You will notice the data is provided in the form of many individual files, each spanning a certain time period. Combine the different files into a single dataset.
	\item Take a look at the data. Write a high-level description of the different ``attributes''---the variables describing the loans. How would you categorize these attributes?  Which do you think are most important to an investor like Jasmin?
	\item When looking through the data, you might have noticed that some of these variables seem related. For example, the \texttt{total\_pymnt} variable is likely to be strongly correlated to the loan status. (Why?) Why would this matter, and how would you check?
	\item Based on the variable names in the data, it's unclear whether the values of these variables are current as of the date the loan was issued, or as of the date the data was downloaded. For example, suppose you download the data in December 2017, and consider the \texttt{fico\_range\_low} variable for a loan that was issued in January 2015. It is unclear whether the score listed was the score in January 2015, or the score in December 2017. Why would this matter, and how might you check? (Hint: together with the case, you should have been given a copy of the data downloaded in 2017; use that).
	\item Remove all instances (in our case, rows in the data table) representing loans that are still current (i.e., that are not in status `Fully Paid', `Charged-Off', or `Default'), and all loans that were issued before January 1st 2009. Discuss the appropriateness of these filtering steps.
	\item Visualize each of the attributes in the file. Are there any outliers? If yes, remove these.
	\item Save the resulting dataset in a pickle. For the sake of this case, restrict yourself to the following attributes: \texttt{id}, \texttt{loan\_amnt}, \texttt{funded\_amnt}, \texttt{term}, \texttt{int\_rate}, \texttt{grade}, \texttt{emp\_length}, \texttt{home\_ownership}, \texttt{annual\_inc}, \texttt{verification\_status}, \texttt{issue\_d}, \texttt{loan\_status}, \texttt{purpose}, \texttt{dti}, \texttt{delinq\_2yrs}, \newline \texttt{earliest\_cr\_line}, \texttt{open\_acc}, \texttt{pub\_rec}, \texttt{fico\_range\_high}, \texttt{fico\_range\_low}, \texttt{revol\_bal}, \newline \texttt{revol\_util}, \texttt{total\_pymnt}, and \texttt{recoveries}.
\end{enumerate}

\newpage

\section*{Initial Analyses}

\begin{enumerate}
	\item The most important data we will need in determining the return of each loan is the total payments that were received on each loan. There are two variables related to this information---\texttt{total\_pymnt} and \texttt{recoveries}. Investigate these two variables, and for each loan, determine the total payment made on each loan.
	\item A key measure we will need in working out an investment strategy is the return on each loan, defaulted or otherwise. How might you calculate this return? Add this new variable to the data.
	\item As discussed in the case, LendingClub assigns a grade to each loan, from A through G. How many loans are in each grade? What is the default rate in each grade? What is the average interest rate in each grade? What about the average percentage (annual) return? Do these numbers surprise you? If you had to invest in one grade only, which loans would you invest in?
\end{enumerate}

\newpage

\section*{Probability of Default}

\begin{enumerate}
	\item Using the data provided, implement models to predict the probability each loan defaults. You may want to try the following models: decision tree, random forest (RF), logistic regression ($\ell_1$ and $\ell_2$ penalized), naive Bayes, and multi-layer perceptron. Carefully explain how you selected optimal model parameters and how you evaluated each model/modeling procedure.
	\item After learning and evaluating these models, Jasmin realized that the attributes she used in her models were not all underlying facts about the loan applicants, but possibly statistics calculated by LendingClub using their own models. She wanted to assess whether the predictive power of her models came simply from LendingClub's own models. Carry out this investigation---what are your conclusions?
	\item After modifying her model to ensure she did not include data calculated by LendingClub or leakage affecting the target variable, Jasmin wanted to assess the extent to which her scores agreed with the grades assigned by LendingClub. How might she do that?
	\item Finally, Jasmin had one last concern. She was acutely aware of the fact the data she was using to train her models dated from as far back as 2009, whereas she was hoping to apply it going forward. She wanted, therefore, to investigate the stability of her models over time. How might she do this?
	\item Go back to the original data (before cleaning and attribute selection) and fit a model to predict the default probability using \emph{all} attributes. (For the sake of simplicity, it will be sufficient to limit yourself to the following attributes: \texttt{id}, \texttt{loan\_amnt}, \texttt{funded\_amnt}, \texttt{funded\_amnt\_inv}, \texttt{term}, \texttt{int\_rate}, \texttt{installment}, \texttt{grade}, \texttt{sub\_grade}, \texttt{emp\_title}, \texttt{emp\_length}, \texttt{home\_ownership}, \texttt{annual\_inc}, \texttt{verification\_status}, \texttt{issue\_d}, \texttt{loan\_status}, \texttt{purpose}, \texttt{title}, \texttt{zip\_code}, \texttt{addr\_state}, \texttt{dti}, \texttt{total\_pymnt}, \texttt{delinq\_2yrs}, \texttt{earliest\_cr\_line}, \texttt{open\_acc}, \texttt{pub\_rec}, \texttt{last\_pymnt\_d}, \texttt{last\_pymnt\_amnt}, \texttt{fico\_range\_high}, \texttt{fico\_range\_low}, \texttt{last\_fico\_range\_high}, \texttt{last\_fico\_range\_low}, \texttt{application\_type}, \texttt{revol\_bal}, \texttt{revol\_util}, \texttt{recoveries}). Does anything surprise you about the performance of this model (out-of-sample) compared to the other models you have fit in this section?
\end{enumerate}

\newpage

\section*{Investment Strategies}

\begin{enumerate}
	\item What investment strategies might Jasmine use to decide which loans to invest in?
	\item First, consider the three regression models described above (regressing against all returns, regressing against returns for defaulted loans, and regressing against returns for non-defaulted loans). In each case, try $\ell_1$ and $\ell_2$ penalized linear regression, random forest regression, and multi-layer perceptron regression.
	\item Now, implement each of the investment strategies you suggested using the best performing regressor. In particular, suppose Jasmin were to invest in 1,000 loans using each of the four strategies; what would her returns be?
	\item How might Jasmin test the stability of these results?
	\item The strategies above were devised by investing in 1,000 loans. Jasmin is worried, however, that the strategy is not scalable---in other words, that if she wanted to increase the number of loans she wanted to invest in, she would eventually `run out' of good loans to invest in. Test this hypothesis using the best strategy above.
	\item Now investigate ways Jasmin might improve her investment strategy using optimization. Can you formulate the investment problem as an optimization model? How does your model perform compared to the best method above? To solve the optimization problem, you can use a solver such as Gurobi or CPLEX (free academic licenses are available). The reference manual for Gurobi is available~\citep{optimization2014inc}.
\end{enumerate}



 


\end{document}




