I am using the following code to get states and transitions out of some traces:

class = HiddenMarkovProcess[2, "Gaussian"];
hmm = EstimatedProcess[traces, class];

However for some traces (1,4, and 8), the function EstimateProcess doesn't find the right states:

enter image description here

How can I set initial values to the EstimateProcess function?

According to the documentation, it should work like EstimatedProcess[data,proc,{{p,p0},{q,q0},…}], but I don't know what to enter for p,q, etc.

Edited: The full code is

(*Import traces (just a list of numbers)*)
files = {"trace1.txt","trace2.txt","trace3.txt","trace4.txt","trace5.txt","trace6.txt","trace7.txt","trace8.txt"}    
SetDirectory[NotebookDirectory[]];
traces = Import[#, "List"]& /@ files;

(*Find Hidden-Markov-Model*)    
class = HiddenMarkovProcess[2, "Gaussian"];
hmm = EstimatedProcess[#, class] & /@traces

(*extract states and plot data*)
state = FindHiddenMarkovStates[traces[[#]], hmm[[#]]] & /@Range[1, Length[files]];
stateEffs = {hmm[[#, 3, 1, 1]], hmm[[#, 3, 2, 1]]} & /@Range[1, Length[files]]
Efficencies[stateEffs_, stateNbr_] := stateEffs[[#]] & /@stateNbr
effs = Efficencies[stateEffs[[#]], state[[#]]] & /@Range[1, Length[files]];
Show[ListLinePlot[traces[[#]]],ListLinePlot[effs[[#]], PlotStyle -> Directive[Orange]]] & /@Range[1, Length[files]]
New contributor
C.Gebha is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • 1
    Could you give the full code for producing those images? – C. E. Dec 8 at 19:40
  • 1
    I have added the full code. But I don't know how to provide the files which are just a list of numbers. – C.Gebha Dec 9 at 21:22

Your Answer

C.Gebha is a new contributor. Be nice, and check out our Code of Conduct.

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.