|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object JavaMI.ProbabilityState
public class ProbabilityState
Calculates the probabilities of each state in a random variable. Provides the base for all functions of one variable. Additional functions include the normaliseArrays function which converts all inputs so they start at 0, and the mergeArrays function which creates an array of the joint state of the two input arrays.
Field Summary | |
---|---|
int |
maxState
|
java.util.HashMap<java.lang.Integer,java.lang.Double> |
probMap
|
Constructor Summary | |
---|---|
ProbabilityState(double[] dataVector)
Constructor for the ProbabilityState class. |
Method Summary | |
---|---|
static int |
mergeArrays(double[] firstVector,
double[] secondVector,
double[] outputVector)
Takes in two arrays and writes the joint state of those arrays to the output vector, returning the maximum joint state. |
static int |
normaliseArray(double[] inputVector,
int[] outputVector)
Takes an input vector and writes an output vector which is a normalised version of the input, and returns the maximum state. |
static void |
printDoubleVector(double[] vector)
A helper function which prints out any given double vector. |
static void |
printIntVector(int[] vector)
A helper function which prints out any given int vector. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final java.util.HashMap<java.lang.Integer,java.lang.Double> probMap
public final int maxState
Constructor Detail |
---|
public ProbabilityState(double[] dataVector)
dataVector
- Input vector. It is discretised to the floor of each value.Method Detail |
---|
public static final int normaliseArray(double[] inputVector, int[] outputVector)
inputVector
- The vector to normalise.outputVector
- The normalised vector. Must be instantiated to length inputVector.length.
public static final int mergeArrays(double[] firstVector, double[] secondVector, double[] outputVector)
firstVector
- The first vector.secondVector
- The second vector.outputVector
- The merged vector. Must be instantiated to length inputVector.length.
public static void printIntVector(int[] vector)
vector
- The vector to print out.public static void printDoubleVector(double[] vector)
vector
- The vector to print out.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |