AIMA.Probability.Reasoning.HiddenMarkovModel.predict C# (CSharp) Method

predict() public method

public predict ( RandomVariable aBelief, String action ) : RandomVariable
aBelief RandomVariable
action String
return RandomVariable
        public RandomVariable predict(RandomVariable aBelief, String action)
        {
            RandomVariable newBelief = aBelief.duplicate();

            Matrix beliefMatrix = aBelief.asMatrix();
            Matrix transitionMatrix = _transitionModel.asMatrix(action);
            Matrix predicted = transitionMatrix.transpose().times(beliefMatrix);
            newBelief.updateFrom(predicted);
            return newBelief;
        }

Usage Example

Example #1
0
 public void act(String action)
 {
     _belief = hmm.predict(_belief, action);
 }