in reply to Re: Viterbi application
in thread Viterbi application

oops, sorry. I incorrectly copied the third line of that loop. In my program, the data structure is more complicated and depends on a large file. I tried to simplify the code so that the details were easier to understand.

At this point, you are right, I should probably make a new post. I am considering asking one of my computer science colleagues to help, however in the past they have been reluctant.

Replies are listed 'Best First'.
Re^3: Viterbi application
by Laurent_R (Canon) on Apr 08, 2014 at 21:13 UTC
    No problem, this can happen, but please make sure, before opening a new thread, that at least the part of your code that produces the input data is really correct. This way, we can try to work on your Viterbi algorithm itself with good data. For the time being, the Dumper output shows for example some inner arrays with only 0 values, I am not completely sure that's really what you want to start with. Don't hesitate to use the Dumper function of the Data::Dumper module (the way I did it) to better visualize your data and be sure that it is what you wish us to work on. Also note that the two zero-cost code segments were bugged and could not compile; I fixed them so that they would at least compile and do something, but I am not completely sure that what they do now is really what you wanted them to do. Well, in brief, please provide really good input data, then, once we have that, I am sure that some gentle monks among us will be willing to go through the Viterbi algorithm with you. (If you have trouble producing really good input data, I would suggest that you ask for help here, and create a new thread only once this part of the work is completely solved.)