SlideShare a Scribd company logo
1 of 12
Download to read offline
Introduction to
HMM
2018. 04
Hyoseop Lee / hslee@encoredtech.com
Definition of HMM
Def [HMM] A Hidden Markov Model (HMM) { X_t: t in mathbb{N} } is a particular kind of
dependent mixture with bold{X}^{(t)}, bold{C}^{(t)} representing the histories from time 1 to
time t, one can summarize the simplest model of this kind by:
text{Pr}(C_t|bold{C}^{(t-1)})=text{Pr}(C_t|C_{t-1}),
text{Pr}(X_t|bold{X}^{(t-1)},bold{C}^{t})=text{Pr}(X_t|C_t).
Remark
● Parameter process {C_t|t=1,2,cdots} satisfies Markov property, and
● State dependent process {X_t|t=1,2,cdots} depends only on the current state C_t
Examples
EM algorithm
EM algorithm
Given the statistical model which generates a set X of observed data, a set of unobserved latent
data or missing values Z, and a vector of unknown parameters , along with a likelihood
function, the maximum likelihood estimate (MLE) of the unknown
parameters is determined by the marginal likelihood of the observed data
However, this quantity is often intractable (e.g. if Z is a sequence of events, so that the number
of values grows exponentially with the sequence length, making the exact calculation of the sum
extremely difficult).
Remark) EM works to improve Q(boldsymboltheta|boldsymboltheta^{(t)}) rather than
directly improving log p(mathbf{X}|boldsymboltheta).
EM algorithm
EM algorithm
The EM algorithm seeks to find the MLE of the marginal likelihood by iteratively applying these
two steps:
● Expectation step (E step): Calculate the expected value of the log likelihood function, with
respect to the conditional distribution of Z given X under the current estimate of the
parameters :
●
● Maximization step (M step): Find the parameters that maximize this quantity:
Baum-Welch Algorithm
Complete-data log-likelihood :
begin{align*} logBig( text{Pr}(bold{x}^{(T)},bold{c}^{(T)} Big)&=
logBig(delta_{c_1}prod_{t=2}^Tgamma_{c_{t-1},c_t}prod_{t=1}^Tp_{c_t}(x_t)Big)
&= logdelta_{c_1}+sum_{t=2}^Tloggamma_{c_{t-1},c_t}+sum_{t=1}^Tp_{c_t}(x_t)
end{align*}
Hence,
mathbb{E}Big[logBig( text{Pr}(bold{x}^{(T)},bold{c}^{(T)} Big) Big]
= sum_{j=1}^m u_j(1)
logdelta_{j}+sum_{j=1}^msum_{k=1}^mbig(sum_{t=2}^Tv_{jk}(t)big)loggamma_{jk}+sum
_{j=1}^msum_{t=1}^T u_j(t)p_{j}(x_t)
Baum-Welch Algorithm
E Step
Conditional expectations given the observations bold{x}^{(T)} and the current parameter
estimates
● text{Pr}(C_t=j|bold{x}^{(T)})=frac{text{Pr}(C_t=j,bold{x}^{(T)})}{text{Pr}(bold{x}^{(T)}
)}=alpha_t(j)beta_t(j)/L_T
● text{Pr}(C_{t-1}=j,
C_t=k|bold{x}^{(T)})=frac{text{Pr}(C_{t-1}=j,C_t=k,bold{x}^{(T)})}{text{Pr}(bold{x}^{(T
)})}=alpha_{t-1}(j)gamma_{jk}p_k(x_t)beta_t(j)/L_T
Baum-Welch Algorithm
Forward and Backward Probabilities
where boldsymbol{alpha}_t, boldsymbol{beta}_t are defined as follows
● boldsymbol{alpha}_t=boldsymbol{delta}bold{P}(x_1)boldsymbolGammabold{P}(x_
2)cdotsboldsymbol{Gamma}bold{P}(x_t)=boldsymbol{delta}bold{P}(x_1)prod_{s=2}
^tboldsymbol{Gamma}bold{P}(x_s)
● boldsymbol{beta}_t^prime=boldsymbol{Gamma}bold{P}(x_{t+1})boldsymbol{Gam
ma}bold{P}(x_{t+2})cdotsboldsymbol{Gamma}bold{P}_{x_T}bold{1}^prime=Big(
prod_{s=t+1}^Tboldsymbol{Gamma}bold{P}(x_s)Big) bold{1}^prime
We referred to the elements of boldsymbol{alpha}_t, boldsymbol{beta}_t as forward
probabilities and backward probabilities, respectively.
Baum-Welch Algorithm
Prop[Forward probability] For t=1, 2, …, T, and j=1, 2, …, m,
alpha_t(j)=text{Pr}(X_1=x_1,X_2=x_2,cdots,X_t=x_t,C_t=j).
Prop[Backward probability] For t=1, 2, ... , T-1, and i=1,2, …, m,
beta_t(i)=text{Pr}(X_{t+1}=x_{t+1},X_{t+2}=x_{t+2},cdots,X_T=x_T|C_i=i)
provided that text{Pr}(C_t=i)>0.
Baum-Welch Algorithm
M Step
Maximize the CDLL with respect to the three sets of parameters:
● delta_j=u_j(1)/sum_{j=1}^mu_j(1)
● gamma_{jk}=f_{jk}/sum_{k=1}^m f_{jk} text{ where } f_{jk}=sum_{t=2}^Tv_{jk}(t)
● sum_{j=1}^msum_{t=1}^Tu_j(t)log(p_j(x_t)) depends on the j-th state dependent
distribution
Baum-Welch Algorithm
M Step
For a Poisson-HMM, p_j(x)=e^{-lambda_j^x/x!},
0=sum_tu_j(t)(-1+x_t/lambda_j), that is, lambda_j=sum_{t=1}^Tu_j(t)x_t/sum_{t=1}^Tu_j(t)
For a Normal-HMM, p_j(x)=(2pisigma^2_j)^{-1/2}exp big( -frac1{2sigma^2_j} (x-mu_j)^2
big)
mu_j=sum_{t=1}^Tu_j(t)x_t/sum_{t=1}^Tu_j(t)
sigma_j^2=sum_{t=1}^Tu_j(t)(x_t-mu_j)^2/sum_{t=1}^Tu_j(t)
References
● Wikipedia contributors. Expectation–maximization algorithm. Wikipedia, The Free Encyclopedia. April 5,
2018, 09:20 UTC. Available at:
https://en.wikipedia.org/w/index.php?title=Expectation%E2%80%93maximization_algorithm&oldid=834
359959. Accessed April 9, 2018.
● Wikipedia contributors. Baum–Welch algorithm. Wikipedia, The Free Encyclopedia. February 21, 2018,
06:13 UTC. Available at:
https://en.wikipedia.org/w/index.php?title=Baum%E2%80%93Welch_algorithm&oldid=826827292.
Accessed April 9, 2018.
● Walter Zucchini, Iain L. MacDonald, and Roland Langrock, Hidden Markov Models for Time Series: An
Introduction Using R, Second Edition, Chapman and Hall/CRC, June 7, 2016.

More Related Content

What's hot

Fibonacci_Hubble
Fibonacci_HubbleFibonacci_Hubble
Fibonacci_Hubble
Marc King
 
February 10 2016
February 10 2016February 10 2016
February 10 2016
khyps13
 
A25.8 modelingquads
A25.8 modelingquadsA25.8 modelingquads
A25.8 modelingquads
vhiggins1
 

What's hot (20)

L 4 4
L 4 4L 4 4
L 4 4
 
Linear algebra in the dirac notation
Linear algebra in the dirac notationLinear algebra in the dirac notation
Linear algebra in the dirac notation
 
Romberg's Integration
Romberg's IntegrationRomberg's Integration
Romberg's Integration
 
weddle's rule
weddle's ruleweddle's rule
weddle's rule
 
Romberg’s method
Romberg’s methodRomberg’s method
Romberg’s method
 
Hprec7.1
Hprec7.1Hprec7.1
Hprec7.1
 
FDM Numerical solution of Laplace Equation using MATLAB
FDM Numerical solution of Laplace Equation using MATLABFDM Numerical solution of Laplace Equation using MATLAB
FDM Numerical solution of Laplace Equation using MATLAB
 
Es272 ch6
Es272 ch6Es272 ch6
Es272 ch6
 
Parallel and perpendicular_lines 1.1
Parallel and perpendicular_lines 1.1Parallel and perpendicular_lines 1.1
Parallel and perpendicular_lines 1.1
 
Shelf life calculation of drugs
Shelf life calculation of drugsShelf life calculation of drugs
Shelf life calculation of drugs
 
implementation of travelling salesman problem with complexity ppt
implementation of travelling salesman problem with complexity pptimplementation of travelling salesman problem with complexity ppt
implementation of travelling salesman problem with complexity ppt
 
Fibonacci_Hubble
Fibonacci_HubbleFibonacci_Hubble
Fibonacci_Hubble
 
Applications Section 1.3
Applications   Section 1.3Applications   Section 1.3
Applications Section 1.3
 
February 10 2016
February 10 2016February 10 2016
February 10 2016
 
Mathematical modeling
Mathematical modelingMathematical modeling
Mathematical modeling
 
A25.8 modelingquads
A25.8 modelingquadsA25.8 modelingquads
A25.8 modelingquads
 
978 1-4612-4974-0 26
978 1-4612-4974-0 26978 1-4612-4974-0 26
978 1-4612-4974-0 26
 
I. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMI. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHM
 
Tsp branch and bound
Tsp branch and boundTsp branch and bound
Tsp branch and bound
 
20320130406032
2032013040603220320130406032
20320130406032
 

Similar to Introduction to HMM

On problem-of-parameters-identification-of-dynamic-object
On problem-of-parameters-identification-of-dynamic-objectOn problem-of-parameters-identification-of-dynamic-object
On problem-of-parameters-identification-of-dynamic-object
Cemal Ardil
 
2014 on exact solutions for the minmax regret aspanning tree problem
2014   on exact solutions for the minmax regret aspanning tree problem2014   on exact solutions for the minmax regret aspanning tree problem
2014 on exact solutions for the minmax regret aspanning tree problem
Francisco Pérez
 
New data structures and algorithms for \\post-processing large data sets and ...
New data structures and algorithms for \\post-processing large data sets and ...New data structures and algorithms for \\post-processing large data sets and ...
New data structures and algorithms for \\post-processing large data sets and ...
Alexander Litvinenko
 
Regression & Classification
Regression & ClassificationRegression & Classification
Regression & Classification
주영 송
 

Similar to Introduction to HMM (20)

Presentation.pdf
Presentation.pdfPresentation.pdf
Presentation.pdf
 
Tensor train to solve stochastic PDEs
Tensor train to solve stochastic PDEsTensor train to solve stochastic PDEs
Tensor train to solve stochastic PDEs
 
On problem-of-parameters-identification-of-dynamic-object
On problem-of-parameters-identification-of-dynamic-objectOn problem-of-parameters-identification-of-dynamic-object
On problem-of-parameters-identification-of-dynamic-object
 
Numerical Methods
Numerical MethodsNumerical Methods
Numerical Methods
 
Ijmet 10 01_046
Ijmet 10 01_046Ijmet 10 01_046
Ijmet 10 01_046
 
Building Machine Learning Algorithms on Apache Spark: Scaling Out and Up with...
Building Machine Learning Algorithms on Apache Spark: Scaling Out and Up with...Building Machine Learning Algorithms on Apache Spark: Scaling Out and Up with...
Building Machine Learning Algorithms on Apache Spark: Scaling Out and Up with...
 
Efficient Computation of Regret-ratio Minimizing Set: A Compact Maxima Repres...
Efficient Computation ofRegret-ratio Minimizing Set:A Compact Maxima Repres...Efficient Computation ofRegret-ratio Minimizing Set:A Compact Maxima Repres...
Efficient Computation of Regret-ratio Minimizing Set: A Compact Maxima Repres...
 
A One-Pass Triclustering Approach: Is There any Room for Big Data?
A One-Pass Triclustering Approach: Is There any Room for Big Data?A One-Pass Triclustering Approach: Is There any Room for Big Data?
A One-Pass Triclustering Approach: Is There any Room for Big Data?
 
2014 on exact solutions for the minmax regret aspanning tree problem
2014   on exact solutions for the minmax regret aspanning tree problem2014   on exact solutions for the minmax regret aspanning tree problem
2014 on exact solutions for the minmax regret aspanning tree problem
 
Cmb part3
Cmb part3Cmb part3
Cmb part3
 
ETSATPWAATFU
ETSATPWAATFUETSATPWAATFU
ETSATPWAATFU
 
Hull White model presentation
Hull White model presentationHull White model presentation
Hull White model presentation
 
1.5 Quadratic Equations.pdf
1.5 Quadratic Equations.pdf1.5 Quadratic Equations.pdf
1.5 Quadratic Equations.pdf
 
New data structures and algorithms for \\post-processing large data sets and ...
New data structures and algorithms for \\post-processing large data sets and ...New data structures and algorithms for \\post-processing large data sets and ...
New data structures and algorithms for \\post-processing large data sets and ...
 
Modeling and quantification of uncertainties in numerical aerodynamics
Modeling and quantification of uncertainties in numerical aerodynamicsModeling and quantification of uncertainties in numerical aerodynamics
Modeling and quantification of uncertainties in numerical aerodynamics
 
Regression & Classification
Regression & ClassificationRegression & Classification
Regression & Classification
 
Approximation in Stochastic Integer Programming
Approximation in Stochastic Integer ProgrammingApproximation in Stochastic Integer Programming
Approximation in Stochastic Integer Programming
 
Calculus Homework Help
Calculus Homework HelpCalculus Homework Help
Calculus Homework Help
 
Gracheva Inessa - Fast Global Image Denoising Algorithm on the Basis of Nonst...
Gracheva Inessa - Fast Global Image Denoising Algorithm on the Basis of Nonst...Gracheva Inessa - Fast Global Image Denoising Algorithm on the Basis of Nonst...
Gracheva Inessa - Fast Global Image Denoising Algorithm on the Basis of Nonst...
 
MUMS: Transition & SPUQ Workshop - Practical Bayesian Optimization for Urban ...
MUMS: Transition & SPUQ Workshop - Practical Bayesian Optimization for Urban ...MUMS: Transition & SPUQ Workshop - Practical Bayesian Optimization for Urban ...
MUMS: Transition & SPUQ Workshop - Practical Bayesian Optimization for Urban ...
 

Recently uploaded

如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
acoha1
 
如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样
如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样
如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样
wsppdmt
 
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
yulianti213969
 
Simplify hybrid data integration at an enterprise scale. Integrate all your d...
Simplify hybrid data integration at an enterprise scale. Integrate all your d...Simplify hybrid data integration at an enterprise scale. Integrate all your d...
Simplify hybrid data integration at an enterprise scale. Integrate all your d...
varanasisatyanvesh
 
Abortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotec
Abortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotecAbortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotec
Abortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Bertram Ludäscher
 
bams-3rd-case-presentation-scabies-12-05-2020.pptx
bams-3rd-case-presentation-scabies-12-05-2020.pptxbams-3rd-case-presentation-scabies-12-05-2020.pptx
bams-3rd-case-presentation-scabies-12-05-2020.pptx
JocylDuran
 
如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证
acoha1
 
Abortion pills in Doha {{ QATAR }} +966572737505) Get Cytotec
Abortion pills in Doha {{ QATAR }} +966572737505) Get CytotecAbortion pills in Doha {{ QATAR }} +966572737505) Get Cytotec
Abortion pills in Doha {{ QATAR }} +966572737505) Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 

Recently uploaded (20)

Unsatisfied Bhabhi ℂall Girls Vadodara Book Esha 7427069034 Top Class ℂall Gi...
Unsatisfied Bhabhi ℂall Girls Vadodara Book Esha 7427069034 Top Class ℂall Gi...Unsatisfied Bhabhi ℂall Girls Vadodara Book Esha 7427069034 Top Class ℂall Gi...
Unsatisfied Bhabhi ℂall Girls Vadodara Book Esha 7427069034 Top Class ℂall Gi...
 
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
 
Credit Card Fraud Detection: Safeguarding Transactions in the Digital Age
Credit Card Fraud Detection: Safeguarding Transactions in the Digital AgeCredit Card Fraud Detection: Safeguarding Transactions in the Digital Age
Credit Card Fraud Detection: Safeguarding Transactions in the Digital Age
 
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...
 
jll-asia-pacific-capital-tracker-1q24.pdf
jll-asia-pacific-capital-tracker-1q24.pdfjll-asia-pacific-capital-tracker-1q24.pdf
jll-asia-pacific-capital-tracker-1q24.pdf
 
如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样
如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样
如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样
 
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
 
Simplify hybrid data integration at an enterprise scale. Integrate all your d...
Simplify hybrid data integration at an enterprise scale. Integrate all your d...Simplify hybrid data integration at an enterprise scale. Integrate all your d...
Simplify hybrid data integration at an enterprise scale. Integrate all your d...
 
Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...
Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...
Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...
 
DBMS UNIT 5 46 CONTAINS NOTES FOR THE STUDENTS
DBMS UNIT 5 46 CONTAINS NOTES FOR THE STUDENTSDBMS UNIT 5 46 CONTAINS NOTES FOR THE STUDENTS
DBMS UNIT 5 46 CONTAINS NOTES FOR THE STUDENTS
 
Abortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotec
Abortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotecAbortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotec
Abortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotec
 
Case Study 4 Where the cry of rebellion happen?
Case Study 4 Where the cry of rebellion happen?Case Study 4 Where the cry of rebellion happen?
Case Study 4 Where the cry of rebellion happen?
 
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
 
Northern New England Tableau User Group (TUG) May 2024
Northern New England Tableau User Group (TUG) May 2024Northern New England Tableau User Group (TUG) May 2024
Northern New England Tableau User Group (TUG) May 2024
 
bams-3rd-case-presentation-scabies-12-05-2020.pptx
bams-3rd-case-presentation-scabies-12-05-2020.pptxbams-3rd-case-presentation-scabies-12-05-2020.pptx
bams-3rd-case-presentation-scabies-12-05-2020.pptx
 
Bios of leading Astrologers & Researchers
Bios of leading Astrologers & ResearchersBios of leading Astrologers & Researchers
Bios of leading Astrologers & Researchers
 
如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证
 
Abortion pills in Doha {{ QATAR }} +966572737505) Get Cytotec
Abortion pills in Doha {{ QATAR }} +966572737505) Get CytotecAbortion pills in Doha {{ QATAR }} +966572737505) Get Cytotec
Abortion pills in Doha {{ QATAR }} +966572737505) Get Cytotec
 
Seven tools of quality control.slideshare
Seven tools of quality control.slideshareSeven tools of quality control.slideshare
Seven tools of quality control.slideshare
 
Predictive Precipitation: Advanced Rain Forecasting Techniques
Predictive Precipitation: Advanced Rain Forecasting TechniquesPredictive Precipitation: Advanced Rain Forecasting Techniques
Predictive Precipitation: Advanced Rain Forecasting Techniques
 

Introduction to HMM

  • 1. Introduction to HMM 2018. 04 Hyoseop Lee / hslee@encoredtech.com
  • 2. Definition of HMM Def [HMM] A Hidden Markov Model (HMM) { X_t: t in mathbb{N} } is a particular kind of dependent mixture with bold{X}^{(t)}, bold{C}^{(t)} representing the histories from time 1 to time t, one can summarize the simplest model of this kind by: text{Pr}(C_t|bold{C}^{(t-1)})=text{Pr}(C_t|C_{t-1}), text{Pr}(X_t|bold{X}^{(t-1)},bold{C}^{t})=text{Pr}(X_t|C_t). Remark ● Parameter process {C_t|t=1,2,cdots} satisfies Markov property, and ● State dependent process {X_t|t=1,2,cdots} depends only on the current state C_t
  • 4. EM algorithm EM algorithm Given the statistical model which generates a set X of observed data, a set of unobserved latent data or missing values Z, and a vector of unknown parameters , along with a likelihood function, the maximum likelihood estimate (MLE) of the unknown parameters is determined by the marginal likelihood of the observed data However, this quantity is often intractable (e.g. if Z is a sequence of events, so that the number of values grows exponentially with the sequence length, making the exact calculation of the sum extremely difficult). Remark) EM works to improve Q(boldsymboltheta|boldsymboltheta^{(t)}) rather than directly improving log p(mathbf{X}|boldsymboltheta).
  • 5. EM algorithm EM algorithm The EM algorithm seeks to find the MLE of the marginal likelihood by iteratively applying these two steps: ● Expectation step (E step): Calculate the expected value of the log likelihood function, with respect to the conditional distribution of Z given X under the current estimate of the parameters : ● ● Maximization step (M step): Find the parameters that maximize this quantity:
  • 6. Baum-Welch Algorithm Complete-data log-likelihood : begin{align*} logBig( text{Pr}(bold{x}^{(T)},bold{c}^{(T)} Big)&= logBig(delta_{c_1}prod_{t=2}^Tgamma_{c_{t-1},c_t}prod_{t=1}^Tp_{c_t}(x_t)Big) &= logdelta_{c_1}+sum_{t=2}^Tloggamma_{c_{t-1},c_t}+sum_{t=1}^Tp_{c_t}(x_t) end{align*} Hence, mathbb{E}Big[logBig( text{Pr}(bold{x}^{(T)},bold{c}^{(T)} Big) Big] = sum_{j=1}^m u_j(1) logdelta_{j}+sum_{j=1}^msum_{k=1}^mbig(sum_{t=2}^Tv_{jk}(t)big)loggamma_{jk}+sum _{j=1}^msum_{t=1}^T u_j(t)p_{j}(x_t)
  • 7. Baum-Welch Algorithm E Step Conditional expectations given the observations bold{x}^{(T)} and the current parameter estimates ● text{Pr}(C_t=j|bold{x}^{(T)})=frac{text{Pr}(C_t=j,bold{x}^{(T)})}{text{Pr}(bold{x}^{(T)} )}=alpha_t(j)beta_t(j)/L_T ● text{Pr}(C_{t-1}=j, C_t=k|bold{x}^{(T)})=frac{text{Pr}(C_{t-1}=j,C_t=k,bold{x}^{(T)})}{text{Pr}(bold{x}^{(T )})}=alpha_{t-1}(j)gamma_{jk}p_k(x_t)beta_t(j)/L_T
  • 8. Baum-Welch Algorithm Forward and Backward Probabilities where boldsymbol{alpha}_t, boldsymbol{beta}_t are defined as follows ● boldsymbol{alpha}_t=boldsymbol{delta}bold{P}(x_1)boldsymbolGammabold{P}(x_ 2)cdotsboldsymbol{Gamma}bold{P}(x_t)=boldsymbol{delta}bold{P}(x_1)prod_{s=2} ^tboldsymbol{Gamma}bold{P}(x_s) ● boldsymbol{beta}_t^prime=boldsymbol{Gamma}bold{P}(x_{t+1})boldsymbol{Gam ma}bold{P}(x_{t+2})cdotsboldsymbol{Gamma}bold{P}_{x_T}bold{1}^prime=Big( prod_{s=t+1}^Tboldsymbol{Gamma}bold{P}(x_s)Big) bold{1}^prime We referred to the elements of boldsymbol{alpha}_t, boldsymbol{beta}_t as forward probabilities and backward probabilities, respectively.
  • 9. Baum-Welch Algorithm Prop[Forward probability] For t=1, 2, …, T, and j=1, 2, …, m, alpha_t(j)=text{Pr}(X_1=x_1,X_2=x_2,cdots,X_t=x_t,C_t=j). Prop[Backward probability] For t=1, 2, ... , T-1, and i=1,2, …, m, beta_t(i)=text{Pr}(X_{t+1}=x_{t+1},X_{t+2}=x_{t+2},cdots,X_T=x_T|C_i=i) provided that text{Pr}(C_t=i)>0.
  • 10. Baum-Welch Algorithm M Step Maximize the CDLL with respect to the three sets of parameters: ● delta_j=u_j(1)/sum_{j=1}^mu_j(1) ● gamma_{jk}=f_{jk}/sum_{k=1}^m f_{jk} text{ where } f_{jk}=sum_{t=2}^Tv_{jk}(t) ● sum_{j=1}^msum_{t=1}^Tu_j(t)log(p_j(x_t)) depends on the j-th state dependent distribution
  • 11. Baum-Welch Algorithm M Step For a Poisson-HMM, p_j(x)=e^{-lambda_j^x/x!}, 0=sum_tu_j(t)(-1+x_t/lambda_j), that is, lambda_j=sum_{t=1}^Tu_j(t)x_t/sum_{t=1}^Tu_j(t) For a Normal-HMM, p_j(x)=(2pisigma^2_j)^{-1/2}exp big( -frac1{2sigma^2_j} (x-mu_j)^2 big) mu_j=sum_{t=1}^Tu_j(t)x_t/sum_{t=1}^Tu_j(t) sigma_j^2=sum_{t=1}^Tu_j(t)(x_t-mu_j)^2/sum_{t=1}^Tu_j(t)
  • 12. References ● Wikipedia contributors. Expectation–maximization algorithm. Wikipedia, The Free Encyclopedia. April 5, 2018, 09:20 UTC. Available at: https://en.wikipedia.org/w/index.php?title=Expectation%E2%80%93maximization_algorithm&oldid=834 359959. Accessed April 9, 2018. ● Wikipedia contributors. Baum–Welch algorithm. Wikipedia, The Free Encyclopedia. February 21, 2018, 06:13 UTC. Available at: https://en.wikipedia.org/w/index.php?title=Baum%E2%80%93Welch_algorithm&oldid=826827292. Accessed April 9, 2018. ● Walter Zucchini, Iain L. MacDonald, and Roland Langrock, Hidden Markov Models for Time Series: An Introduction Using R, Second Edition, Chapman and Hall/CRC, June 7, 2016.