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.24 2002/01/08 18:24:18 geels 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(byte[] data, int[] offset)
          Create a Prediction from its QuickSerializable form.
HMM.Prediction(QuickSerializable[] states, double[] weights, double log_likelihood)
          Creates a new Prediction with the specified states and their weights.
 
Method Summary
 void to_bytes(byte[] data, int[] offset)
          Store the object in its "on the wire" form in the byte array data, starting at index offset [0], and increment offset [0] by the number of bytes written; if data == null, increment offset [0] by the number of bytes that would have been written otherwise.
 String toString()
          Produces a brief human-readable summary of this Prediction.
 int type_code()
          Returns the unique integer associated with this class in the TypeTable.
 
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(byte[] data,
                      int[] offset)
               throws QSException
Create a Prediction from its QuickSerializable 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.

to_bytes

public void to_bytes(byte[] data,
                     int[] offset)
Description copied from interface: QuickSerializable
Store the object in its "on the wire" form in the byte array data, starting at index offset [0], and increment offset [0] by the number of bytes written; if data == null, increment offset [0] by the number of bytes that would have been written otherwise.
Specified by:
to_bytes in interface QuickSerializable
Following copied from interface: ostore.util.QuickSerializable
Parameters:
data - The byte array to store into, or null.
offset - A single element array whose first element is the index in data to begin writing at on function entry, and which on function exit has been incremented by the number of bytes written.

type_code

public int type_code()
Description copied from interface: QuickSerializable
Returns the unique integer associated with this class in the TypeTable.
Specified by:
type_code in interface QuickSerializable
Following copied from interface: ostore.util.QuickSerializable
Returns:
an integer unique to this class