Presentation slides
FINM4100
Analytics in Accounting,
Finance and Economics
Week 8
Data analytics techniques and applications in
accounting, finance and economics
Lesson Learning Outcomes
1 Explore and apply some of the widely used data
analytics techniques which are used to extract
insights in accounting, finance and economics, e.g.
• Association rule learning
• Classification tree analysis
• Genetic algorithms
• Machine learning
• Regression analysis
Software for today
1. Google Colab
• Either
A. watch the teacher demonstrate analytics and accounting in python OR
B. you can run the python scripts yourself in Google Colab
• If you want to run the code provided, make sure you have access (signed in) to Google Colab https://colab.research.google.com
2. Exploratory
A. watch the teacher demonstrate analytics and accounting in Exploratory OR
B. run each step yourself
Data for today
1. GroceryStoreDataSet.csv
2. Churn_Modelling.csv
3. Salary_Data.csv
This Photo by Unknown Author is licensed under CC BY-SA-NC
A Vital Commodity
“It is a capital mistake to
theorize before one has
data.”
Sir Arthur Conan Doyle
Author
Sherlock Holmes
The Big Data Environment
216,000TB Amount of new information
generated per person per year
90% Proportion of the world’s total
big data created in the past 3
years.
$65 million Boost in net income for every
Fortune 1000 company (if
data access is boosted 10%)
83% Proportion of surveyed
businesses (Accenture)
investing in Big Data
initiatives.
Inevitable Transition
Force multiplier - Big data analytics and analytics
infrastructure is the means by which institutions apply force to
achieve geo-economic advantage.
Commercial activities will increasing relay on sophisticated
network-based logistics, communications systems and a big
data ecology to recommend products, retain customers and
mitigate churn.
The goal is to turn data into information, and information into
insight.
Techniques
There are a number of widely used analysis techniques to
extract valuable insights from data.
• Association rule learning
• Classification tree analysis
• Genetic algorithms
• Machine learning
• Regression analysis
This Photo by Unknown Author is licensed under CC BY-SA-NC
Association Rule Learning
Association rule learning is a method for discovering interesting
correlations between variables in large databases. It was first used by
major supermarket chains to discover interesting relations between
products, using data from supermarket point-of-sale (POS) systems.
“Are people who purchase tea more or less
likely to purchase carbonated drinks?”
Association Rule Learning Association rule learning is used to:
• place (correlated) products in better proximity to each other
in order to increase sales
• Determine data quality in accounting
• Help in investment planning
• monitor system logs to detect intruders and malicious
activity
• provide insight in revenue analysis
T h is
P h o to
b y U
n k n o w
n A
u th
o r is
lic e n s e d u
n d e r C
C B
Y
This Photo by Unknown Author is licensed under CC BY-NC-ND
Association coding concepts
“The Apriori Algorithm, used for the first phase of the Association Rules, is the most popular and classical algorithm in the frequent old parts. These algorithm properties and data are evaluated with Boolean Association Rules. In this algorithm, there are product clusters that pass frequently, and then strong relationships between these products and other products are sought. Three main parameters that are used to identify the strength of the algorithm are
Activity 2: Python in Colab
• Make sure you have access (signed in) to Colab https://colab.research.google.com
• Click on the ‘File’ menu and select ‘New notebook’
Activity 2: Python in Colab
We have grocery store data for you to analyse
• The code is given below. All you have to do is click on the arrows and run the
code
• NOTE: you don’t need to run the interpretation text at the end it is just to help
you interpret the results
• https://colab.research.google.com/drive/1Qg0qokW_oDUI6xU8gvmZeV6AiMo
6bhxu?usp=sharing
• We start by getting you to choose to upload the GroceryStoreDataSet.csv file
on MyKBS
(You will be prompted to Choose (find) the data file from where it is
stored on your device)
Activity 2: Output
Interpretation
# The probability of seeing sugar sales is seen as 30%.
# Bread intake is seen as 65%.
# We can say that the support of both of them is measured as 20%.
# 67% of those who buys sugar, buys bread as well.
# Users who buy sugar will likely consume 3% more bread than users who don't buy sugar.
# Their correlation with each other is seen as 1.05.
# As a result, if item X and Y are bought together more frequently, then several steps can be take
n to increase the profit.
Glossary 1: What are Bonds and
mortgage-backed security (MBS) ?
• Securitisation is about pooling debt (such as mortgages) and selling their cash flows, as securities, to third party investors
• A bond is a fixed income security that provides a return in the form of fixed interest payments made at regular intervals over time
• A mortgage-backed security (MBS) is an investment similar to a bond. A MBS consists of a bundle of loans sold to investors.
• The bundles are rated between AAA (best, debts most likely to be paid back) through to “not rated” (worst)
• The bank effectively becomes an intermediary between a person with a mortgage and investors. See next slide
Risk Ratings
Can machine learning help classify items for investment?
Classification Tree Analysis YES! Classification, a machine learning method can be used to classify debt
• Statistical classification is a method of identifying categories that a
new observation belongs to. It requires a training set of correctly
identified observations – historical data in other words.
• Classifying customers correctly will maximise sales and minimise
expenses (cost of acquisition, discounts, bad debt etc).
“Are these mortgages investment grade or sub-prime?”
AAA BBB D
Classification Tree Analysis
Statistical classification is also being used to:
• automatically assign financial documents to
categories;
• categorize customers into groupings (e.g.
insurance);
• classify transactions This Photo by Unknown Author is licensed under CC BY-NC
Activity 3: Decision Trees
• Decision trees that classify items into categories are called “Classification tree”
• Decision trees that predicts numerical values is called “Regression tree”
Watch the video at https://www.youtube.com/watch?v=zs6yHVtxyv8
From groups,
• Suppose that you are an analyst at the tax office. You wish to identify which of
your clients is most likely to avoid lodging a tax return form and thus avoid
paying tax (or even recouping funds after paying too much tax)
1. Discuss the idea of using a classification tree for this purpose
2. How would you limit so-called “overfitting”?
3. What kind of data would you collect for the classification tree?
Genetic Algorithms
Genetic algorithms are inspired by the way evolution works – that is,
through mechanisms such as inheritance, mutation and natural selection.
These mechanisms are used to “evolve” useful solutions to problems that
require optimization.
“Which TV programs should we offer viewers,
and in what time slot, to maximize viewership?”
Genetic Algorithms
• A biology- inspired algorithm which reflects natural selection (the fittest
individuals survive)
• Technically an optimisation method
• It has three main rules: selection
crossovermutation
evaluation
This Photo by Unknown Author is licensed under CC BY-SA
1. “Selection rules select the
individuals, called parents, that
contribute to the population at the
next generation.”
2. Crossover rules represent
reproduction, i.e. combining two
parents to form children.
3. Mutation rules apply random
changes to individual parents to
create genetic diversity in children.
Genetic Algorithms Genetic algorithms are being used in:
• Finance:
– Algorithmic trading;
– Financial statement fraud
• In accounting
– Distribution problems assigning sources to destinations
– Bankruptcy predictions
• The cobweb model in economics which explains
why prices may fluctuate in certain markets.
This Photo by Unknown
Author is licensed under
CC BY
Activity 4: Genetic Algorithms
• Here is a video with a real-world examples of a genetic algorithms. Watch the video at
https://www.youtube.com/watch?v=ziMHaGQJuSI
Form groups and answer the following,
Q1. What issues do genetic algorithms appear to have at the start?
Q2. What are the three rules used here?
Q3. What applications are shown here?
Q4. How could this be used in accounting and finance?
Machine Learning
Machine learning includes software that can ‘learn’ from data and generate
adaptive solutions. It gives computers the ability to compute solutions
without being explicitly programmed along a strict instruction set.
Applications are primarily focused on making predictions based on known
properties learned from sets of ‘training data’.
“What other products would this customer likely
purchase, based on their transaction history?”
Extract Transform Test Validate
Machine Learning
Machine learning is being used to:
• distinguish between spam and non-spam email
messages;
• learn invoice coding behaviours for allocation
purposes
• determine the best content for engaging
prospective customers;
• run AI chatbots for customer enquiries
This Photo by Unknown Author is licensed under CC BY-NC-ND
Activity 5: Customer churn example
Source: https://www.kaggle.com/kmalit/bank-customer-churn-prediction
• Watch the demo by your teacher or run the code for analysis of
customer churn at
https://colab.research.google.com/drive/1Sgro8G9o2UtErsiEMG-
UOe7yS-JQMqUU?usp=sharing
• Data for this script is Churn_Modelling.csv
• NOTE: This is a part of a project on Kaggle, so we took a small section
of it to give you an appreciation of this technique
• Interpret your findings. For example, regarding churn, is there any
difference depending on the country of origin of customers, gender,
ownership of a credit card or whether or not a member is active?
Regression Analysis
• Regression analysis involves manipulating one or more independent
variables (i.e. number of customers) to see how they influence a
dependent variable (i.e. weekly sales).
• The dependent variable is also called a target variable
• The independent variable is also called a predictor variable
“How would social, biological, demographic and
lifestyle factors affect health insurance premiums?”
Social Biological Demography Validate
Copyright © 2013 Pearson Australia (a division of Pearson Australia Group Pty Ltd) – 9781442549272/Berenson/Business Statistics /2e
The simple linear regression equation (derived from a sample) looks like a
straight line. The mathematical representation is shown below.
Estimate of
the
regression
intercept
Estimate of the regression
slope
Estimated (or
predicted) Y value for
observation i
Value of X for observation
i𝒀𝒊 = 𝒃𝟎 + 𝒃𝟏 𝑿𝒊
Simple linear regression equation
for estimating values
• Example: 𝑊𝑒𝑒𝑘𝑙𝑦 𝑠𝑎𝑙𝑒𝑠 = 98.248 + 0.110 Number of customers
• Weekly sales is the target variable,
• Number of customers is a predictor variable
Simple linear regression equation
for estimating values • Example: 𝑊𝑒𝑒𝑘𝑙𝑦 𝑠𝑎𝑙𝑒𝑠 = 98.248 + 0.110 Number of customers
• Weekly sales is the target variable,
• Number of customers is a predictor variable
0
50
100
150
200
250
300
0 500 1000 1500 2000
W e
e k ly
S a
le s
Number of Customers
slopeintercept x𝒀
Regression Analysis Applications
Regression analysis is being used to determine how:
• In Economics:
– Demand curves
– Predicting economic growth rate
• In Finance:
– Forecasting, e.g. revenues from Ads
– Bank performance given multiple variables
– levels of customer satisfaction affect customer loyalty
• In accounting:
– to estimate fixed and variable costs
– Cost versus hours worked
T h e s e P
h o to
s b
y U
n k n o w
n A
u th
o r is
lic e
n s e d u
n d e r C
C B
Y
This Photo by Unknown Author is licensed under CC BY-SA
Glossary: What is Beta?
• Beta is a measure of volatility of returns of stock relative to the overall
market.
• If we plot returns of an individual stock against market returns, e.g. S&P
500 Index, Beta is equal to the slope of the line (see next page)
Glossary: What is Beta?
y = 0.7808x - 0.004
-5.0%
-4.0%
-3.0%
-2.0%
-1.0%
0.0%
1.0%
2.0%
3.0%
-6.0% -4.0% -2.0% 0.0% 2.0% 4.0% 6.0%
M a rk
e t
Indiv Stock
Field: Indiv Stock and Field: Market appear highly correlated.
Other types of regression
This Photo by Unknown Author is licensed under CC BY-SA
T h is
P h o to
b y U
n k n o w
n A
u th
o r is
lic e n s e d u
n d e r C
C B
Y -S
A
Polynomial regression
3-D regression movie
Activity 6: Salary regression model
• We will look at a simple model of how salary is related to years of work
experience.
• Data for this activity in Exploratory is Salary_Data.csv
• Open Exploratory and create a new project called Salary analysis
• Use the Data Frames menu to load the Salary_Data.csv file and save it
Activity 6: Salary regression model
• The Summary in Exploratory shows the distribution of the two variables
• Click on the Analytics menu (in Green)
• Go to the model ‘Type’ menu
• Choose ‘Linear regression’ as the type
of model you want
• Choose ‘Salary’ as the Target variable
• Choose ‘YearExperience’ as the
predictor variable and run
Activity 6: Salary regression model
• Interpret the output in a general sense
• Click on ‘Coef. Table’ to see the values
of the coefficients for the regression
equation
• The equation is
• 𝑆𝑎𝑙𝑎𝑟𝑦 = 25,792 + 9,449 YearsExperience
• You can make estimates from this by
substituting numbers for Years of
experience, e.g. 5 years of experience
gives you an estimate of
• 𝑆𝑎𝑙𝑎𝑟𝑦 = 25,792 +9,449*5 = $73,037
• You will learn more detail on this in week 9 of
STAM4000