markovprocessesmeng

29
 Matlab Simulations of  Markov Models  Yu Meng Department of Computer Science and Engineering Southern Methodist University

Upload: rfoliveira1975

Post on 07-Apr-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: MarkovProcessesMeng

8/4/2019 MarkovProcessesMeng

http://slidepdf.com/reader/full/markovprocessesmeng 1/29

Page 2: MarkovProcessesMeng

8/4/2019 MarkovProcessesMeng

http://slidepdf.com/reader/full/markovprocessesmeng 2/29

OutlinesMarkov models

 /process/chain/property/HMM

Matlab simulations

 Applications

 Advantages and LimitationsConclusions.

Page 3: MarkovProcessesMeng

8/4/2019 MarkovProcessesMeng

http://slidepdf.com/reader/full/markovprocessesmeng 3/29

 Markov ProcessMarkov process is a simple stochasticprocess in which the distribution of future states depends only on thepresent state and not on how it arrivedin the present state.

Page 4: MarkovProcessesMeng

8/4/2019 MarkovProcessesMeng

http://slidepdf.com/reader/full/markovprocessesmeng 4/29

 Markov Models

 – A finite state representation

Page 5: MarkovProcessesMeng

8/4/2019 MarkovProcessesMeng

http://slidepdf.com/reader/full/markovprocessesmeng 5/29

 Markov PropertyMany systems in real world have theproperty that given present state, thepast states have no influence on thefuture. This property is called Markov 

 property.

Page 6: MarkovProcessesMeng

8/4/2019 MarkovProcessesMeng

http://slidepdf.com/reader/full/markovprocessesmeng 6/29

State Space and Time SpaceState Space 

Time Space  Discrete  Continuous 

Discrete 

(Markov

chain)  X Continuous 

X  X 

Page 7: MarkovProcessesMeng

8/4/2019 MarkovProcessesMeng

http://slidepdf.com/reader/full/markovprocessesmeng 7/29

 Markov ChainLet {X t  : t is in T} be a stochastic process withdiscrete-state space S and discrete-time space

T satisfying Markov property

 P( X n+1 = j|X n = i, X n-1 = in-1 , · · ·,X 0 = i0) =  P( X 

n+1

= j|X n

 = i) for any set of state i0 , i1 , · · · , in-1 , i, j in S andn ≥ 0 is called a Markov Chain. 

Page 8: MarkovProcessesMeng

8/4/2019 MarkovProcessesMeng

http://slidepdf.com/reader/full/markovprocessesmeng 8/29

 Hidden Markov Models (HMM)In an hidden Markov Model(HMM), we don’tknow the state sequence. However we know

some probabilistic function of it.In plain English, Markov model can be viewedas a probabilistic finite state engine. Thestate is changing over time. But we have no

way to determine the exact changes of thestate. We are able to observe some fuzzyreflections of the change. Our objective is toestimate the states of the machine via the

(possibly fuzzy) observations.

Page 9: MarkovProcessesMeng

8/4/2019 MarkovProcessesMeng

http://slidepdf.com/reader/full/markovprocessesmeng 9/29

 Markov Model exampleThe weather in Dallas of past 26 daysSTATES  = { pretty, pretty, pretty, pretty, pretty, pretty,

pretty, pretty, pretty, pretty, rainy, rainy, rainy, rainy, rainy,pretty, pretty, pretty, pretty, pretty, pretty, pretty, pretty,pretty, pretty, pretty }

Page 10: MarkovProcessesMeng

8/4/2019 MarkovProcessesMeng

http://slidepdf.com/reader/full/markovprocessesmeng 10/29

 Markov Model exampleThe weather in Dallas of past 26 daysSTATES  = { pretty, pretty, pretty, pretty, pretty, pretty, pretty,

pretty, pretty, pretty, rainy, rainy, rainy, rainy, rainy, pretty,pretty, pretty, pretty, pretty, pretty, pretty, pretty, pretty,pretty, pretty }

Tomorrow’s weather  Today’s

WeatherPretty Rainy

Pretty 0.95 0.05

Rainy 0.2 0.8

Page 11: MarkovProcessesMeng

8/4/2019 MarkovProcessesMeng

http://slidepdf.com/reader/full/markovprocessesmeng 11/29

 Markov Model example (2)

Pretty

Rainy

0.95

0.8

0.05

0.2

Page 12: MarkovProcessesMeng

8/4/2019 MarkovProcessesMeng

http://slidepdf.com/reader/full/markovprocessesmeng 12/29

 Markov Model example (2)

Pretty

Rainy

0.95

0.8

0.05

0.2

Page 13: MarkovProcessesMeng

8/4/2019 MarkovProcessesMeng

http://slidepdf.com/reader/full/markovprocessesmeng 13/29

 Markov Model example(3)Hidden model.

Many time we don’t have a direct observation of the

change of the states. Therefore we say the model ishidden. However we are still able to observe an emissionof the state changes, and the emission could be fuzzy.

For example, you are isolated in a closed room during theexperiment. In the room, you have no direct observation

of how weather changes. Everyday, an assistant deliversmeals for you once a day. The only way you have clue of the weather is to observe the how the guy’s dress

changes. 

Page 14: MarkovProcessesMeng

8/4/2019 MarkovProcessesMeng

http://slidepdf.com/reader/full/markovprocessesmeng 14/29

 Markov Model example(4)In the room, you might observe that yourassistant dresses with regular coat (CT), rain

coat(RN), or brings an umbrella (UM). Yourobservation sequence may be

SEQ  = {CT, CT , CT , UM, CT , CT , CT , CT , CT , CT 

 , CT , RN , CT , RN , UM , CT , CT, CT, RN, CT, CT,CT , CT, CT, CT , CT} 

Page 15: MarkovProcessesMeng

8/4/2019 MarkovProcessesMeng

http://slidepdf.com/reader/full/markovprocessesmeng 15/29

 Markov Model example(5)Regular Coat  Rain Coat  Umbrella 

Pretty  5/6  1/12  1/12 

Rainy  1/3  1/3  1/3 

Page 16: MarkovProcessesMeng

8/4/2019 MarkovProcessesMeng

http://slidepdf.com/reader/full/markovprocessesmeng 16/29

 Markov Model example(5)Regular Coat  Rain Coat  Umbrella 

Pretty  5/6  1/12  1/12 

Rainy  1/3  1/3  1/3 

Page 17: MarkovProcessesMeng

8/4/2019 MarkovProcessesMeng

http://slidepdf.com/reader/full/markovprocessesmeng 17/29

 Mathematical ElementsA set of states over time, denoted by STATES 

A set of emissions , or observations over time,

denoted by SEQ 

An M -by-M  transition matrix  TRANS whoseentry(i,j) is the probability of a transition from

state i to state j.An M -by-N  emission matrix  EMIS whose i,kentry gives the probability of emitting symbols k given that the model is in state i. EMIS 

Page 18: MarkovProcessesMeng

8/4/2019 MarkovProcessesMeng

http://slidepdf.com/reader/full/markovprocessesmeng 18/29

OutlinesMarkov models

 /process/chain/property/HMM

Matlab simulations

 Applications

 Advantages and Limitations

Conclusions.

Page 19: MarkovProcessesMeng

8/4/2019 MarkovProcessesMeng

http://slidepdf.com/reader/full/markovprocessesmeng 19/29

Why Matlab?Matlab is a tool for doing numericalcomputations with matrices andvectors. It can also display informationgraphically.

Combined with numerous mathematical

libraries, Matlab has become one of thefew tools that can catch up with myideas.

Page 20: MarkovProcessesMeng

8/4/2019 MarkovProcessesMeng

http://slidepdf.com/reader/full/markovprocessesmeng 20/29

Why Matlab?

MATLAB Compiler translates MATLAB code to ANSI standard C code. With the MATLABCompiler, we will be able to automaticallygenerate optimized C and C++ code. Bytranslating MATLAB code to C and C++, the

compiler can significantly speed up MATLABapplications and development.>> mcc -t -L C myfun1 % yields myfun1.c

mcc -t -L C myfun2 % yields myfun2.c

mcc -W main -L C myfun1 myfun2 libmmfile.mlib

% yields myfun1_main.c

Page 21: MarkovProcessesMeng

8/4/2019 MarkovProcessesMeng

http://slidepdf.com/reader/full/markovprocessesmeng 21/29

 Matlab simulationsMatlab Statistics Toolbox 4.1

(Released in May 2003)hmmdecode

hmmgenerate

hmmestimatehmmtrain

hmmviterbi

Page 22: MarkovProcessesMeng

8/4/2019 MarkovProcessesMeng

http://slidepdf.com/reader/full/markovprocessesmeng 22/29

 Matlab simulations

Matlab scripts demo.m in Matlab6.5 environment

Page 23: MarkovProcessesMeng

8/4/2019 MarkovProcessesMeng

http://slidepdf.com/reader/full/markovprocessesmeng 23/29

OutlinesMarkov models

 /process/chain/property/HMM

Matlab simulations

 Applications

 Advantages and Limitations

Conclusions.

Page 24: MarkovProcessesMeng

8/4/2019 MarkovProcessesMeng

http://slidepdf.com/reader/full/markovprocessesmeng 24/29

 Applications of Markov ModelsSpeech recognition, 

Modeling of coding/noncoding regions in

DNA, Protein binding sites in DNA, 

Protein folding, 

Protein superfamilies, 

Multiple sequence alignment, 

Flood predictions, 

Ion channel recordings, 

Optical character recognition. 

Page 25: MarkovProcessesMeng

8/4/2019 MarkovProcessesMeng

http://slidepdf.com/reader/full/markovprocessesmeng 25/29

OutlinesMarkov models

 /process/chain/property/HMM

Matlab simulations

 Applications

 Advantages and Limitations

Conclusions.

Page 26: MarkovProcessesMeng

8/4/2019 MarkovProcessesMeng

http://slidepdf.com/reader/full/markovprocessesmeng 26/29

 Advantages of Markov ModelsMMs and HMMs have proved effective in a number of domains.

The basic theory of HMMs is very elegant and easy tounderstand. This makes it easier to analyse and

implement, with the help of Matlab. Because MM uses only positive data, their scalabilityis very good. Dr. Dunham’s research group is

investigating an incremental extension algorithm of Markov chain, which fits for dynamic data processing.

It is complementary of other non-linear models suchas neural networks and time-series analysis.

Page 27: MarkovProcessesMeng

8/4/2019 MarkovProcessesMeng

http://slidepdf.com/reader/full/markovprocessesmeng 27/29

 Limitations of Markov ModelsIt is a data hog.

Markov property.

Page 28: MarkovProcessesMeng

8/4/2019 MarkovProcessesMeng

http://slidepdf.com/reader/full/markovprocessesmeng 28/29

Conclusions

http://www-2.cs.cmu.edu/~awm/tutorials/ 

Page 29: MarkovProcessesMeng

8/4/2019 MarkovProcessesMeng

http://slidepdf.com/reader/full/markovprocessesmeng 29/29

Any Questions?