欢迎来到天天文库
浏览记录
ID:55632089
大小:312.50 KB
页数:11页
时间:2020-05-21
《Python的隐马尔科夫HMMLearn库的应用教学.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、PythonHMMLearnTutorialEditedBy毛片物语hmmlearn implementstheHiddenMarkovModels(HMMs).TheHMMisagenerativeprobabilisticmodel,inwhichasequenceofobservable (mathbf{X}) variablesisgeneratedbyasequenceofinternalhiddenstates (mathbf{Z}).Thehiddenstatesarenotbeobserveddirectly.Thetrans
2、itionsbetweenhiddenstatesareassumedtohavetheformofa(first-order)Markovchain.Theycanbespecifiedbythestartprobabilityvector (boldsymbol{pi}) andatransitionprobabilitymatrix (mathbf{A}).Theemissionprobabilityofanobservablecanbeanydistributionwithparameters (boldsymbol{thet
3、a}) conditionedonthecurrenthiddenstate.TheHMMiscompletelydeterminedby (boldsymbol{pi}), (mathbf{A}) and (boldsymbol{theta}).TherearethreefundamentalproblemsforHMMs:·Giventhemodelparametersandobserveddata,estimatetheoptimalsequenceofhiddenstates.·Giventhemodelparameter
4、sandobserveddata,calculatethelikelihoodofthedata.·Givenjusttheobserveddata,estimatethemodelparameters.ThefirstandthesecondproblemcanbesolvedbythedynamicprogrammingalgorithmsknownastheViterbialgorithmandtheForward-Backwardalgorithm,respectively.ThelastonecanbesolvedbyaniterativeEx
5、pectation-Maximization(EM)algorithm,knownastheBaum-Welchalgorithm.References:[Rabiner89]LawrenceR.Rabiner“AtutorialonhiddenMarkovmodelsandselectedapplicationsinspeechrecognition”,ProceedingsoftheIEEE77.2,pp.257-286,1989.[Bilmes98]JeffA.Bilmes,“AgentletutorialoftheEMalgorithmandit
6、sapplicationtoparameterestimationforGaussianmixtureandhiddenMarkovmodels.”,1998.Availablemodelshmm.GaussianHMMHiddenMarkovModelwithGaussianemissions.hmm.GMMHMMHiddenMarkovModelwithGaussianmixtureemissions.hmm.MultinomialHMMHiddenMarkovModelwithmultinomial(discrete)emissionsReadon
7、 fordetailsonhowtoimplementanHMMwithacustomemissionprobability.BuildingHMMandgeneratingsamplesYoucanbuildanHMMinstancebypassingtheparametersdescribedabovetotheconstructor.Then,youcangeneratesamplesfromtheHMMbycalling sample.>>>importnumpyasnp>>>fromhmmlearnimporthmm>>>np.random.s
8、eed(42)>>>model=hmm.GaussianHMM(n_compon
此文档下载收益归作者所有