+ - 0:00:00
Notes for current slide
Notes for next slide

STAT3622 Data Visualization (Lecture 10)

FinTech Case Studies with DataViz Skills


Dr. Aijun Zhang
The University of Hong Kong

14 April 2020

1 / 20

What's covered in this lecture?

  • Applied AI in Banking and Finance

  • Case 1: Financial Index Analysis

    • Review of AIEQ Case

    • Hang Seng Index

  • Case 2: Financial Anomoly Detection

    • Outlier Peeling Algorithm

    • Radial Chart Visualization

2 / 20

Applied AI in Banking and Finance

3 / 20

Applied AI in FinTech and Financial Services

There are multiple Financial Technology (FinTech) and Financial Service areas where Artificial Intelligence (AI) and Machine Learning (ML) can be applied, including

  • Credit risk management (Credit scoring, Loan acquisition, Default forecasting, P2P lending)

  • Investment analysis (Trading strategy, Portfolio optimization, Money management)

  • Cryptocurrency (BitCoin, Crypto index)

  • Fraud detection and anti-money laundering

  • Customer service (Automated customer support via chatbots, Customer segmentatoin)

4 / 20

Two FinTech Case Studies

In this lecture, we discuss two FinTech case studies with the equipped DataViz skills:

  • Case 1: Financial Index Analysis

    • Review of AIEQ Case

    • Hang Seng Index

  • Case 2: Finanial Anomoly Detection

    • Outlier Peeling Algorithm

    • Radial Chart Visualization

5 / 20

Case 1: Financial Index Analysis

6 / 20

Investment Stratgies

  • Active investing

    • The market is not perfectly efficient

    • Aims to beat the market and take advantage of short-term price fluctuations

  • Passive investing

    • The market is efficient in the long run

    • Buy-and-hold philosophy

    • Index tracking strategy, e.g. ETF

7 / 20

Review of AIEQ Case

2017-10-182017-11-032017-11-212017-12-082017-12-272018-01-162018-02-012018-02-202018-03-082018-03-262018-04-122018-04-302018-05-162018-06-042018-06-202018-07-092018-07-252018-08-102018-08-282018-09-142018-10-022018-10-182018-11-052018-11-212018-12-112018-12-282019-01-162019-02-042019-02-212019-03-112019-03-272019-04-122019-05-012019-05-172019-06-052019-06-212019-07-102019-07-262019-08-132019-08-292019-09-172019-10-032019-10-212019-11-062019-11-222019-12-112019-12-302020-01-162020-02-042020-02-212020-03-102020-03-262020-04-142020-04-302020-05-182020-06-042020-06-222020-07-092020-07-272020-08-122020-08-282020-09-162020-10-022020-10-202020-11-052020-11-232020-12-102020-12-2920253035
EquBot AIEQ: Candlestick ChartDate
  • Click here for the reviewed case study, including AIEQ Performance, Holdings Analysis and Portfolio Analysis
8 / 20

AIEQ Performance To Date

9 / 20

New Case Study: Hang Seng Index

  • Query data from Yahoo!Finance

  • Interactive time series display by R:dygraphs (Online Tutorial)

library(quantmod)
library(xts)
library(dygraphs)
library(htmltools)
date0 = "2000-01-01"
dummy = getSymbols("^HSI", src="yahoo", from = date0)
div(dygraph(HSI$HSI.Close, main = "Hang Seng Index since 2000") %>%
dyRangeSelector(dateWindow = c("2010-01-01", "2018-12-31")) %>%
dyOptions(colors = c("red")),
align="center")
10 / 20
Hang Seng Index since 2000
16000
18000
20000
22000
24000
26000
28000
30000
32000
34000
Jan 2010
Jan 2011
Jan 2012
Jan 2013
Jan 2014
Jan 2015
Jan 2016
Jan 2017
Jan 2018
11 / 20

Hang Seng Index Constituents

  • HSI historical data can be obtained from Bloomberg Terminal

  • We collected daily weights of HSI constituents since 2016-01-01
12 / 20

Hang Seng Index Constituents

  • X.Shares <- X.Weight * HSI.Close * HSI.Divisor / X.Close

  • Data Preprocessing to convert data into space-time format

DataX = read.csv("DataHSI.csv")
DataX$Date2 = as.factor(DataX$Date)
tmp = DataX[!duplicated(DataX$Ticker, fromLast = T),]
idx = order(tmp$Date, tmp$Weight, decreasing = T)
ListTicker=tmp$Ticker[idx]
n = length(ListTicker)
ListDate = as.character(unique(DataX$Date))
MatWeight <- MatShares <- matrix(NA, length(ListDate), n)
for (j in 1:n){
TmpX = DataX[DataX$Ticker==ListTicker[j], c("Date2", "Weight", "Shares")]
MatWeight[as.numeric(TmpX$Date2),j] = TmpX$Weight
MatShares[as.numeric(TmpX$Date2),j] = TmpX$Shares
}
colnames(MatWeight) <- colnames(MatShares) <- ListTicker
MatWeight = xts(MatWeight, order.by=as.Date(ListDate, "%Y%m%d"))
MatShares = xts(MatShares, order.by=as.Date(ListDate, "%Y%m%d"))
13 / 20

HSI Constituent Weights and Shares

par(mfrow=c(1,2), mar=rep(2,4))
image(as.matrix(MatWeight), ylim=c(1,0), col = heat.colors(10), xaxt='n', yaxt='n', main="Weights")
image(as.matrix(MatShares), ylim=c(1,0), col = terrain.colors(10), xaxt='n', yaxt='n', main="Shares")

14 / 20
div(dygraph(MatWeight, main = "HSI Constituent Weights",height=450) %>%
dyRangeSelector(dateWindow = c("2016-01-01", "2018-12-31")) %>%
dyLegend(show = "never"), align="center")
HSI Constituent Weights
0
2
4
6
8
10
12
Jan 2016
Apr 2016
Jul 2016
Oct 2016
Jan 2017
Apr 2017
Jul 2017
Oct 2017
Jan 2018
Apr 2018
Jul 2018
Oct 2018
15 / 20
TmpX = MatShares[,1:4]; TmpX = TmpX/rep(1, dim(TmpX)[1])%*%t(colMeans(TmpX, na.rm=T))
div(dygraph(TmpX, main = "HSI Constituent Shares", ylab="Normalized shares",height=450) %>%
dyRangeSelector(dateWindow = c("2016-01-01", "2018-12-31")) %>%
dyOptions(colors = c("red", "blue", "green", "cyan"), strokeWidth=2), align="center")
HSI Constituent Shares
Normalized shares
5.HK
1299.HK
700.HK
939.HK
0.6
0.7
0.8
0.9
1
1.1
1.2
1.3
1.4
1.5
Jan 2016
Apr 2016
Jul 2016
Oct 2016
Jan 2017
Apr 2017
Jul 2017
Oct 2017
Jan 2018
Apr 2018
Jul 2018
Oct 2018
16 / 20

HSI Constituent Rebalancing

TmpX = MatShares[,"700.HK"]
div(dygraph(TmpX, main = "HSI Constituent Shares: 700.HK", height=360) %>%
dyRangeSelector(dateWindow = c("2016-01-01", "2018-12-31")) %>%
dyOptions(colors = "green"), align="center")
HSI Constituent Shares: 700.HK
200000
250000
300000
350000
400000
450000
Jan 2016
Apr 2016
Jul 2016
Oct 2016
Jan 2017
Apr 2017
Jul 2017
Oct 2017
Jan 2018
Apr 2018
Jul 2018
Oct 2018
17 / 20

Question of interest:

The AIEQ that tracks S&P500 is based on a semi-passive strategy, can we find its equivalent for Hang Seng index?

18 / 20

Case Study 2: Financial Anomoly Detection

Link to Black September 2008

19 / 20

Thank you!

Q&A or Email ajzhang@umich.edu。

20 / 20

What's covered in this lecture?

  • Applied AI in Banking and Finance

  • Case 1: Financial Index Analysis

    • Review of AIEQ Case

    • Hang Seng Index

  • Case 2: Financial Anomoly Detection

    • Outlier Peeling Algorithm

    • Radial Chart Visualization

2 / 20
Paused

Help

Keyboard shortcuts

, , Pg Up, k Go to previous slide
, , Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
Number + Return Go to specific slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
t Restart the presentation timer
?, h Toggle this help
Esc Back to slideshow