ostore.oil
Class HMM.Prediction

java.lang.Object
  |
  +--ostore.oil.HMM.Prediction
All Implemented Interfaces:
Model.Prediction, QueueElementIF, QuickSerializable
Enclosing class:
HMM

public static class HMM.Prediction
extends Object
implements Model.Prediction

A Prediction object contains an array of states and a matching array of weights. The arrays are sorted, with the most likely (highest-weighted) states first. The probability of each state is computed using the HMM Maximum Likelihood estimates.

Version:
$Id: HMM.java,v 1.31 2002/07/20 19:38:03 srhea Exp $
Author:
Dennis Geels
See Also:
HMM.predict(int), Model.Prediction

Field Summary
 double log_likelihood
          The logarithm of the likelihood of this Prediction given the current model parameters (p(D|\theta)).
 QuickSerializable[] states
          The states predicted to occur soon.
 double[] weights
          The estimated weight (confidence) for each state.
 
Constructor Summary
HMM.Prediction(InputBuffer buffer)
          Constructs a Prediction from its serialized form.
HMM.Prediction(QuickSerializable[] states, double[] weights, double log_likelihood)
          Creates a new Prediction with the specified states and their weights.
 
Method Summary
 void serialize(OutputBuffer buffer)
          Add the object to the buffer.
 String toString()
          Produces a brief human-readable summary of this Prediction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

states

public QuickSerializable[] states
The states predicted to occur soon.


weights

public double[] weights
The estimated weight (confidence) for each state. Each weight is equal to the number of times the state is expected to occur in the near future.


log_likelihood

public double log_likelihood
The logarithm of the likelihood of this Prediction given the current model parameters (p(D|\theta)).

Constructor Detail

HMM.Prediction

public HMM.Prediction(QuickSerializable[] states,
                      double[] weights,
                      double log_likelihood)
Creates a new Prediction with the specified states and their weights.


HMM.Prediction

public HMM.Prediction(InputBuffer buffer)
               throws QSException
Constructs a Prediction from its serialized form.

Method Detail

toString

public String toString()
Produces a brief human-readable summary of this Prediction.

Overrides:
toString in class Object
Returns:
a String containing the top few predicted states, ordered by weight.

serialize

public void serialize(OutputBuffer buffer)
Description copied from interface: QuickSerializable
Add the object to the buffer.

Specified by:
serialize in interface QuickSerializable
Parameters:
buffer - the output buffer to add the object to