Docsity

Hidden Markov Models (HMMs) in Stock Market Analysis - Prof. Bonnie J. Dorr, Study notes of Computer Science

Partial preview of the text

Download Hidden Markov Models (HMMs) in Stock Market Analysis - Prof. Bonnie J. Dorr and more Study notes Computer Science in PDF only on Docsity!

CMSC 723/LING 723

Computational Linguistics I

Hidden Markov Models

Expectation Maximization

Lecture 6

October 3, 2007

Professor : Bonnie Dorr

Co-instructor : Nitin Madnani

TAs : Hamid Shahri, Alexandros Tzannes

Administrivia

Asking questions

Use the forum (http://forum.cs.umd.edu)

Use existing FAQ thread

Set up daily notifications for forum

Forum Tools → Subscribe

Email should only be used as a last resort

Please CC all 4 of us!

Assignment 3 out; Assignment 2 due!

http://www.umiacs.umd.edu/~nmadnani/teaching/723/assignments/3/

assignment3.zip

Recap: Finite State Machines

What do you need to specify an FSM formally?

Finite State Machines

Finite number of states

Finite State Machines

Input alphabet

a b c a b c

Finite State Machines

Start state

a b c a b c

Using Real-world Knowledge

1 2 3 4 a b c a b c ‘a’ is twice as likely to be seen in state 1 as ‘b’ or ‘c’ ‘c’ is three times as likely to be seen in state 2 as ‘a’ Probabilistic FSMs

What do we get out of it? P(‘ab’) = 0.50 * 1.00 = 0. P(‘bc’) = 0.25 * 0.75 = 0. The prob. of all arcs going out of a state must sum to 1

Markov Chains

0. 0.2 0.

  • Is this a valid prob. FSM?
  • What’s missing?
  • Can we pick one to start from?
  • So? **BULL BEAR STATIC

0.2 0.

0.** No! The start state No! The stock market Use “prior probabilities”

Are states always observable?

Day: 1 2 3 4 5 6 ↑ ↓ ↑ ↓

↑: Market is up

↓: Market is down

: Market hasn’t changed

Bu Be S Be S Bu

Bu: Bull Market

Be: Bear Market

S : Static Market

Not observable!

Here’s what you actually observe:

Hidden Markov Models

Markov chains are usually inadequate

Need to model problems where observed events

don’t correspond to states directly

Instead, observations = fp(states) for some p.d.f p

Solution: A Hidden Markov Model (HMM)

  • Assume two probabilistic processes
  • Underlying process is hidden (states = hidden events)
  • Second process produces sequence of observed events

Things to know about HMMs

The (first-order) Markov assumption holds

The probability of an output symbol

depends only on the state generating it

The number of states (N) does not have to

equal the number of observations (T)

P (ot|q 1 , q 2 ,... , qN , o 1 , o 2 ,... , oT ) = P (ot|qi)

Stock Market HMM

BEAR BULL STATIC States?

Stock Market HMM

States ✓ Transitions ✓

Valid ✓

**BEAR BULL STATIC

0.2 0.

0.** Vocabulary? V = {↑, ↓, ↔}

Stock Market HMM

States ✓ Transitions ✓

Valid ✓

**BEAR BULL STATIC

0.2 0.

0.** Vocabulary ✓ V = {↑, ↓, ↔} Emissions?   P (↑ |Bull) = 0. 7 P (↓ |Bull) = 0. 1 P (↔ |Bull) = 0. 2

P (↑ |Bear) = 0. 1 P (↓ |Bear) = 0. 6 P (↔ |Bear) = 0. 3

P (↑ |Static) = 0. 3 P (↓ |Static) = 0. 3 P (↔ |Static) = 0. 4

Valid?