hidden markov models for financial market...

37
Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections Hidden Markov Models for Financial Market Predictions Nguyet Nguyen Department of Mathematics and Statistics Youngstown State University Central Spring Sectional Meeting, Michigan State University, March 15 Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Upload: others

Post on 01-Mar-2021

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

Hidden Markov Models for Financial MarketPredictions

Nguyet Nguyen

Department of Mathematics and StatisticsYoungstown State University

Central Spring Sectional Meeting, Michigan State University,March 15

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 2: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

1 Introduction of HMMs

2 HMMs for economics regimes

3 HMMs for stock prices

4 HMM for stock sections

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 3: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

History of HMMs

Introduced in 1966 by Baum and Petrie

Baum and his colleagues published HMM training for a singleobservation, 1970

Levonson, Rabiner, and Sondhi presented HMM training formultiple independent observations, 1983

Li, Parizeau, and Plamondo introduced HMM traning formultiple observations, 2000

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 4: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

What is a Hidden Markov Model?

Hidden Markov Model (HMM): stochastic signal model with threeassumptions:

The observation at time t, Ot , was generated by some processwhose state, St , is hidden.The hidden process satisfies the first-order Markov property:given St−1, St is independent of Si for any i < t − 1.The hidden state variable is discrete.

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 5: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

Some applications of HMMs

Figure : 1. Speech recognition 2. Bioinformatics 3. Finance

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 6: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

Elements of HMM

Observation data, O = (Ot), t = 1, ..,T

Hidden states, S = (Si ), i = 1, 2, ...,N

Hidden state sequence: Q = (qt), t = 1, ...,T

Transition matrix A = (aij)

aij = P(qt = Sj |qt−1 = Si ), i , j = 1, 2, ...,N

Observation symbols per state, V = (vk), k = 1, 2, ...,M

The observation probability B = (bik)

bik = P(Ot = vk |qt = Si ), i = 1, 2, ...,N; k = 1, 2, ...,M

Initial probabilities, vector p, of being in state Si at t = 1

pi = P(q1 = Si ), i = 1, 2, ...,N

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 7: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

Hidden Markov Model

S2

S1 S1

S2

t t+1

a11

a12

a21

a22

Ot Ot+1

b1(Ot)

b2(Ot)

Parameters of HMM: λ = {A,B, p}

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 8: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

Three problems and corresponding solutions for HMMs

1 Given (O, λ), compute the probability of observations, P(O|λ)

Forward, backward algorithm

2 Given (O, λ), simulate the most likely hidden states, Q

Viterbi algorithm

3 Given O, calibrate HMM parameters, λ

Baum-Welch algorithm

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 9: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

Three problems and corresponding solutions for HMMs

1 Given (O, λ), compute the probability of observations, P(O|λ)

Forward, backward algorithm

2 Given (O, λ), simulate the most likely hidden states, Q

Viterbi algorithm

3 Given O, calibrate HMM parameters, λ

Baum-Welch algorithm

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 10: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

Three problems and corresponding solutions for HMMs

1 Given (O, λ), compute the probability of observations, P(O|λ)

Forward, backward algorithm

2 Given (O, λ), simulate the most likely hidden states, Q

Viterbi algorithm

3 Given O, calibrate HMM parameters, λ

Baum-Welch algorithm

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 11: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

Three problems and corresponding solutions for HMMs

1 Given (O, λ), compute the probability of observations, P(O|λ)

Forward, backward algorithm

2 Given (O, λ), simulate the most likely hidden states, Q

Viterbi algorithm

3 Given O, calibrate HMM parameters, λ

Baum-Welch algorithm

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 12: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

Three problems and corresponding solutions for HMMs

1 Given (O, λ), compute the probability of observations, P(O|λ)

Forward, backward algorithm

2 Given (O, λ), simulate the most likely hidden states, Q

Viterbi algorithm

3 Given O, calibrate HMM parameters, λ

Baum-Welch algorithm

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 13: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

Three problems and corresponding solutions for HMMs

1 Given (O, λ), compute the probability of observations, P(O|λ)

Forward, backward algorithm

2 Given (O, λ), simulate the most likely hidden states, Q

Viterbi algorithm

3 Given O, calibrate HMM parameters, λ

Baum-Welch algorithm

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 14: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

Forward Algorithm

Define the joint probability αt(i) = P(O1,O2, ...,Ot , qt = Si |λ)

Si

t-1 t

t(i)

forwardNguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 15: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

Forward algorithm

Initialization, α1(i) = pibi (O1) for i = 1, ...,N

For t = 2, 3, ...,T , for j = 1, ...,N

αt(j) =

[N∑i=1

αt−1(i)aij

]bj(Ot),

P(O|λ) =∑N

i=1 αT (i)

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 16: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

Backward Algorithm

Define the conditional probabilityβt(j) = P(Ot+1,Ot+2, ..,OT |qt = Sj , λ), for j = 1, ...,N

Sj

t+1 t+2

t+1(j)

backwardNguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 17: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

Backward Algorithm

Algorithm

Initialization, βT (i) = 1 for i = 1, ...,N

For t = T − 1,T − 2, ..., 1, for i = 1, ...,N

βt(i) =N∑j=1

aijbj(Ot+1)βt+1(j)

P(O|λ) =∑N

i=1 pibi (O1)β1(i)

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 18: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

Forecast economics regimes using HMM

1 Inflation (CPI)

2 Credit Index

3 Yield Curve

4 Commodity

5 Dow Jones Industrial Average

HMM assumptions:

There are two states represent Bull and Bear market.

The observation corresponding with each state follows anormal distribution.

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 19: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

Training and Predicting Process

Using the variables above:

Use HMM for single and multiple observation data withnormal distributions.

Calibrate Markov-switching model parameters usingBaum-Welch algorithm

Define state or regime 2 with lower mean/variance

Use the obtained parameters to predict the correspondingstates (regimes), predict the upcoming regime.

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 20: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

Results

HMM Bear Market (monthly 5/2006−5/2013)

Time

Nor

mal

ized

dat

a

2007 2008 2009 2010 2011 2012 2013

−3

−2

−1

01

2

DJIANDR Bear MarketHMM Bear Market

Figure : Dow Jones observations vs probabilities of being in the bearmarket

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 21: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

Results

Figure : Forecast bear market using CPI indicator

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 22: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

Results

HMM Forecast Bear Market (monthly 10/2006−5/2013)

Time

Nor

mal

ized

dat

a

2007 2008 2009 2010 2011 2012 2013

−3

−2

−1

01

2

DJIACredit IndexYield CurveCommodityHMM Bear Market

Figure : Forecast bear market using multiple observations

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 23: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

Forecast stock price using HMM

S&P 500, a stock market index based on the marketcapitalizations of 500 large companies having common stocklisted on the NYSE or NASDAQ. Monthly percentage changesfrom February 1947 through June 2013.

SPY

GOOG

FORD

AAPL

GE

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 24: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

Training and Predicting Process

Using the variables above:

Use HMM for single and multiple observation data withnormal distributions.

Calibrate Markov-switching model parameters usingBaum-Welch algorithm

Use the obtained parameters to predict stock prices for thenext trading period.

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 25: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

●●

●●

●●●●●●●

●●●

●●

●●●●

●●●

●●●

●●●●●●

●●●

●●●

●●●

●●

●●

●●●●●

●●

●●●

●●

●●●

●●

●●

●●●●●●

●●

●●

●●

●●

●●●●

●●●●●

●●

●●●

●●

●●

●●●

●●●●●●

●●●

●●●

●●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●●

●●

●●

●●●

●●

●●

●●

●●●●

●●●

●●●

0 50 100 150 200 250

1300

1400

1500

1600

1700

S&P500 Using Close Prices 7/30/2012−7/31/2013

Times

S&

P50

0 P

rices

● True priceEstimated price

Figure : Forecast S&P500 close prices using single observation

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 26: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

●●

●●

●●●●●●●

●●●

●●

●●●●

●●●

●●●

●●●●●●

●●●

●●●

●●●

●●

●●

●●●●●

●●

●●●

●●

●●●

●●

●●

●●●●●●

●●

●●

●●

●●

●●●●

●●●●●

●●

●●●

●●

●●

●●●

●●●●●●

●●●

●●●

●●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●●

●●

●●

●●●

●●

●●

●●

●●●●

●●●

●●●

0 50 100 150 200 250

1300

1400

1500

1600

1700

S&P500 Using Close−Open−High−Low 7/30/2012−7/31/2013

Times

S&

P50

0 P

rices

● True priceEstimated price

Figure : Forecast S&P500 closing prices using multiple observations(open-close-high-low)

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 27: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

● ●

● ●

● ●

● ● ● ● ●

● ● ●

● ● ●

● ●

● ●

● ● ●

● ● ●

● ● ●

● ● ● ●

● ● ●

● ● ●

● ● ●

● ● ● ● ●

● ● ● ● ● ● ●

● ●

● ●

● ● ●

● ● ● ● ● ● ● ●

● ● ● ●

● ● ● ● ● ● ● ● ● ●

● ● ● ● ●

● ●

● ● ●

0 20 40 60 80 100

126.

912

7.0

127.

112

7.2

127.

3

SPY 10:51:52 to 10:53:41 on 1/7/2011

Times

S&

P50

0 P

rices

● True priceEstimated price

Figure : Forecast SPY bid price in tick by tick

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 28: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

Can we use HMMs to make money?

Symbol Initial Investment ($) Earning ($) Earning %

SPY 9,000.00 2050.66 22.79

GOOG 30,000.00 29,036.4 96.79

FORD 250.00 10.10 4.04

AAPL 950.00 19.06 2.01

GE 1,700.00 490.00 28.82

TOTAL 41,900.00 31,606.22 75.43

Table : One year daily stock trading portfolio from December 2012 toDecember 2013

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 29: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

HMM for stock selections

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 30: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

Stock Factors

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 31: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

HMM for stock selections

1 Each month, look at regimes of the four macro variables, e.g.{CPI ,SP500,VIX ,GDP} = {2, 1, 1, 2}

2 Look back all months with the same regimes {2, 1, 1, 2} andcheck factor performances and then rank factor performances(factor did well for that regime will have higher rank andhigher weight)

3 Add all factor’s ranks to find a composite score (from 0 to100) for each stock

4 Pick top 50 stocks

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 32: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

Economic Growth (GDP)

Growth (Quarterly GDP Growth Rate) - 2 Regimes Monthly Data 1990-01-31 to 2014-12-31 (Log Scale)

Regime Parameters (2014-12-31)

Mu Sigma

Regime 1 (Unshaded)

Regime 2 (Shaded)

Regime 1 (Unshaded)

Regime 2 (Shaded)

0.79 0.37 0.55 1.26

Data Statistics

Mean Variance

Regime 1 (Unshaded)

Regime 2 (Shaded)

Regime 1 (Unshaded)

Regime 2 (Shaded)

0.82 -0.00 0.16 0.60

Growth (Quarterly GDP Growth Rate) - 2 Regimes Monthly Data 1990-01-31 to 2014-12-31 (Log Scale)

Regime Parameters (2014-12-31)

Mu Sigma

Regime 1 (Unshaded)

Regime 2 (Shaded)

Regime 1 (Unshaded)

Regime 2 (Shaded)

0.79 0.37 0.55 1.26

Data Statistics

Mean Variance

Regime 1 (Unshaded)

Regime 2 (Shaded)

Regime 1 (Unshaded)

Regime 2 (Shaded)

0.82 -0.00 0.16 0.60

1990 1992 1994 1996 1998 2000 2002 2004 2006 2008 2010 2012 20148,913

9,441

10,000

10,593

11,220

11,885

12,589

13,335

14,125

14,962

15,849

8,913

9,441

10,000

10,593

11,220

11,885

12,589

13,335

14,125

14,962

15,849

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 33: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

Top Decile of Cash/Enterprise Value vs. S&P 500 Monthly Data 1999-12-31 to 2014-12-31 (Log Scale)

TitleGain/

AnnumStandard Deviation

Downside Deviation

Batting Average

Sharpe Ratio

Info Ratio

Tracking Error

Max Drawdown

Top Decile of Cash/Enterprise Value 14.2% 24.5% 19.2% 59.4% 0.50 0.93 12.8% -65.7% (2007-05-31..2009-03-01)  

S&P 500 Index 2.3% 15.7% 12.3% 0.03 -52.5% (2007-09-30..2009-03-01)  

Top Decile of Cash/Enterprise Value vs. S&P 500 Monthly Data 1999-12-31 to 2014-12-31 (Log Scale)

TitleGain/

AnnumStandard Deviation

Downside Deviation

Batting Average

Sharpe Ratio

Info Ratio

Tracking Error

Max Drawdown

Top Decile of Cash/Enterprise Value 14.2% 24.5% 19.2% 59.4% 0.50 0.93 12.8% -65.7% (2007-05-31..2009-03-01)  

S&P 500 Index 2.3% 15.7% 12.3% 0.03 -52.5% (2007-09-30..2009-03-01)  

2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015

40

50

63

79

100

126

158

200

251

316

398

501

631

794

1,000

40

50

63

79

100

126

158

200

251

316

398

501

631

794

1,000Top Decile of Cash/Enterprise Value (2014-12-31) = 729.75Rescaled S&P 500 Index (2014-12-31) = 140.13

*Not Including Transaction Costs. *Equity Lines Start at 100 on 1999-12-31.

-10-505

1015202530354045505560

-10-505

1015202530354045505560Excess Return

Cumulative Excess Return (1/10 Scale)

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 34: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

Top Decile of 1-Month Momentum vs. S&P 500 Monthly Data 1999-12-31 to 2014-12-31 (Log Scale)

TitleGain/

AnnumStandard Deviation

Downside Deviation

Batting Average

Sharpe Ratio

Info Ratio

Tracking Error

Max Drawdown

Top Decile of 1-Month Momentum 5.0% 22.1% 16.3% 51.7% 0.14 0.21 12.5% -60.1% (2007-09-30..2009-03-01)  

S&P 500 Index 2.3% 15.7% 12.3% 0.03 -52.5% (2007-09-30..2009-03-01)  

Top Decile of 1-Month Momentum vs. S&P 500 Monthly Data 1999-12-31 to 2014-12-31 (Log Scale)

TitleGain/

AnnumStandard Deviation

Downside Deviation

Batting Average

Sharpe Ratio

Info Ratio

Tracking Error

Max Drawdown

Top Decile of 1-Month Momentum 5.0% 22.1% 16.3% 51.7% 0.14 0.21 12.5% -60.1% (2007-09-30..2009-03-01)  

S&P 500 Index 2.3% 15.7% 12.3% 0.03 -52.5% (2007-09-30..2009-03-01)  

2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015

45

50

56

63

71

79

89

100

112

126

141

158

178

200

224

251

45

50

56

63

71

79

89

100

112

126

141

158

178

200

224

251Top Decile of 1-Month Momentum (2014-12-31) = 206.60Rescaled S&P 500 Index (2014-12-31) = 140.13

*Not Including Transaction Costs. *Equity Lines Start at 100 on 1999-12-31.

-12.5-10.0

-7.5-5.0-2.50.02.55.07.5

10.012.515.017.520.022.525.027.5

-12.5-10.0

-7.5-5.0-2.50.02.55.07.5

10.012.515.017.520.022.525.027.5Excess Return

Cumulative Excess Return (1/10 Scale)

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 35: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

Factor Weight Monthly Data 1999-12-31 to 2014-12-31Factor Weight Monthly Data 1999-12-31 to 2014-12-31

2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015

0.10

0.15

0.20

0.25

0.30

0.10

0.15

0.20

0.25

0.30

Earnings/Price Weight 2014-12-31 = 0.13

0.15

0.20

0.25

0.30

0.15

0.20

0.25

0.30

Free Cash Flow/Enterprise Value Weight 2014-12-31 = 0.33

0.10

0.15

0.20

0.25

0.30

0.10

0.15

0.20

0.25

0.30

Sales/Enterprise Value Weight 2014-12-31 = 0.20

0.10

0.15

0.20

0.25

0.30

0.10

0.15

0.20

0.25

0.30

12-Month Momentum Weight 2014-12-31 = 0.27

0.10

0.15

0.20

0.25

0.30

0.10

0.15

0.20

0.25

0.30

1-Month Momentum Weight 2014-12-31 = 0.07

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 36: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

Top Decile of Model Composite Score vs. S&P 500 Monthly Data 1999-12-31 to 2014-12-31 (Log Scale)

TitleGain/

AnnumStandard Deviation

Downside Deviation

Batting Average

Sharpe Ratio

Info Ratio

Tracking Error

Max Drawdown

Top Decile of Model Composite Score 11.1% 21.8% 18.1% 58.9% 0.42 0.82 10.8% -61.9% (2007-05-31..2009-03-01)  

S&P 500 Index 2.3% 15.7% 12.3% 0.03 -52.5% (2007-09-30..2009-03-01)  

Top Decile of Model Composite Score vs. S&P 500 Monthly Data 1999-12-31 to 2014-12-31 (Log Scale)

TitleGain/

AnnumStandard Deviation

Downside Deviation

Batting Average

Sharpe Ratio

Info Ratio

Tracking Error

Max Drawdown

Top Decile of Model Composite Score 11.1% 21.8% 18.1% 58.9% 0.42 0.82 10.8% -61.9% (2007-05-31..2009-03-01)  

S&P 500 Index 2.3% 15.7% 12.3% 0.03 -52.5% (2007-09-30..2009-03-01)  

2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015

50

63

79

100

126

158

200

251

316

398

501

631

50

63

79

100

126

158

200

251

316

398

501

631Top Decile of Model Composite Score (2014-12-31) = 484.87Rescaled S&P 500 Index (2014-12-31) = 140.13

*Not Including Transaction Costs. *Equity Lines Start at 100 on 1999-12-31.

-15

-10

-5

0

5

10

15

20

25

30

35

-15

-10

-5

0

5

10

15

20

25

30

35Excess ReturnCumulative Excess Return (1/10 Scale)

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions

Page 37: Hidden Markov Models for Financial Market Predictionsmsuams2015.weebly.com/uploads/4/4/6/1/44611161/nguyen... · 2019. 8. 18. · Forecast stock price using HMM S&P 500, a stock market

Outline Introduction of HMMs HMMs for economics regimes HMMs for stock prices HMM for stock sections

Thank you!

Nguyet Nguyen: [email protected]

Department of Mathematics & Statistics

Youngstown State University

Nguyet Nguyen Hidden Markov Models for Financial Market Predictions