# 找出给定隐马尔可夫模型（HMM）过程输出的隐藏状态

 In[1]:= Xp0 = 1; tm = {{5/6, 1/6, 0}, {0, 4/5, 1/5}, {0, 0, 1}}; hmm = HiddenMarkovProcess[p0, tm, {NormalDistribution[-1, 2/3], NormalDistribution[2, 1], NormalDistribution[5, 1/2]}];
 In[2]:= XPlot[PDF[hmm[5], x] // Evaluate, {x, -4, 8}]
 Out[2]=
 In[3]:= Xobs = {-1.797, -0.859, 0.328, 3.853, 4.707, 4.872};

 In[4]:= Xvd = FindHiddenMarkovStates[obs, hmm]
 Out[4]=

 In[5]:= Xpd = FindHiddenMarkovStates[obs, hmm, "PosteriorDecoding"]
 Out[5]=

 In[6]:= Xp0 = {3/5, 2/5}; tm = {{2/3, 1/3}, {1/4, 3/4}}; hmm = HiddenMarkovProcess[p0, tm, {MultivariateTDistribution[{{1, 1/2}, {1/2, 1}}, 8], MultivariateTDistribution[{{1, -2/3}, {-2/3, 1}}, 3]}];
 In[7]:= XPlot3D[PDF[hmm[2], {x, y}], {x, -4, 4}, {y, -4, 4}]
 Out[7]=
 In[8]:= Xobs = {{-0.15, 0.63}, {0.03, -0.71}, {-0.93, -0.14}, {-1.36, 2.32}, {0.68, 0.88}};

 In[9]:= XFindHiddenMarkovStates[obs, hmm]
 Out[9]=

 In[10]:= XFindHiddenMarkovStates[obs, hmm, "PosteriorDecoding"]
 Out[10]=

## Mathematica

Questions? Comments? Contact a Wolfram expert »