Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Applying hidden Markov model to multiple simultaneous bit sequences

This excellent article on implementing a Hidden Markov Model in C# does a fair job of classifying a single bit sequence based on training data.

How to modify the algorithm, or build it out (multiple HMMs?) to support the classification of multiple simultaneous bit sequences?

Example

Instead of classifying just one stream:

double t1 = hmm.Evaluate(new int[] { 0,1 });      // 0.49999423004045024  
double t2 = hmm.Evaluate(new int[] { 0,1,1,1 });  // 0.11458685045803882

Rather classify a dual bit stream:

double t1 = hmm.Evaluate(new int[] { [0, 0], [0, 1] });
double t2 = hmm.Evaluate(new int[] { [0, 0], [1, 1], [0, 1], [1, 1] });

Or even better, three streams:

double t1 = hmm.Evaluate(new int[] { [0, 0, 1], [0, 0, 1] });
double t2 = hmm.Evaluate(new int[] { [0, 0, 1], [1, 1, 0], [0, 1, 1], [1, 1, 1] });

Obviously the training data would also be expanded.

like image 403
Petrus Theron Avatar asked Jan 27 '26 20:01

Petrus Theron


1 Answers

The trick is to model the set of observations as the n-ary cartesian product of all possible values of each sequence, in your case the HMM will have 2^n output symbol where n is the number of bit sequences.

Example: for three bit sequences, the 8 symbols are: 000 001 010 011 100 101 110 111, as if we created a megavariable whose values are all the possible tuples of values of the individual observation sequences (0/1 of each bit sequence)

like image 151
Amro Avatar answered Jan 30 '26 08:01

Amro



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!