0% found this document useful (0 votes)
4 views

Word Format Report

This paper explores the prediction of economic recessions using Machine Learning techniques applied to various datasets, including the Chicago Federation National Activity Index and S&P-500 data. It highlights the challenges of forecasting recessions and emphasizes the importance of accurate predictions for policymakers. The study demonstrates that ML models can achieve high accuracy rates in predicting recession probabilities, ranging from 87% to over 94%.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Word Format Report

This paper explores the prediction of economic recessions using Machine Learning techniques applied to various datasets, including the Chicago Federation National Activity Index and S&P-500 data. It highlights the challenges of forecasting recessions and emphasizes the importance of accurate predictions for policymakers. The study demonstrates that ML models can achieve high accuracy rates in predicting recession probabilities, ranging from 87% to over 94%.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 55

Abstract:

A significant, highly widespread, and drop that tends to take a longer period of time in
economic activity timeframe is described as a recession. From the peak of the previous
expansion to the trough of the downturn, economists in general calculate the length that
comprises of a recession. Recessions may only last a few months, but it may take years for
the economy to bounce back and reach its previous peak.

In this paper, we investigate various datasets and its pros and cons and try to give the shot to
speculate the chances of recession, based on Machine Learning techniques and backed by
concrete datasets for better approximation of result. Within a Machine Learning framework,
we try to put in the values, specifically the Chicago Federation National Activity Index
(CFNAI) and its 2 components: Monthly Average of 3 and CFNAI Diffusion Index from a
period of March, 1967 to June, 2022, along with the S&P-500 index and various parameters
associated with it (like 10yr Tbond, % Tbond, 2 year spread fedrate, CPI etc) from the day of
the recorded period. Using unscaled, scaled and tuned models of machine learning technique,
the model was able to predict the chances, ranging from 87% to slightly more than 94%. Both
the models are different from each other, and are compiled together for comparison and the
purpose of having a surety about the model being correct in these regards.

I. Introduction:

Recession is defined as a period of economic downturn wherein the economy starts to


contract and it mostly gets evident in the country’s growth as the country’s GDP plunges and
the stock market feels the reverberations and starts to go down, more commonly termed as
“bear market”. A series of local or international market shocks can trigger a global financial
crisis, which can then turn into a worldwide economic crisis because of the interconnection of
the financial markets. In other cases, a single economic power that is quite huge and a
member of the "big-enough" economies to generate turmoil in other countries could be the
source of an economic crisis. This was the case, for instance, with the subprime crisis or what
is commonly called as the Great Recession of 2008, which began in the US and spread to
other European nations and inevitably worldwide as a problem of sovereign debt. The studies
argue that firms' risk management and financing policies had a significant impact on the
degree to which firms were impacted by the financial crisis [1] (Brunnermeier, 2009).
Exploration of the 2008 crisis by Erkens et all [2] hypothesise that this is due to (a) firms with
more independent boards raised more equity financing during the crisis, which caused
existing shareholders' wealth to be transferred to debtholders, and (b) firms with higher
institutional ownership took on more risk before the crisis, which resulted in greater investor
losses during the economic crisis. In a recession, more volatile investments like equities and
high-yield bonds typically lose value while more reliable investments like gold and U.S.
Treasuries typically rise. Shares of big corporations with reliable cash flows and dividends
often fare better in downturns on the stock market.

1
When an economy tends to become lethargic or in case of a straightaway period of plunge, it
becomes almost a necessity to watch on the spending and take undue risks that could harm an
individual’s finances. When a recession begins, many businesses may turn to layoffs in order
to reduce costs as they try to manage falling demand for the products offered and/or the
services they tend to provide. Also, the effects of the recession on unemployment tends to
become visible long after the recession period begins, which is evident from the various
recession that the world has seen earlier. To quote the reports that the National Bureau of
Economic Research, or more commonly NBER, published, during the 2008 Economic
Recession (that started showing its effect from December of 2007 and came to an end around
June of 2009), the U.S. unemployment rate was just 5% in April 2008 (five months into that
period), a slight rise from 4.7% six months earlier. But surprisingly, seven months after the
stock market's bottom and four months after the recession's official end, in October 2009, the
unemployment rate rose to a mammoth 10%. This is due to the fact that the corporate world
is very fast in cutting down their costs for a product, but in general maintain more caution
when they had to add back the cost by hiring a new employee even when the company starts
to bounce back towards recovery.

Fig: Unemployment and Gross Domestic Product (Source: Investopedia)

Failure to forecast recessions is a recurring theme in economic forecasting. The challenge of


predicting output gaps is extremely contemporary and has profound implications for
economic policy. Of course, early notice of an impending output decline is crucial for
policymakers, who can then quickly alter monetary and fiscal measures to either prevent a
recession or lessen its effects on the real economy. The NBER estimates [3] that only five
recessions have occurred in the United States since 1980, compared to 34 altogether since
1854. A slump that was far worse than either the Great Depression or the depression of 1937–
1938 resulted from the double-dip falls in the early 1980s and the global financial crisis of
2008.

With more potential regressors than there are observations, the usage of ML models is now
proven to be able to manage massive volumes of data and provide high assurances in terms of
accuracy of the final model. Chen et al. considered the healthcare as one of the sector affected

2
by the Great Recession of 2008 [4] and thus, examined the paper based on the health care
expenditures along the health care spending distribution, based on the Medical Expenditure
Panel Survey (MEPS) dataset from 2005-06 and 2007-08. To determine the various
relationships between the recession and health care spending along the health care
expenditure distribution, quantile multivariate regressions are used.

On the other hand, machine learning (ML) is a crucial method for creating models that can
automatically correlate all the data from various economic sources and respond to various
issues. In 2022, many economic analysts debated whether the economy was in recession or
not, given some economic indicators pointed to recession, but others did not.

II. Literature Review:

Although machine learning algorithms have long been employed in categorization issues,
they are now increasingly being used in the social sciences, notably in the field of financial
sectors (Dabrowski, 2016) [5]. The hidden Markov model, switching linear dynamic system,
and Naive Bayes switching linear dynamic system models were all implemented in this work.
The hidden Markov Model stated that: First, the assumption of a limited horizon states that
the probability of being in a state at a given time depends only on that state (t-1) and second,
the assumption of a stationary process states that, given the current state, the conditional
(probability) distribution over the next state remains constant.. Nyman and Ormerod used the
ML’s Random Forest technique for the dataset between 1970(Q2)-1990(Q1), and from 1990-
2007 which comprised of GDP growth period [6]. This model was able to predict the result of
about six quarters ahead and the results were stronger in case of the economy of the UK
compared to the US. In another paper [7] both of them extended their analysis by looking at
how each of the explanatory variables affected the Great Recession of the late 2000s. They
were able to further the investigation by breaking down business and non-financial household
debt into separate categories and discovered that the Great Recession was significantly
influenced by both household and non-financial company debt though, their explanatory
models exhibit significant non-linearity.

Using the 3 months to 2 year period, the Treasury term spread was used as a benchmark by
Liu and Moench [8] and they paid particular attention to the subject of whether or not the
leading indicators surveyed before in the literatures go beyond the Treasury term spread to
provide insight into potential future recessions. The Italian economy was employed as the
database, and machine learning guided tools were used as the analysis method, in the paper [9]
presented by Paruchuri, who investigated the idea of machine learning in economic
forecasting. By examining the financial characteristics that can be used as a recession
indicator, Estrella and Mishkin [10] conducted additional analysis of the US recession, wherein
they were making conclusions from the result they got (about one to eight quarters ahead)
and Stock prices, currency exchange rates, interest rates, and monetary aggregates were
assessed separately as well as in relation to other financial and non-financial indicators.
Siakoulis, Petropoulos, Stavroulakis and Vlachogiannakis used statistical ML models

3
(Random Forest, Support vector Machine, Neural Network and Extreme Gradient Boosting)
[11]
on daily stock, bonds and daily market from 39 countries as a method to predict stock
market crisis. Papadimitriou, Matthaiou and Chrysanthidou examined the economic recession
using the yield curve generated by the ML techniques using the treasury bils and bonds from
1976 to 2014 [12] , which would be able to forecast the future value thereby helping in yield
curve formation, a negative curve indicating the period of recession. Zahedi and Rounaghi [13]
were instrumental in creating an Artificial Neural network for the generation of predicted
stock prices, with the dataset recorded from their native Tehran Stock Exchange and used 20
accounting variables for creating a big dataset that could help their model. They were able to
determine (based on the outcomes of their statistical analyses) that the artificial neural
networks (ANN) model is superior to that of its rivals by using non-linear time series models
of analysis. Using real-valued data, principal component analysis may also effectively predict
stock values on their native Tehran Stock Exchange and pinpoint the major factors that
influence stock prices.

Vadlamudi in his paper [14] discussed the implications of Machine Learning techniques on
economic predictions: A real-time study to look into the influence of ML in FCP is suggested
because the study showed a leading strategy for achieving financial growth and adaptability
in corporate organisations. He also played a key contribution in identifying the crucial
function that some methods play in the forecast of insolvency and creditworthiness, roles that
other ways had not adequately addressed.

Camska and Klecka made their research based on prediction models that are being used for
prediction and expansion and centred it on predictive models for financial trouble in
corporations [15]. The goal for them became an examination of economic cycles and how
different phases arising out of them affect the prediction scores. The prediction models can be
used to quickly and affordably assess a corporate financial status, which will help to reduce
business risk. The accounting data used in the research was taken from Albertina, a prepaid
corporate database. Manufacturing of metal items, manufacturing of machinery, and
construction businesses are divided into sound and insolvent firms. In this study, 18 models
were chosen and then used to describe expansion and contraction in company data. The
primary descriptive statistics, such as mean, median, and trimmed mean, along with the
absolute difference contrasting expansion and recession, serve to characterize the final scores
attained.

Samitas, Kampouris, & Kenourgios, using their investigation of contagion risk, and
structured financial network, were able to develop an EWS (Early Warning System) based on
network analysis ML tools [16] to predict some upcoming crisis in the economic world. They
expanded upon the literature that suggests a connection between network connections in the
global financial industry (channels of stock indexes, nationwide debt-security bonds) and
potential contagion risk during crisis situations. To develop dynamic financial networks, they
specifically compute dynamic conditional correlations between all pairings of stocks,
indexes, sovereign bonds, and CDS. The networks that have been retrieved are then analysed

4
to identify any potential for contagion during times of crisis. Then, they presented a machine
learning strategy to anticipate and forecast the potential for contagion risk within financial
networks. We can see how correlations have changed over time and are organised by areas.
As we can see, a sudden rise in correlations in the case of stock indexes is connected to
financial crisis over time. The most significant support for this statistic comes from the nearly
same behaviour of all geographical correlations, particularly in the case of the Eurozone,
Asia/Pacific, and American markets, irrespective of the fact that even if stock exchange
markets operate at various times and in various ups and downs. Other research paper that
were presented and used different strategy to predict the economic recession were done by
Memon et al. as they presented their way to predict using Covid-19 as the background [17] of
their research, and using ARMA and TGARCH data from 1989-2020 as their model of
research to extract out the data that can be used at probit model.

III. Data and Methodology

3.1 About the Dataset

The first corundum of the paper was using which dataset and variable to use for predicting
the recession since there is no fool-proof data that supports the accurate prediction.
According to a 2018 study by Loungani and others [18], the majority of recessions between
1992 and 2014 in 63 nations were missed by economists in both the public and private
sectors. The first thought of using the dataset was the quarterly GDP growth rate of major
economies around the world, but it was quickly rejected since there weren’t too many
available data (eg- after the disintegration of USSR, the quarterly data for Russia is available
only after 1993, while the Chinese maintained the data only after 1990). Yearly data wasn’t
favourable either due to it being too little (maintained and in the open domain only from the
1960s onwards, with major data from countries like France available only after 1970s), so
there wasn’t any continuity. The reason why the search for the dataset was diluted to only the
US economy is due to the fact that being the largest economy of the world, with major trade
governed through the US Dollar, whenever it faces any economic stress, the world faces the
aftershock.

One of the major indicators about any recession that has been triggered by the US was the
Chicago Federation National Activity Index or CFNAI in abbreviation. This index uses a
weighted average of more than eighty actual economic activity parameters for the preceding
period. A single, summary measurement of a common element in the entire national
economic statistics is offered by the CFNAI. As a result, changes in the CFNAI throughout
time closely mirror times of economic expansion and contraction.

The CFNAI Diffusion Index represents the difference between the total absolute value of the
weights for the underlying indicators whose contribution to the CFNAI is positive in a given
month and the total absolute value of the weights for those indicators whose contribution is
negative or neutral in that same month over a three-month period. The CFNAI Diffusion
Index, whenever below the threshold of -0.35, have indicated that the economy is under
5
recession. Fisher et all in their paper outlined the failure of other policies and other
Federation banks to capture the accurate representation of recession and thereon, gave some
statistical model that was the determinant of the current Index and also calculated the
magnitude to which it could go [19].

Fig 1. CFNAI dataset, with MA3 and Diffusion Index

The other dataset that was used for the paper was the S&P-500 data. The Standards & Poors-
500 (hereon S&P-500) is an index very similar to the Nifty-100 or the Nifty-50 back in India,
which has been used since ages to measure the stock performances of 500 major corporations
that are listed on American stock exchanges, from NYSE to NASDAQ. It is one of the most
commonly followed equity indices. As of December 31, 2020, more than $5.4 trillion was
invested in assets linked to the index's performance, with the index reaching its highest point
on 2 January, 2022.

One of the key reason to pick it was the historical evidence and the volume of the data that it
presents, from December 1927 to current, updated daily (as and when the market trades). The
paramaters associated with S&P-500, along with the high and low price and trading volume
includes 10yr Tbond, % Change Tbond ,2yr SpreadFedrate ,% Change Fedrate, Nonfarm
Payrolls , % Change Payrolls , CPI and % Change CPI Date.

Since the features we needed for our dataset were not conveniently included in a
downloadable dataset, we had to download each feature separately and combine them
together into one dataframe. We were able to pull each economic feature separately from
FRED (Federal Reserve Economic Data from the Federal Reserve Bank of St. Louis) using
Quandl, which also had the added bonus of automatically calculating selected transformations
if we chose to do so, and the financial feature was downloadable from Yahoo! Finance so we

6
downloaded the dataset and created the transformed variables in Excel and imported the
dataset as a CSV.

3.2 About Quandl:

Quandl is a website that is used by professionals in the field of economics and financial
services, with the aim to get the data pertaining to economy, stocks, finances and other
alternative datasets that could be used for studies, report and/or for making business studies
and data analysis. Those who are willing to use it can use the free datasets, buy out the
datasets, upload some data and even sell some datasets in order to make money. Quandl
enables corporations to benefit from information from data. They gather, enhance, place to
use, and supply distinct, top-notch, and useful non-market data to institutional clients.

Some of the advantages that it offers to its users are:

⮚ Over 20 million different datasets are available on Quandl.


⮚ Every dataset is immediately accessible for download in the specified format.
⮚ Regardless of who first published the data or in what format, all datasets on
Quandl are accessible using the same API.
⮚ Data is open and visible.
⮚ Datasets are simple to locate and maintain.
⮚ The Quandl website offers free and public access to some areas.
⮚ Every week, more data is uploaded.

We created Recession labels from a list of start and end dates. We finally concatenated each
feature and the labels using an inner join to create one data-frame. After creating a correlation
heatmap, we selected the features we wanted to include in our final dataset (each of the
features fall under a certain category; employment, monetary policy, inflation, bond market,
or stock market). Finally we saved this dataset as a CSV and performed some descriptive
statistics on the data.

7
Fig 2. Ratio Scale of S&P 500 Bull and Bear Market (Credits: Yardeni)

The US Treasury also provides a way for the users around the world to access the data
regarding the Treasury rates and the bond period.

The United States Department of the Treasury is the executive department of the federal
government responsible for developing and executing the nation's economic and financial
policies. The Treasury Department was established by the First Congress of the United States
on September 2, 1789, and is led by the Secretary of the Treasury, who is a member of the
President's Cabinet.

The Treasury Department is responsible for a wide range of activities, including:

⮚ Managing the nation's finances, including collecting taxes, paying bills, and managing
the national debt.
⮚ Issuing U.S. currency and coins.
⮚ Enforcing financial laws and regulations.
⮚ Overseeing the U.S. Mint and the Bureau of Engraving and Printing.
⮚ Administering the Internal Revenue Service (IRS).
⮚ Providing economic and financial advice to the President and Congress.

The Treasury Department is a critical part of the federal government and plays a vital role in
the nation's economy. The department's work helps to ensure the stability of the financial
system, the soundness of the nation's currency, and the fairness of the tax system.

Here are some of the key responsibilities of the US Treasury:

8
⮚ Managing the national debt: The Treasury Department is responsible for managing
the national debt, which is the total amount of money that the federal government
owes to its creditors. The Treasury Department issues Treasury securities, which are
bonds, notes, and bills that are sold to investors to raise money to pay for the
government's expenses.
⮚ Issuing U.S. currency: The Treasury Department bears the responsibility for issuing
the currency in US. They print and mint coins and bills, and it also distributes them to
banks and other financial institutions.
⮚ Enforcing financial laws and regulations: The Treasury Department is responsible for
enacting upon the financial laws and regulations, which are designed to protect
consumers and investors. The Treasury Department investigates and prosecutes
financial crimes, such as fraud and money laundering.
⮚ Overseeing the U.S. Mint and the Bureau of Engraving and Printing: The Treasury
Department oversees the U.S. Mint and the Bureau of Engraving and Printing, which
are the two agencies that are responsible for producing U.S. currency and coins.
⮚ Administering the Internal Revenue Service (IRS): The Treasury Department
administers the Internal Revenue Service (IRS), which is the agency that collects
taxes in the United States. The Treasury Department sets tax policy, and it also
provides guidance to taxpayers on how to file their taxes.
⮚ Providing economic and financial advice to the US President and to the
Congress: The Treasury Department provides economic and financial advice to the
President and Congress. The Treasury Department analyzes economic data and trends,
and it also makes recommendations on economic policy.

Fig: Dataset Pertaining to the S&P-500 after Feature Extraction

9
Fig: The US Treasury data, important for the Yield Curve (Source: US Treasury Website)

3.3 Importance of Data Scaling

It has now been an inherent nature for data to contain scales of values that oscillate in
between the variables.

A variable could be expressed in feet, metres, and so forth.

Some machine learning techniques, such as normalisation, which scales all variables to
values between 0 and 1, perform significantly better when all variables are scaled within the
same range. This has an influence on algorithms like support vector machines and k-nearest
neighbours as well as methods like linear models and neural networks that use a weighted
sum of the input.

As a result, scaling input data is a recommended practise, as is experimenting with different


data transforms, such as employing a power transform to make the data more normal.

This is true for output variables, also known as target variables, such as numerical values
expected when modelling regression predictive modelling problems.
It is frequently useful to scale or convert both the input and target variables in regression
situations.

It is simple to scale input variables. You can use the scale objects manually in scikit-learn, or
the more handy Pipeline, which allows you to chain a series of data transform objects
together before utilising your model.

10
3.4 Scaling of Target Variables
There are two methods for scaling target variables.
The first option is to handle the transform manually, while the second is to use a new
automatic method.

1. Transform the target variable manually.


2. Transform the target variable automatically.

1. When we set the target variable manually


Managing the scaling of the target variable manually entails manually constructing and
applying the scaling object to the data.
It involves the following steps:

 Create the object that tends to be used for transform e.g. a MinMaxScaler.
 Then, Fit this transform function on the training dataset.
 Apply the transform function to the subdivided dataset consisting of training and
testing datasets.
 Invert the transform for any forecast that was made.

2. Target Variable’s transformation by automatic methods


An approach that could be followed instead of the aforementioned one is to automatically
take charge of the transform and inverse transform.
This can be achieved by using the “TransformedTargetRegressor” object that tend to
encapsulate a given model and a scaling object.

The “TransformedTargetRegressor” tends to prepare the transform of the targeted variable


with the help of the same training data used to fit the model. On applying that inverse
transform on any new data provided when calling the predict() function, it returns those
predictions in the correct scale.

● Using Level Sets to Visualize Gradient Descent

Visualization is one of the best techniques to acquire insight into machine learning. Plots can
be used to visualise loss functions. It would be a 3D graphic because we have two loss
function parameters, A[0] and A[1]. This was used for visualisation. We'll use level sets (also
known as contour plots) to show where the loss function has a constant value.

Each ellipse border represents the location of the loss function's constant value (the innermost
ones are identified), and the red X represents the location of the optimal values of A[0] and
A[1]. By convention, the loss function's constant values are evenly spaced, therefore contour
lines that are closer together suggest a "steeper" slope. In this plot, the centre at the X is quite
shallow, whereas the distance away is quite steep. Furthermore, one of the ellipses' diagonal
axes is steeper than the other.

● Rescaling Options

This wasn't covered before, but there are essentially just two options for rescaling features.
Consider the case where the first variable runs from -1 to 1, and the second one has a range
between 99 to 101: both the aforementioned features have (about) the same standard

11
deviation, but the second variable has a much bigger mean. Consider the following scenario:
first variable is still between -1 and 1, while second one is between -100 and 100. They have
the same mean this time, but x2 has a significantly greater standard deviation. Gradient
descent and similar algorithms can become slower and less trustworthy in each of these
circumstances. As a result, we want to make sure that all features have the same mean and
standard deviation.

3.5 Methodology:

Fig: Illustration of the Methodology for the Linear and Logistic Regression Model

This happens to be the general methodology that explains well how the Logistic Regression
model works. Firstly, a dataset is fed into the model, which divides it into two sub-categories:
training and testing data. The golden ratio for dividing training and testing data is 70:30, or
80:20. After the model is trained and has learnt how to make predictions, from the framework
that was set for it, we test it for testing dataset and check out the accuracy by comparing it to
the results of the training dataset.

The advantages of splitting data are:

 It can help you avoid overfitting the model to the training data.
 It can give you a more accurate estimate of the model's performance.
 It can help you identify any biases in the model.
 It can help you tune the hyperparameters of the model.

12
Fig: Methodology for the Classification Models using the S&P-500 dataset

We seek to compare the model accuracy of Support Vector Machine, K-Nearest Neighbour,
Decision-tree classifier models and find out which model is the most reliable and which one
has the best fit with regards to our dataset. Our data-set is a complication of pre-existing
Standards & Poor-500 Index (S&P-500) and important economical indicators which are
imported via FRED’s database with the help of the Quandl command. FRED’s data-base
helps us expand our pedagogy and help us work with complex economical indicators such as
10 Year T-bond, 2yr spread, % change in fed-rate, change in cpi and much more.

All of the indicators are taken in as features which are visualised and correlated via a heat
map. Furthermore, we generate a “Project Dataset” which houses recession labels. A “0”
label indicates no recession while a “1” label indicates a recession.

One thing that helped us to a great extent was the fact that more than 50 years of data was
available as archives, which helped us visualise a trend and maximise the effort of predicting
an economic recession. We seek to compare Support Vector Machine, Decision Tree, K-
Nearest Neighbour classifier to see the differences in their classification reports and to check
which one will have the best accuracy of them all. Since we are dealing with financial and
economics entailing datasets we are wary of subsiding changes and differences in the models
entailing to the change in world economics. However our primary focus with the
methodology is to understand the best fit for our procured and concatenated data-set and to
idealise the best possible model by visualising and computing the accuracy and the respective
classification reports.

13
Fig: Methodology for plotting a Yield Curve using the US Treasury datasets

We intend to plot and project a yield curve that can serve as a significant signal for
forecasting an economic recession utilising complicated analogies in machine learning, as
shown in our second figure in this research. This procedure entails acquiring a data collection
that is easily accessible online. The "US Treasury Index" is the set of data in question. The
dataset comprises treasury index values from 1970 to 2022 and is highly coherent.

Through proper cleaning and wrangling of this data and by applying suitable Machine
learning we can avoid disturbances and unimportant artifacts. This further leads us to
idealising and procuring a trend which can be studied and examined to come close to the
possibility of predicting an economic recession. It is to be noted that financial data sets are
vulnerable and always prone to change due to the current economic fluctuations and a change
in modern economic and finance indicators and this serves as an inspiration to come close to
a goal of brainstorming and visualizing a proper technique to avoid a devastating incident like
a global; recession and wide-scale job loss.

Below we describe the methodology for plotting a yield curve using US Treasury data:

● Gather the necessary data. You can find US Treasury data on the US Treasury
Department's website.

14
● Select the bonds you want to use to construct the yield curve. You can choose bonds
with different maturities, such as 1 Y, 2 Y, 5, 10, and 30 year bonds.
● Calculate the yield to maturity for each bond. The yield to maturity can de explained as
the revert back amount you will earn if you hold the bond to maturity and receive all of
the scheduled interest payments.
● Plot the yield to maturity for each bond on a graph. The x-axis should represent the
maturity of the bond, and the y-axis should represent the yield to maturity.
● Connect the points on the graph to create a yield curve. The yield curve will show the
relationship between the yield to maturity and the maturity of the bond.

Here are some additional tips for plotting a yield curve:

⮚ Use bonds with similar credit ratings. This will help to ensure that the yield curve is
not distorted by differences in credit risk.
⮚ Use bonds that are actively traded. This will help to ensure that the yield curve is
accurate and up-to-date.
⮚ Use a variety of maturities when constructing the yield curve. This will help to
provide a more complete picture of the current state of the yield curve.
⮚ Humped yield curve: A humped yield curve is one where the yield to maturity is
lowest in the middle maturities and then increases as the maturity of the bond
increases. This is a sign that investors are expecting interest rates to rise in the future.

The shape of the yield curve can be used to predict future economic conditions. For example,
a normal yield curve is often seen as a sign of economic growth, while an inverted yield
curve is often seen as a sign of economic recession.

The models that were used in the making of this project, namely

● Linear Regression
● Logistic Regression
● Decision Tree Classifier
● K-nearest Neighbour (KNN)
● Support Vector Classification

The reason for picking up all these models was the fact that there is no one-size-fits-all
answer to the question that we framed for ourselves. The best model for predicting economic
recessions will depend on the specific data set that is being used.

In general, SVM models are a good choice for predicting economic recessions when the data
is accurate and the data set is not too large. KNN models are a good choice for predicting
economic recessions when the data is noisy or the data set is large. Decision tree models are a
good choice for predicting economic recessions when the data is complex and the data set is
not too large.

15
3.6 Linear Regression:

A linear method that corresponds to the proximity of the relationship between a scalar
response and one or more interpretive variables is linear regression (the responses mentioned
above are also known as dependent and independent variables). In contrast to multivariate
linear regression, which predicts numerous correlated variables dependent on each other,
instead of just a single scalar variable, this phrase is more specific.

In linear regression, linear predictive functions are used to model associations, with the
parameters that remain unknown in the model being estimated from the data. Such type of
models are called linear models. The conditional mean of the response is typically considered
to be a related function of the values of the explanatory variables (or predictors); the
conditional median or some another quantile is usually placed.

The model parameters are quite easy to be understood due to the linear shape. Additionally,
linear model theories (which are mathematically easy and fair) are widely known.
Furthermore, a lot of contemporary modelling tools are built on the foundation of linear
regression [20]. If we take an example, linear regression more often than not provides a good
round-off to the underlying regression function, especially when the sample size is tiny or the
signal is very faint.

The first regression analysis method for which the researchers undertook an in-depth research
and saw plenty of its use in actual applications was linear regression. This is because models
with linear dependence on their uncertain parameters are in a simple way fits the linear
models than their non-linear counterparts. Plus, it is simpler to determine the statistical
attributes and characters of the resulting estimators.

The equation to show the linear regression is given as:

y=mx+c +e

Where m= slope of the line

c=intercept; and

e= representation of error that the model may have.

16
Fig 3. Line of best fit and linear regression (Credits: upgrad)

The line of best fit is based on changing m's and c's values. The differences that arise
between the observed and predicted values are known to be the predictor error. The values of
m(slope) and c (intercept) are chosen so as to provide the least amount of predictor error. It's
crucial to remember that an outlier can affect a simple linear regression model. As a result, it
shouldn't be applied to large data sets.

One major application of linear regression is to analyse and comprehend a data set rather than
simply predict outcomes. Following a regression, one can learn from the learnt weights how
much each characteristic influences the result. For example, if we have two features A and B
that are used to predict cancer rates, and the learned weight for A is significantly greater than
the learned weight for B, this indicates that the occurrence of A is more correlated with
cancer than the occurrence of B, which is interesting in and of itself. Unfortunately, feature
scaling undermines this: because we rescaled the training data, the weight for A (a′1) no
longer corresponds to A values in the real world.

In general, comparing predictors' (unstandardized) regression coefficients to determine their


relative relevance is not a good idea because:
● The regression coefficients for numerical predictors will be determined by the units of
measurement of each predictor. It makes no sense, for example, to equate the
influence of years of age to centimetres of height, or the effect of 1 mg/dl of blood
glucose to 1 mmHg of blood pressure.

● The regression coefficients for categorical predictors will be determined by how the
categories were defined. For example, the coefficient of the variable smoking will be
determined by how many categories you construct for this variable and how you
handle ex-smokers.

17
Rather, the relative relevance of each predictor in the model can be assessed as follows:

Using normalised regression coefficients to compare

1. comparing the influence of each predictor on the model's accuracy


2. comparing the amount of change in one predictor required to duplicate the influence
of another on the result Y
3. comparing the amount of change required in each predictor to alter the result Y by a
fixed amount
4. comparing the change in result Y associated with a fixed change in each predictor

1. Comparing standardized regression coefficients

The standardised version of model variables is substituted to derive the standardised


regression coefficients.

A variable that has a mean of 0 and a standard deviation of 1 is said to be standardised.


Remove the mean and divide by the standard deviation for each value of the variable.

The unit of measurement for each predictor changes to its standard deviation when the
predictors in a regression model are standardised. We think that by using the same unit to
measure each variable in the model, their values will become comparable.

Advantages of using standardized coefficients:


 Simple to apply and comprehend because the most significant variable in the model
will be the one with the greatest standardised coefficient, and so on.

 Unlike other approaches, which rely on domain knowledge to establish an arbitrary


common unit based on which the value of the predictors will be assessed, this
approach offers an objective measure of importance.

Limitations of standardized coefficients:


From the study sample, we tend to find out what should be the standard deviation be. It
generally depends on the following things:

1. the sample distribution of this variable

2. the sample size taken for standardization (smaller the sample size, greater is
the chance of it being more noisy and unstable)

3. the population that was the subject of intensive study

18
4. the design required for the study

2. Comparing the impact of each predictor on the model's accuracy

When using linear regression, you can examine the increase in the model's R2 that comes
from each additional predictor or, conversely, the decrease in R2 that results from each
predictor being deleted from the model.

In logistic regression, you can evaluate the reduction in deviance that happens as each
predictor is included in the model.

Benefits of evaluating variable relevance using the model's accuracy include:

● Regardless of the units of measurement for any variable, R2 and the deviation are
independent.

● This approach offers an impartial evaluation of importance and does not call for
specific domain expertise.

Limitations of using the model’s accuracy to assess variable importance:

1. The correlation between predictors will have a significant impact on the improvement
in R2 (or decrease in deviance) (i.e. collinearity). The last predictor included to the
model has a reduced impact on the model's accuracy the higher the correlation
between two predictors. Therefore, we must assume the absence of collinearity for
this strategy to be effective.

2. It is not recommended to compare variable relevance across studies using the model's
accuracy metrics.

3.Comparing the change in a predictor necessary to replicate the effect of another one on the
outcome Y

The key idea here is that we are comparing the effect of all predictors in terms of the effect of
a single predictor that we chose to consider as reference.

19
3.7 Logistic Regression

A statistical model called the logistic model, also referred to as the logit model, is a simple
regression model that works by guessing and pointing to the event’s likelihood by converting
the event's logarithms of the odds into a linear combination of one or more independent
variables. Logistic regression, commonly referred to as logit regression, calculates a logistic
model's parameters in regression analysis (the coefficients in the linear combination).
According to its formal definition, binary logistic regression has a single binary dependent
variable (two classes, coded by an indicator variable) with the values "0" and "1," whereas
the independent variables can either be continuous variables or binary variables (two classes,
coded by an indicator variable) (any real value). [22] [23]

Only when a selection threshold is included does logistic regression become a classification
approach. The classification problem itself determines the threshold value, which is a crucial
component of logistic regression. The precision and recall levels have a significant impact on
the choice of the threshold value. In an ideal situation, precision and recall should both equal
1, but this is very rarely the case.

In the precision-recall tradeoff, we use these cases:

a) Low Precision/High Recall: We choose a decision value that has a low value of
Precision or a high value of Recall in applications where we wish to lower the number
of false negatives without necessarily reducing the number of false positives. For
instance, in a cancer diagnosis application, we don't want any impacted patients to be
labelled as unaffected without paying close attention to whether the patient is
receiving a false cancer diagnosis. This is due to the fact that additional medical
conditions can identify the absence of cancer but cannot detect its presence in a
candidate who has once been rejected.

b) High Precision/Low Recall: In this case, there is a decision that is needed to be made
by us: to have a large value of precision or a low value of recall in applications where
we wish to cut down on false positives and at the same time, maintaining the false
negatives.

The main distinction that is drawn between logistic regression and its linear counterpart is
that the range of logistic regression is contained within a value between 0 and 1. In contrast to
linear regression, logistic regression does not require nor does it demand a linear relationship
between the input and output variables. This is because the odds ratio were converted to a
non-linear log transformation. The mathematical function can be defined as:

20
1
Logistic function f(x): −x
1+ e

Where x is an input variable

Fig 4: Illustration of a sigmoid function on x-y graph

Logistic regression is a statistical model that can be used to predict the probability of a binary
event, such as whether someone will pass an exam or not. The model works by estimating the
odds ratio of the event occurring, which is the ratio of the probability of the event occurring
to the probability of the event not occurring. The odds ratio can be increased or decreased by
changing the values of the independent variables, which are the factors that are thought to
influence the probability of the event occurring. The logistic function is used to convert the
odds ratio to a probability, and it has a "simple" shape that is easy to interpret.

It makes the least assumptions about the data being modelled since it minimises additional
information, maximises entropy, and maximises entropy.

For many machine learning algorithms, feature scaling through standardisation (or Z-score
normalisation) can be a crucial pre-processing step. For instance, imagine you have a bunch
of data points, each with a bunch of features. Some of the features might be on a different
scale than others. For example, one feature might be the height of a person in meters, while
another feature might be the weight of a person in kilograms.

This can make it difficult for machine learning algorithms to learn from the data. That's
because different features can have different ranges of values. For example, the height of a
person can range from 0 to 2 meters, while the weight of a person can range from 0 to 200
kilograms.

21
Feature scaling is a process of transforming the features so that they have a common scale.
This makes it easier for machine learning algorithms to learn from the data.

There are two common ways to do feature scaling:

o Normalization: This is a process of transforming the features so that they have a mean
of 0 and a standard deviation of 1.
o Standardization: This is a process of transforming the features so that they have a
mean of 0 and a variance of 1.

Normalization and standardization are both effective ways to do feature scaling. However,
normalization is usually preferred because it is more robust to outliers.Here is an example of
how feature scaling can be used. Suppose we have a dataset of people with the following
features:Height (in meters) and Weight (in kilograms).

We can normalize the features by subtracting the mean from each feature and then dividing
by the standard deviation. This will give us a new set of features with a mean of 0 and a
standard deviation of 1.

3.7 Decision tree Classifier

Economic forecasting has always been a difficult problem for economists and policymakers.
Accurately predicting future trends and developments is challenging due to the unpredictable
nature and complexity of economic systems. However, there is a chance to increase economic
forecasting accuracy as machine learning becomes increasingly widespread. The use of
decision tree classifier models for predicting economic recessions is one such application.

A sort of machine learning technique called a decision tree classifier model employs a
decision tree to predict a result. It operates by recursively dividing the dataset into smaller
subsets according to the features' values. Based on a selected splitting criterion, such as the
Gini index or entropy, the algorithm chooses the most optimal feature to split the data at each
stage. The end result is a structure that resembles a tree, with each node denoting a judgement
call based on a feature value and each leaf node denoting a forecasted impact.

To explain the Decision Tree Classifier in simple way: Imagine you have a game where you
have to guess what kind of fruit is in front of you. You could ask questions like "Is it round or
oblong?" or "Is it yellow or green?”. By asking these questions, you can narrow down the
possibilities until you can make a good guess about the type of fruit.

A decision tree classifier is kind of like that game. It's a way for a computer to make a guess
about something by asking a series of questions. In this case, the computer is trying to
classify data into different categories based on a set of features.

22
For example, let's say we have a dataset of animals, and we want to classify them as either a
cat or a dog based on their features like size, fur color, and tail length. The decision tree
classifier would ask questions like "Is the animal's size smaller than X?" or "Is the fur color
black or white?"

Based on the answers to these questions, the decision tree will follow a different path until it
reaches a conclusion about whether the animal is a cat or a dog. Just like in the fruit game,
the decision tree will keep narrowing down the possibilities until it makes a good guess.

Fig: Example illustrating the working of a Decision Tree Diagram

The complete population or sample is represented by the root node, which is then partitioned
into two or more homogenous sets.
The process of splitting involves dividing a node into two or more sub-nodes.
A sub-node is referred to as a decision node when it divides into more sub-nodes.
Nodes that do not split are referred to as Leaf or Terminal nodes.

The most important characteristic of Decision Tree Classifier is its power to transform
complex decision-making issues into simplified procedures, resulting in a solution that is
easier and simpler to perceive.

A tree can be "trained" by breaking the source set up into subgroups depending on an
attribute value test. The process of repeating this procedure on each derived subset is referred
to as recursive partitioning. The recursion terminates when the split no longer improves the
predictions or when all members of a subset at a node have the same value for the target
variable. Because it doesn't need parameter setting or specialisation, decision tree classifier
development is perfect for exploratory knowledge discovery. Decision trees can be used to
manage high-dimensional data. Decision trees' classifiers are frequently accurate. Decision
tree induction is a common inductive technique for learning classification information.To
answer how the Decision tree Classifier can be used in terms of prediction of the economy,
consider it as this way: Economic forecasting is speculating on how the economy will
23
develop in the future, including how the GDP, inflation, and unemployment rates will
change. By training the model on past economic data and employing it to estimate future
trends, decision tree classifier models may be utilised for economic forecasting.
Periods of economic downturn known as recessions are characterised by a sharp reduction in
economic activity, including GDP, employment, and spending among consumers. A
recession may be anticipated through economic forecasting, which enables decision-makers
to take proactive steps to lessen its effects.
By training the model on historical data for important economic variables, such as GDP
growth, employment levels, and inflation rates, decision tree classifier models may be used to
forecast recessions. Next, predictions based on fresh data may be made using the model, and
their precision can be assessed.
A decision tree classifier model for economic forecasting is trained using historical data for
important economic indicators, such as Gross Domestic Product growth, inflation rates, and
employment levels. Following that, predictions based on fresh data are made using the model.
By contrasting projected values for the same indicators with actual values, the model's
accuracy is assessed.

The benefits of using decision trees are:

● Decision trees have the capability of producing clear rules.


● Without requiring a lot of computing, decision trees conduct classification.
● Decision trees are able to handle both continuous and categorical data.
● Decision trees make it evident which fields are essential for categorization or prediction.
● Decision trees are useful because they are simple to use and don't need a lot of technical
expertise, which makes them accessible to a wide range of users.
● Scalability: Decision trees are capable of handling huge datasets and can easily be
parallelized to speed up processing times.
● Decision trees can handle missing values in the data, making them a suitable alternative
for datasets with incomplete or missing data.
● Decision trees are an appropriate option for complicated datasets because they can
manage non-linear correlations between variables.
● Ability to handle unbalanced data: Decision trees are capable of handling unbalanced
datasets where one class is overrepresented in comparison to the others by weighing the
significance of each node according to the distribution of the classes.

There are some limitations attached with the Decision tree Classifier as well. They are
discussed below:

24
● Overfitting: When a model learns the training data too well and is unable to
generalize to new data, it is called overfitting. This can happen when the model is too
complex or when the training data is not representative of the real world. In decision
tree classifiers, overfitting can happen when the tree is allowed to grow too deep. A
deep tree will have many branches, which can lead to the model learning the training
data too well. This can cause the model to make poor predictions on new data.

There are a few ways to prevent overfitting in decision tree classifiers. One way is to
limit the depth of the tree. Another way is to use a technique called cross-validation.
Cross-validation involves dividing the training data into two sets: a training set and a
validation set. The model is trained on the training set and then evaluated on the
validation set. This process is repeated several times, and the model that performs best
on the validation set is chosen. Another way to prevent overfitting is to use a
technique called regularization. Regularization adds a penalty to the model's cost
function that discourages the model from learning too complex of a model. This can
help to prevent the model from overfitting the training data.

● Instability: With decision tree classifiers, instability is a potential issue. It results


from the sensitivity of decision trees to little variations in the training data. Even
when the trees are trained using the same technique and parameters, this might result
in separate trees being constructed from slightly different training sets. Because
instability might result in substandard model performance, it can be problematic.
Even though the fresh data is equivalent to the training data, an unstable tree may
produce different predictions. This makes it challenging to believe the tree's forecasts.

Decision tree classifiers can be stabilised in a variety of methods. Utilising the


bagging process is one option. Using bootstrap samples of the training data, bagging
requires training multiple trees. By randomly selecting the training data with
replacement, bootstrap samples are produced. This indicates that various bootstrap
samples may include certain data points. By averaging the forecasts of various trees,
bagging can aid in the reduction of instability. By doing this, the influence of noise in
the training data may be lessened.

Pruning is also a method that could act as a possible option to deal with instability. A
decision tree's branches are removed during pruning. This can assist to simplify the
tree and lessen its sensitivity to subtle changes in the environment. The act of pruning
can be done in both ways, manually or automatically.

● Bias: When the model cannot determine the real link between the characteristics and
the target variable, bias in decision trees develops. Bias can lead to poor model
performance. A biased model will make inaccurate predictions on new data. There
are several causes for this, including:

⮚ Sophistication of the model in order to accurately represent the real


connection between the characteristics and the target variable
⮚ The training data does not accurately reflect reality.

25
⮚ The training set of the model is being overfitted.

● Limited Predictive Power: Decision tree classifier algorithms might not fully
account for the interconnected relationships between economic variables, which
would reduce their accuracy. Several variables, such as the following, can contribute
to limited predictive power:
⮚ When a model learns training data too thoroughly and is unable to
generalise to new data, this is known as overfitting.
⮚ When a model is very sensitive to even little changes in the training data, it
has a high variance.
⮚ Low signal-to-noise ratio: This happens when the training data do not
adequately reflect the target variable.

Using regularization, cross-fitting and limiting the depth of the tree, the predictive
power of the decision tree classifier can be improved.

3.8 Support Vector Classification:

The process of formulating policies must include accurate economic forecasts. Understanding
the current situation of the economy aids those making decisions in formulating future
economic policies. The use of support vector machine (SVM) models for recession prediction
is one example of how machine learning techniques have improved the accuracy of economic
forecasts.

A typical supervised learning approach for classification and regression analysis is the
support vector machine (SVM) model. Finding the hyperplane that optimally divides data
points into distinct groups is how SVM models function. The hyperplane is selected so that it
has the biggest margin, or the largest gap between the nearest data points of various classes.
Finding the support vectors—the data points that are most closely related to the hyperplane—
is how SVC operates. After that, the hyperplane is built to pass as closely as feasible by the
support vectors. The decision boundary, or the line dividing the two classes, is established by
the support vectors, which are crucial.

26
Fig: Support Vector Classification and Hyperplane explanation (Source: Javatpoint)

To explain it quite clearly, consider an example:

Consider having a collection of images of cats and dogs. You want to create a device that can
analyse a brand-new image and determine whether it resembles a cat or a dog. To do this, we
tend to use support vector classification (SVC). It operates by identifying a line that divides
the cats from the dogs in the images. The hyperplane is the name of the line that does the
distinction work for us in this case.
SVC examines the images to identify the spots that are most near the line in order to
determine the hyperplane. The support vectors are these points. After that, the hyperplane is
built to pass as closely as feasible by the support vectors.

The Support Vector Classification can be divided into 2 groups: Linear and non-linear SVC.

Linear SVC are consisting of “linearly separable data” i.e. those that consists of data points
that could be divided into two separate groups using a single straight line. However, a dataset
is considered to be non-linear if it cannot be classified using a straight line, in which case a
non-linear Support Vector Machine classifier is used.

The other important term to understand the Support Vector Classification is Hyperplane.

There might be multiple decision boundaries or planes or lines that are used to segregate the
classes in n-dimensional space, but the most appropriate and the best line should be used for
the purpose of classification of the data points. The boundary that is thus selected is termed as
the hyperplane of the Support Vector Machine.

27
They are purely dependent on the features present in the dataset. For instance, the hyperplane
will be a straight line if its in a 2D feature space. Additionally, if there are three features, the
hyperplane will tends towards having only two dimensions.

Fig: Hyperplane for the 2D feature space

Fig: Hyperplane for the 3D feature space

3.9 K-Nearest Neighbour:

One of the simplest ML algorithms, based on the supervised learning method, is K-Nearest
Neighbour or the K-NN. The basic idea behind KNN is to find the k most similar instances in
the training set to a new instance, and then predict the label of the new instance based on the
labels of the k nearest neighbors.

One of the major features of the K Nearest Neighbour is that it can be used for both purpose
of Classification as well as for regression. However, in most of the cases, it is used as a
classification.

Since K-NN is a non-parametric technique, it doesn’t make any assumptions or ideas


regarding the underlying data. It is also known as a lazy learner algorithm since it saves the

28
training dataset rather than learning from it immediately. Instead, it uses the dataset to
execute an action when classifying data. During the training phase, the K-Nearest Neighbour
simply saves the information during the training phase, and when it receives new data, it
categorises it into a category that is quite similar to the new data.

To help understand it, consider a simple example. Imagine you have a bunch of pictures of
cats and dogs. You want to build a machine that can look at a new picture and tell you if it's a
cat or a dog.

K-nearest neighbors (KNN) is a way to do this. It works by finding the 3 most similar
pictures in the training set to the new picture. The pictures that are most similar are called the
"nearest neighbors". The machine then predicts that the new picture is the same as the
majority of the nearest neighbors.

To find the nearest neighbors, KNN looks at the pictures and finds the pictures that are
closest to the new picture. Closeness is measured based on the features of the pictures. For
example, if the pictures are of cats and dogs, then the features could be the size of the ears,
the length of the tail, and the color of the fur.

Once the nearest neighbors are found, the machine predicts that the new picture is the same
as the majority of the nearest neighbors. For example, if 2 of the nearest neighbors are cats
and 1 of the nearest neighbors is a dog, then the machine will predict that the new picture is a
cat.

KNN is a powerful algorithm that can be used to solve a variety of classification problems.
However, it can be computationally expensive to train, especially for large datasets.
Additionally, KNN can be sensitive to noise in the data.

Fig: Example of K-NN with the values of the K specified

29
The K Nearest Neighbour works by firstly selecting the value of K. Then, for those K
neighbours (say, if k =4), it calculates the Euclidean distance for those K neighbours and
sorts out the nearest neighbours. The next work done by KNN is to count the data point each
of those neighbours are representing. Then, for the neighbours whose data points are in a
majority, the same data point will be assigned to the value for which we intended to find out
the value. The ideal value for "K" cannot be determined in a specific way using a
methodology, thus we must experiment with several numbers to discover the one that works
best and fits well for our model. K is best represented by the number 5. A relatively small
number of K, such K=1 or K=2, might be noisy and cause outlier effects in the model.
Although K should have large values, there may be some issues.

Some of the advantages of KNN are:

⮚ It is a simple algorithm to understand and implement.


⮚ It is very flexible and can be used for a variety of tasks.
⮚ It is very robust to noise in the data.

Here are some of the disadvantages of KNN:

⮚ It can be computationally expensive to train, especially for large datasets.


⮚ It can be sensitive to overfitting.
⮚ It can be difficult to interpret the results.

Overall, KNN is a powerful and versatile algorithm that can be used for a variety of tasks.
However, it is important to be aware of its limitations before using it.

3.10 Classification v Regression

A categorical variable, such as whether or not an economic recession will occur, may be
predicted using classification models. A classification model may be trained on past
economic data in the context of economic forecasting to determine if the economy will
experience a recession in the future.

One benefit of classification models is that they may give an uncomplicated yes-or-no
response, making them simple to understand and convey to stakeholders and makers. As they
concentrate on classifying data points into distinct groups, they might also be more resistant
to outliers and noise in the data.

The capacity of classification algorithms to capture the subtleties of sophisticated economic


data can, however, be constrained. They might not be able to provide light on the depth or
severity of a recession or the particular causes that led to it. Additionally, they could be more
vulnerable to categorization mistakes that result in false positives or false negatives.

30
To forecast a continuous variable, like the severity of a recession, regression models are
utilised. A regression model may be trained on past economic data to anticipate the severity
of a recession in the future in the context of economic forecasting.

Regression models have the benefit of enabling more detailed insights into the elements that
cause recessions. Additionally, they may be better able to capture intricate interactions
between many factors, such as the effect of changing interest rates on economic expansion.

However, the individual problem and available data determine how well these types of
models function. A classification model could be more suited, for instance, if the objective is
to forecast if a recession will develop. A regression model would be more suited if the
objective is to comprehend the causes of a recession and forecast its severity.

For predicting economic recessions using machine learning, both classification and
regression models offer advantages and disadvantages. The appropriate model must be
chosen based on the facts and the particular challenge at hand. Regression models may be
better at explaining the causes of a recession and forecasting its severity than classification
models in general for determining whether a recession will occur. We may learn more about
these models' efficacy and determine which model is best for a specific situation by
comparing how well they work.

3.11 Time Series Forecasting

Time series forecasting is the process of analyzing historical data to predict future values. It is
a powerful tool that can be used to make informed decisions about the future. However, it is
important to remember that time series forecasting is not an exact science. The predictions
may not always be accurate, and the forecast probabilities may vary greatly. This is because
time series data is often affected by external factors that are difficult to predict.

Despite the challenges, time series forecasting is a valuable tool that can be used to improve
decision-making. The more complete the data, the more accurate the predictions are likely to
be. It is also important to remember that prediction and forecasting are not the same thing.
Prediction is about making a specific statement about the future, while forecasting is about
providing a range of possible outcomes

There are many different methods of time series analysis. Some common methods include:

⮚ Trend analysis: This involves identifying the long-term direction of a time series.
For example, a time series might be trending upwards, downwards, or sideways.
⮚ Seasonal analysis: This involves identifying the short-term patterns in a time series.
For example, a time series might have a seasonal pattern of increasing in the
summer and decreasing in the winter.

31
⮚ Cycle analysis: This involves identifying the long-term cycles in a time series. For
example, a time series might have a cycle of increasing for a few years, then
decreasing for a few years, and then repeating.
⮚ Residual analysis: This involves identifying the random fluctuations in a time
series. For example, a time series might have a trend, a seasonal pattern, and a
cycle, but there might also be some random fluctuations.

Time series analysis can be a powerful tool for understanding and predicting the future.
However, it is important to note that no method of time series analysis is perfect. There will
always be some uncertainty in the predictions.

Here is an example of how time series analysis can be used. Suppose you are interested in
predicting the number of people who will visit your website next month. You could use time
series analysis to analyze the number of people who have visited your website in the past few
months. You could look for patterns in the data, such as a seasonal pattern or a trend. You
could also use statistical models to predict the number of people who will visit your website
next month.

By using time series analysis, you can gain a better understanding of the past behavior of
your website and make more informed predictions about the future

⮚ ARIMA: This is a statistical model that can be used to model trends and seasonality in
time series data.
⮚ Exponential smoothing: This is a simple method for forecasting that uses weighted
averages of past data.
⮚ Neural networks: This is a machine learning method that can be used to model
complex relationships in time series data.

The best method for time series forecasting will depend on the specific application. It is
important to experiment with different methods to find the one that works best for your data.

Time series forecasting is a powerful tool that can be used to make informed decisions about
the future. However, it is important to note that no method of time series forecasting is
perfect. There will always be some uncertainty in the predictions.

Here are some of the benefits of time series forecasting:

⮚ It can help you make better decisions about the future.


⮚ It can help you save money by avoiding overstocking or understocking.
⮚ It can help you improve your customer service by better meeting demand.
⮚ It can help you identify trends and opportunities.

Here are some of the challenges of time series forecasting:

⮚ The data may not be accurate or complete.


⮚ The data may be noisy or contain outliers.

32
⮚ The data may be non-stationary, meaning that the statistical properties of the data
change over time.
⮚ The data may be influenced by external factors that are difficult to predict.

Fig: A time series forecasting illustration

3.12 Yield Curve

A yield curve is a tool used in finance and economics to predict recessions. It is a graph that
shows the relationship between the yields of bonds with different maturity period. The yield
curve can be used to determine the market's expectations for future economic growth,
inflation, and interest rates. The yield curve has been found to be a reliable predictor of
economic recessions.

By examining the yield curve's form and slope, recessions can be predicted. Long-term
interest rates are greater than short-term interest rates when the yield curve is upward-sloping.
This implies that investors are prepared to put money into longer-term bonds since the market
anticipates further economic growth. The long-term interest rates are lower than short-term
interest rates when the yield curve is downward sloping. This indicates that investors are
looking for stable investments in short-term bonds since the market expects a slowdown in
the economy.

The link between the interest rates of bonds with various maturities is depicted on a graph
called the yield curve. Investors are ready to pay more for longer-term bonds when the yield
curve is upward sloping, which shows that they are optimistic about the direction of the
economy. Investors are ready to pay more for shorter-term bonds when the yield curve is
downward sloping, which indicates that they are concerned about the state of the economy.

33
A downward-sloping yield curve is often seen as a sign of an impending recession because it
suggests that investors are expecting interest rates to fall in the future. This can happen when
the economy is slowing down and the Federal Reserve is cutting interest rates in an attempt to
stimulate economic growth.

An inverted yield curve has been a reliable predictor of recessions in the past. However, it is
important to note that it is not a perfect predictor and should be used in conjunction with
other economic indicators.

Because it symbolises what the market believes will happen in terms of inflation and
economic growth in the future, the yield curve is an effective recession predictor. The yield
curve's slope indicates the market's predictions for the future movement of interest rates.
When the yield curve slopes higher, investors anticipate that as the economy expands, interest
rates will go up. When the yield curve slopes downward, investors anticipate lower interest
rates in the future as the economy weakens.

Because it is a good indication of investor mood, the yield curve is also a good indicator of
recessions. During economic downturns, investors frequently avoid risk and favour short-
term, secure assets. In contrast, investors are more ready to take risks and buy long-term
bonds during economic expansions. Recessions can be predicted using the yield curve since it
reflects changes in market attitude and expectations.

Limitations of Using the Yield Curve to Predict Recessions: The yield curve has historically
been a good indicator of economic recessions, although it is not perfect. The yield curve has
certain drawbacks, including the potential for inaccurate recessional signs. The yield curve
may invert sometimes without triggering a recession. This may occur if other elements, such
as a sharp reduction in oil prices, contribute to the rise in short-term interest rates.

The variable lead time between an inverted yield curve and a recession is another setback for
anyone willing to draw the conclusions using the yield curve alone. The wait time might
range in length from six months in certain circumstances to eighteen months in others. It may
be difficult for policymakers to act quickly enough to avert a recession as a result of this
variability.

34
Fig: Yield curve and its subcategories (Source: Britannica)

IV. Results:

From the ML strategies deployed, we were able to create a Confusion Matrix for the sake of
accuracy. Also the value were displayed in percentage.

Fig: Unscaled LR Accuracy

35
Fig: Confusion Matrix for Unscaled Logistic regression

Fig: Scaled LR Accuracy

36
Fig: Confusion Matrix for Scaled Logistic Regression

Fig: Tuned Logistic Regression with scaled accuracy

For Decision Tree Classifier

The results pertaining to the Decision Tree Classifier are shown below:

Fig: Unscaled Decision Tree Accuracy

Fig: Confusion matrix for Unscaled Decision Tree Classifier

37
Fig: ROC Curve for Unscaled Decision Tree Classifier

Fig: Tuned Decision Tree with unscaled accuracy.

Fig: Confusion Matrix for Tuned Decision Tree with unscaled accuracy.

38
Fig: ROC Curve for Tuned Decision Tree with unscaled accuracy.

Fig: Tuned and Scaled Decision Tree accuracy.

Fig: Confusion Matrix for Tuned Decision Tree with scaled accuracy.

39
Fig: ROC Curve for Tuned Decision Tree with scaled accuracy.

For Support Vector Classification (SVC)

The results pertaining to the Decision Tree Classifier are shown below:

Fig: Unscaled Support Vector Classification accuracy.

40
Fig: Confusion Matrix for unscaled Support Vector Classification

Fig: ROC Curve for unscaled Support Vector Classification.

Fig: Support Vector Classification with scaled accuracy.

41
Fig: Confusion Matrix for Support Vector Classification with scaled accuracy

Fig: ROC Curve for Support Vector Classification with scaled accuracy

For K-Nearest Neighbour (KNN) Classifier:

The results pertaining to the KNN are shown below:

42
Fig: Unscaled KNN Classifier Accuracy

Fig: Confusion Matrix for unscaled KNN Classifier

Fig: Confusion Matrix for unscaled KNN Classifier

Fig: KNN Classifier with scaled accuracy.

43
Fig: Confusion Matrix for KNN Classifier with scaled accuracy.

Fig: ROC Curve for KNN Classifier with scaled accuracy.

The accuracy varied from 87% to a little more than 94% as evidenced from the result. The 1
in the chart displayed the chances of recession, while a 0 indicated little to no chance of a
recession.

44
Fig: Comparison of the Classification Models

For Time Series prediction using the CFNAI dataset

Also used were the CFNAI diffusion index for the values till June 2022, after which some
discrepancies were noticed from the subsequent releases of the CFNAI datasets.

Fig: CFNAI Diffusion Index plotted using ML technique. Notice the trough coincides with the period of economic recession.

Fig: Actual CFNAI Diffusion Index

45
Fig: CFNAI MA_3 plotted using ML technique.

From Fig 10 and 11, we can see the accuracy of the plotted versus the actual CFNAI
Diffusion Index, which (if it differs) has only minute differences between them. The monthly
average of 3 plot was similarly plotted using the ML technique using the dataset.

Fig: A 3-D Yield Curve derived from the Treasury Data, along with the values each axes of the 3D Graph represents.

46
V. Conclusion

The period of recessions have always been the hardest for every sphere of life. There are job
losses and salary cuts, plus the chances to get some new job become slim. The economy gets
mired into a downward curve which impacts everything: inflation, bear market, jobs, revenue
cut, GDP forecast cut etc, and the people suffers from the psychological thing like
depression, anxiety and fear.

Using our dataset obtained from Chicago fed and other source (notably Yahoo! Finance)
from the internet, we were able to clearly show the results from the data provided. The
accuracy varied from the unscaled to the scaled model, showing the results from 87% (for the
unscaled) to 94.44 % (for the scaled regression).

The forecast can help the government in making some haste but confident decisions that
could be done to avert the effects of the financial distress on economy and even delay the
recession. It can also help the market in understanding the dynamics of the world economy
since what affects one will eventually affect the whole world. Things like war, big crisis on a
particular sector will underline what can be the economy’s balance and how it can tilt from
negative to positive. These external factors are always unwanted and can undermine the
accuracy of the model, but not to a big extent since these are reflected on both the market and
the other economic index. It can be also helpful for students and investors for learning from
the trends and the mistakes that could be avoided that could lead to the financial catastrophe.

We are already in the future however in today's dynamic and interconnected global economy,
accurately predicting economic recessions has become a crucial task for policymakers,
investors, and businesses. Traditional economic forecasting models often struggle to capture
the complex and non-linear nature of economic systems. However, with the advent of
artificial intelligence (AI) and machine learning (ML), new possibilities have emerged for
improving the accuracy of economic recession forecasting. We believe that there is an
endless future scope and a variety of possibilities which can be realised through even more
research lets conclude on how AI and ML techniques are revolutionizing economic
forecasting and enabling more effective recession prediction.

5.1 The Challenges of Economic Recession Forecasting:

Predicting economic recessions is a challenging task due to various factors such as the
complexity of economic systems, the influence of external events, and the inherent
uncertainties involved. Traditional forecasting models rely on historical data and assumptions
about economic relationships, which can be limited in their ability to capture the dynamic
nature of the economy. AI and ML offer solutions to these challenges by leveraging the
power of algorithms and advanced data analysis techniques.

5.2 Leveraging Big Data for Improved Forecasting:

47
One of the key advantages of AI and ML in economic recession forecasting is their ability to
process and analyze large volumes of data. Traditional models often rely on a limited number
of economic indicators, which may not capture the full complexity of the economy. In
contrast, AI and ML algorithms can incorporate a wide range of data sources, including
financial market data, social media sentiment, consumer behavior, and macroeconomic
variables. By integrating diverse data sets, these techniques provide a more comprehensive
understanding of the economic landscape.

5.3 Feature Selection and Model Building:

When using AI and ML for economic recession forecasting, feature selection plays a critical
role in model performance. The selection of relevant variables and indicators can
significantly impact the accuracy of predictions. Researchers and practitioners employ
various techniques, such as statistical tests, correlation analysis, and domain expertise, to
identify the most informative features for recession prediction. Once the features are selected,
ML algorithms, such as support vector machines, random forests, or deep learning neural
networks, can be employed to build predictive models.

5.4 Uncovering Hidden Patterns and Non-linear Relationships:

Traditional economic models often assume linear relationships between economic variables.
However, the real world is characterized by complex interactions and non-linear dynamics.
AI and ML techniques excel at capturing and modeling such relationships, allowing for more
accurate recession forecasting. Through advanced algorithms like deep learning, these
techniques can uncover hidden patterns and detect subtle signals that may be indicative of an
impending economic downturn. By embracing non-linearity, AI and ML offer a more
nuanced understanding of the economy's behavior.

5.5 Real-Time Monitoring and Early Warning Systems:

One of the significant advantages of AI and ML in economic recession forecasting is their


ability to provide real-time monitoring and early warning systems. These techniques
continuously process incoming data, allowing for quick detection of emerging trends and
potential recessionary signals. By identifying leading indicators and monitoring shifts in key
economic variables, AI-powered systems can provide timely alerts to policymakers and
market participants, enabling proactive decision-making.

5.6 Combining Human Expertise and Machine Intelligence:

While AI and ML techniques offer powerful tools for economic recession forecasting, human
expertise remains invaluable in interpreting the results. It is crucial to combine the insights
generated by machine intelligence with the knowledge and experience of economists and

48
domain experts. By blending the strengths of AI with human judgment, analysts can make
more informed decisions and gain a deeper understanding of the underlying economic
mechanisms driving recessions.

5.7 Ethical Considerations and Transparency:

As AI and ML become more prevalent in economic recession forecasting, ethical


considerations and transparency become crucial aspects. The algorithms used for prediction
should be transparent and interpretable, enabling users to understand how decisions are made.

Additionally, it is essential to address potential biases and ensure that AI-driven models do
not exacerbate inequalities or amplify existing economic disparities. Ethical guidelines and
regulatory frameworks should be developed to govern the use of AI and ML in economic
forecasting.

49
VI. References:

[1] M. Brunnermeier (2009) Deciphering the liquidity and credit crunch 2007-08. J. Econ.

Perspect

[2] Erkens, D. H., Hung, M., & Matos, P. (2012). Corporate governance in the 2007–2008

financial crisis: Evidence from financial institutions worldwide. Journal of Corporate

Finance, 18(2), 389–411. https://doi.org/10.1016/j.jcorpfin.2012.01.005

[3] Business Cycle Dating. (n.d.). NBER. https://www.nber.org/research/business-cycle-

dating

[4] Chen, J., Vargas-Bustamante, A., Mortensen, K., & Thomas, S. B. (2013b). Using

Quantile Regression to Examine Health Care Expenditures during the Great

Recession. Health Services Research, 49(2), 705–730. https://doi.org/10.1111/1475-

6773.12113

[5]Dabrowski, J. J., Beyers, C., & de Villiers, J. P. (2016). Systemic banking crisis early

warning systems using dynamic Bayesian networks. Expert Systems With Applications, 62,

225–242. https://doi.org/10.1016/j.eswa.2016.06.024

[6] Nyman, R., & Ormerod, P. (2017). Predicting economic recessions using machine

learning algorithms. arXiv preprint arXiv:1701.01428.

[7] Nyman, R., & Ormerod, P. (2020). Understanding the Great Recession Using Machine

Learning Algorithms. ArXiv. https://doi.org/10.48550/ARXIV.2001.02115

50
[8] Liu, W., & Moench, E. (2016). What predicts US recessions? International Journal of

Forecasting, 32(4), 1138–1150. https://doi.org/10.1016/j.ijforecast.2016.02.007

[9] Paruchuri, H. (2021). Conceptualization of Machine Learning in Economic Forecasting.

Asian Business Review, 11(2), 51–58. https://doi.org/10.18034/abr.v11i2.532

[10] Estrella and F. S. Mishkin, "Predicting U.S. recessions: financial variables as leading

indicators", The Review of Economics and Statistics, vol. 80, no. 1, pp. 45-61, 1998.

[11] Chatzis, S. P., Siakoulis, V., Petropoulos, A., Stavroulakis, E., & Vlachogiannakis, N.

(2018). Forecasting stock market crisis events using deep and statistical machine

learning techniques. Expert Systems With Applications, 112, 353–371.

https://doi.org/10.1016/j.eswa.2018.06.032

[12] Gogas, P., Papadimitriou, T., Matthaiou, M., & Chrysanthidou, E. (2014). Yield Curve

and Recession Forecasting in a Machine Learning Framework. Computational

Economics, 45(4), 635–645. https://doi.org/10.1007/s10614-014-9432-0

[13] Zahedi, J., & Rounaghi, M. M. (2015). Application of artificial neural network models

and principal component analysis method in predicting stock prices on Tehran Stock

Exchange. Physica A: Statistical Mechanics and Its Applications, 438, 178–187.

https://doi.org/10.1016/j.physa.2015.06.033

[14] Vadlamudi, S. (2020). The Impacts of Machine Learning in Financial Crisis Prediction.

Asian Business Review, 10(3), 171–176. https://doi.org/10.18034/abr.v10i3.528

51
[15] Camska, D., & Klecka, J. (2020). Comparison of Prediction Models Applied in

Economic Recession and Expansion. Journal of Risk and Financial Management,

13(3), 52. https://doi.org/10.3390/jrfm13030052

[16] Samitas, A., Kampouris, E., & Kenourgios, D. (2020). Machine learning as an early

warning system to predict financial crisis. International Review of Financial Analysis,

71, 101507. https://doi.org/10.1016/j.irfa.2020.101507

[17] Memon, A. A., & Oad Rajput, S. K. (2020). COVID-19 Led Economic Recession

Prediction - A Pitch Paper. SSRN Electronic Journal.

https://doi.org/10.2139/ssrn.3656618

[18] An, P., Jalles, J. T., & Loungani, M. (2018). How Well Do Economists Forecast

Recessions? INTERNATIONAL MONETARY FUND.

[19] Fisher JD, Liu CT, Zhou R. When can we forecast inflation?. Economic Perspectives-

Federal Reserve Bank of Chicago. 2002 Feb;26(1):32-44.

[20] Su, X., Yan, X., & Tsai, C. L. (2012). Linear regression. Wiley Interdisciplinary

Reviews: Computational Statistics, 4(3), 275–294. https://doi.org/10.1002/wics.1198

52
[21] Koç, M., & Barkana, A. (2014). Application of Linear Regression Classification to low-

dimensional datasets. Neurocomputing, 131, 331–335.

https://doi.org/10.1016/j.neucom.2013.10.009

[22] LaValley, M. P. (2008). Logistic Regression. Circulation, 117(18), 2395–2399.

https://doi.org/10.1161/circulationaha.106.682658

[23] Menard, S. (2002). Applied logistic regression analysis (No. 106). Sage.

53
PERT Chart

Risk Assessment

● The aforementioned dataset associated with the CFNAI (being a Federal Bank in the
US) is subject to change by the authorities in the future predictions. (as it happened
when the data was altered from July, 2022)

● Even though the S&P-500 forms the crux of our data set, it is continuously changing
every day and shifts the ethos of forecasting of an economy to the fluctuations in
stock prices.

54
Roles and Responsibilities

S.No Member Roles

1. Vedanta ● Literature survey and reviews


Bhattacharya
● Data Wrangling

● Additional research

● Splitting the data samples

● Computing accuracy

● Report Writing

2. Ishaan Srivastava ● Literature Review and Survey

● Collecting Data sets

● Additional Research

● Data Preprocessing

● Training and Testing

● Computing accuracy

● Report Writing

55

You might also like