Professional Documents
Culture Documents
FRA Assignment
FRA Assignment
BY :
PRANAV. V
1.Introduction
This Mini Project is a part of the Module: Finance and Risk Analytics of
the Post Graduate Program in Business Analytics and Business
Intelligence offered by Great Learning and McCombs School Business,
University of Texas at Austin.
Credit Risk is important and a critical parameter for any financial
institutions / lending firms / investment firms and venture capitalists.
Credit Risk would be a good parameter to understand how well the
company is doing and how well does it see in the near future.
The probability or chance of a borrower being unable to make their
payment on time and default on their debt is the Credit Risk. It refers to
the risk that any financial or lending institution might not be able to get
the interest payment or the principal on time. This automatically results
in a big mess for the financial and lender institution. Cash Flow shortage
and the higher cost of collection are some of the examples. In extreme
cases, some portion of the loan or even the entire loan may have to be
waived off resulting in a big loss for the institutions.
The Dependent variable here is the “Net Worth Next Year”. This is
converted into a new categorical dependent variable as per the problem
statement.
Default=ifelse(Networth.Next.Year>0,0,1)
The new dependent variable is generated as “Default” which will be
used for the models which we run.
3.3 Setting up Environment ,Importing Libraries and dataset:
This step ensures that:
Environment is set up with a path .
Importing various libraries for using certain functions .
Getting data set for exploration .
NOTE:
As there are more than 50 variables ,the first step in EDA here is to clean up the
missing values ,impute the outliers and get the significant variables by means of
multicollinearity and VIF.
A cut off percentage of 20% was kept for the selection variables ie. If
you have more than 20% of the values as missing values then that
variable is to be avoided in the model.
Almost all the variables are skewed very highly. Also, it indicates a
presence of outliers on the very extreme side. This makes the
distribution of the data very unorderly and uneven. There is a very high
scope of proper outlier treatment and feature re-engineering for this set
of dataset.
For better plots, we have tried doing a sample outlier treatment for the
variables wherever there is the highest gap from the 95th to the 100th
Percentile. For example if the gap is the highest between 95th percentile
and 96th Percentile – all the values will be capped at 95th percentile and
similarly on the lower extreme side if the gap is the highest between the
4th and the 5th percentile. All the values will be capped at 5th percentile.
Different variables were treated differently.
An outlier will be capped if the values is below its first quartile – 1.5IQR
or above third quartile + 1.5IQR.
The following is the code snippet used for treating the outliers :
library(outliers)
outlier_capping <- function(x){
qnt <- quantile(x, probs=c(.25, .75), na.rm = T)
caps <- quantile(x, probs=c(.05, .95), na.rm = T)
H <- 1.5 * IQR(x, na.rm = T)
x[x < (qnt[1] - H)] <- caps[1]
x[x > (qnt[2] + H)] <- caps[2]
return(x)}
Other outlier treatment methods are like Imputation with
Mean/Mode/Median and Prediction based (the outliers can be replaced
with missing values (NA) and then can be predicted by considering them
as a response variable). The Imputation method might be very basic and
cannot be applied here as this is a financial project. The Prediction based
method might too beyond according to the scope of this project. Hence
the best method used here was the capping approach by Quantiles.
Company size
Company Size
This is to determine on how the company is doing in terms of its Net
worth.
This is attained by the Ratio of (Net.worth) and (Total.assets).
Fig 8: Correlation-2
The highlighted fields have high correlation .hence one among the two
will be removed.
This matrix is further analysed in Excel and all those variables which
has a correlation of greater than 0.9 will be grouped together and
ranalysed.
Then created a model to see the VIF of the variables.
Fig 9: VIF
Along with this and the removal of VIFs we will be identifying one final
set of variables for the Univariate and Bivariate Analysis.
As seen in most of the Credit Scoring methods, we can observe that
there is only the significance of Ratios which is actually relevant for all
the scoring methods. Hence here also we will be taking mainly the ratios
and generating the model. Only these variables will be used for the
Univariate and Bivariate Analysis.
Now, when we ran Logistic Model using BLR it selects us the adequate
variables (Step Wise Selection) for the prediction and gives us the
following output.
Fig 10: Significant variables
The default Variable is the only categorical variable here with summary
as follows :
(0) – 3,298 ;; (1) – 243
Fig 11: Summary of variables
5 Logistic Regression
5.1Methodology
As there are almost 51 variables, it might not be suitable to check the
Wald Test and Significance of all the variables. We will run the Logistic
Regression model using all the variables and also use the option
Maxit = 100. This is to make sure that the Logistic Regression
Algorithm converges. As discussed before the main variables will be the
ratios which is being used with some of the absolute variables in place.
Fig 16: Logistic regression
The model is run and the values are predicted. If the predictive score is
higher than 0.5 than the Predictive class is taken as 1.
Next, we chack the vid to furthue eliminate the variables to create a final
model.
Variable Probability
Total.income 1.000e+00
Intercept 1.044e-01
Cummmulative.retained.profits 9.9634e-01
Cash.profit 9.96e-01
Profitability_ratio 1.89e-01
We can Profitability_assets_ratio 4.806e-08
Company_size 3.73e-02
Current_ratio 9.233e-01
Cash.to.average.cost.of.sales.per.day 1.008e+00
Debt.to.equity.ratio 1.12e+00
Borrowing _ratio 3.733e+00
understand that the most of them are negative coefficients. That is the
lower that values of these the higher the chances of default. This can be
mainly seen on the following variables – Profitability.assets.ratio,
CompanySize, Profitability, Current.ratio..times and
PAT.as...of.net.worth. Hence the higher the decrease in here , the higher
the chances of the default.
Accuracy=95.92 %
Sensitivity=48.14 %
Specificity=98.99 %
Accuracy= 92.58%
Sensitivity= 89%
Specificity=98.59%
The Gini Score at 0.97 shows very high which implies it has performed
well on gini too.