Hi there Cesar and everyone who sees this,I'm trying to use HMM with some sort of multivariate discrete distribution (i.e. JointDistribution) for gesture recognition.I would like to use a feature vector of 4 different features and each feature has diferent values.Example: feature1 could have values like {0, 1, 2}
feature2 could have values like {0, 1, 2, 3}
feature3 could have values like {0, 1}
feature4 could have values like {100.23}
(please correct me if I could use something different)That's why I thought of using the JointDistribution because I can have something like this (from framework) // Lets create a joint distribution for two discrete variables:
// the first of which can assume 3 distinct symbol values: 0, 1, 2
// the second which can assume 5 distinct symbol values: 0, 1, 2, 3, 4
int[] symbols = { 3, 5 }; // specify the symbol counts
// Create the joint distribution for the above variables
JointDistribution joint = new JointDistribution(symbols);
// Now, suppose we would like to fit the distribution (estimate
// its parameters) from the following multivariate observations:
//
double[][] observations =
{
new double[] { 0, 0 },
new double[] { 1, 1 },
new double[] { 2, 1 },
new double[] { 0, 0 },
};
// Estimate parameters
joint.Fit(observations);
So I did some test code with a feature vector of 2 features with different number of symbolsdouble[][] observations =
{
new double[] { 0, 0 },
new double[] { 1, 0 },
new double[] { 1, 1 },
new double[] { 0, 1 },
};
ITopology topology = new Forward(states: 3, deepness: 2, random: false);
// random variable 1 = {0, 1, 2} --> zero, negative, positive
// random variable 2 = {0, 1} --> opened, closed
int[] symbols = { 3, 2 };
JointDistribution emissions = new JointDistribution(symbols);
// estimate the parameters (prob) based on observations
emissions.Fit(observations);
m_HMM = new HiddenMarkovModel<JointDistribution>(topology, emissions);
// Create a Baum-Welch learning algorithm to teach it
BaumWelchLearning<JointDistribution> teacher = new BaumWelchLearning<JointDistribution>(m_HMM);
// and call its Run method to start teaching
double error = teacher.Run(observations);
But I get this error: "This model expects univariate observations Parametername: observations"Question 1: Why is that? I thought I had specified it pretty well with the JointDistribution.Question 2: At first I thought of using MultinomialDistribution but knwo how to set the probabilities --> they are unknown (or at least for any "hidden" MM, I think) Or could I just use a dummy initial prob and then use the Fit method to have a better estimate? (sort of unrelated) Question 3: I have real data. Is it a good or bad idea at all to discretize it? Also, that real data is 3D. Should I translate the 3D data to 2D? If anyone has a suggestion of another (better) approach regarding the distributions, please let me know.Also, if any of what I said makes no sense to you, please let me know :-)Best Regards, Julio