# Best Way For Estimating Parameters Of Hidden Markov Process

Parameter estimation is not stable.
First, make a model.

proc[n_] := HiddenMarkovProcess[(#1/Total[#1] & )[
RandomReal[{1, 10}, {n}]], (#1/Total[#1] & ) /@
RandomReal[{1, 10}, {n, n}], Table[NormalDistribution[RandomReal[],
RandomReal[{0.01, 1}]], n]];

proc2[n_] := HiddenMarkovProcess[Table[a[i], {i, 1, n}],
Table[b[i, j], {i, 1, n}, {j, 1, n}],
Table[NormalDistribution[c[i], d[i]], {i, 1, n}]];

pr = proc[3]

HiddenMarkovProcess[{0.148376, 0.42108, 0.430544}, {{0.458023, 0.104694, 0.437283}, {0.160391, 0.462158, 0.377451}, {0.375321, 0.269047, 0.355633}}, {NormalDistribution[ 0.4253, 0.118768], NormalDistribution[0.278537, 0.832337], NormalDistribution[0.658421, 0.730663]}]

RandomFunction[pr, {0, 100}, 3] // Histogram

Estimating the transition probability and the emission distribution,
then check the absolute error of trans-Probability between true value and estimated one.
here,proc2 is model which is estimated,and proc[3] is initial setting.

est = EstimatedProcess[RandomFunction[pr, {0, 100}, 100], proc2[3],
proc[3]]

ListLinePlot[Flatten[Abs[(pr[[2]] - est[[2]])]]]

This error is an unacceptable level.

• @kglr Thank you very much. I corrected the question. – user66556 Jul 14 at 9:47