public class Observations
extends java.lang.Object
Constructor and Description |
---|
Observations()
Constructs observations.
|
Modifier and Type | Method and Description |
---|---|
void |
addObservation(java.lang.String input,
java.lang.String output)
Adds input and output to observation.
|
Channel |
generateChannel()
Returns the channel.
|
double[][] |
getChannelMatrix()
Gives the channel matrix.
|
int |
getDegreeOfFreedomMI()
Gives the number of unique pairs of inputs and outputs encountered so far.
|
java.lang.String[] |
getInputNames()
Gives the array of input names.
|
int[] |
getInputObservationsArray()
Returns the array of numbers of input observations.
|
ProbDist |
getInputProbDist()
Returns the input probability distribution obtained from the observations.
|
int[][] |
getObservationsMatrix()
Like getChannelMatrix(), but the cells contain the number of times the
respective input and output have been observed together.
|
java.util.LinkedHashMap<java.lang.String,java.util.LinkedHashMap<java.lang.String,java.lang.Integer>> |
getObservationsMatrixMap()
Returns the hash map represetation of the observations matrix
in which each cell contains the number of times the
respective input and output have been observed together.
|
java.lang.String[] |
getOutputNames()
Gives the array of output names.
|
int[] |
getOutputObservationsArray()
Returns the array of numbers of output observations.
|
int |
getSampleCount()
Gives the number of samples recorded by this Observations object so far.
|
int[] |
getSampleCountGivenInput()
Gives the numbers of samples that have a given input
recorded by this Observations object so far.
|
int[] |
getSampleCountGivenOutput()
Gives the numbers of samples that have a given output
recorded by this Observations object so far.
|
int[][] |
getSortedObservationsMatrix(java.lang.String[] sortedInputNames,
java.lang.String[] sortedOutputNames)
Like getObservationsMatrix, but the cells are sorted according
the given arrays of input and output names.
|
int |
getUniqueInputCount()
Gives the number of unique inputs encountered so far.
|
int |
getUniqueOutputCount()
Gives the number of unique outputs encountered so far.
|
boolean |
hasSufficientInputs()
Tests whether the number of unique inputs recorded in this Observations
object is sufficient for estimating mutual information.
|
boolean |
hasSufficientOutputs()
Tests whether the number of unique outputs recorded in this Observations
object is sufficient for estimating mutual information.
|
boolean |
hasSufficientSamplesForMEL()
Tests whether the sample size recorded in this Observations object
is sufficient for estimating min-entropy leakage.
|
boolean |
hasSufficientSamplesForMI()
Tests whether the sample size recorded in this Observations object
is sufficient for estimating mutual information.
|
double |
largestInterval()
Find the largest confidence interval.
|
static double[][] |
observationsToJPMF(int[][] observationsMatrix)
Returns the joint probability matrix of the observations
given a matrix of joint observed counts.
|
static double[] |
observationsToPMF(int[] observedCounts)
Returns the PMF array of the observations
given an array of observed counts.
|
static void |
printDist(int[] array,
java.lang.String message) |
void |
printJointFrequencyMatrix()
Print the joint probability matrix obtained from the given observations file.
|
void |
printObservationsMatrix()
Print the observations matrix for the given observations file.
|
public void addObservation(java.lang.String input, java.lang.String output)
input
- input valueoutput
- output valuepublic Channel generateChannel()
public double[][] getChannelMatrix()
public int getDegreeOfFreedomMI()
Observations
object.public java.lang.String[] getInputNames()
public int[] getInputObservationsArray()
public ProbDist getInputProbDist()
public int[][] getObservationsMatrix()
public java.util.LinkedHashMap<java.lang.String,java.util.LinkedHashMap<java.lang.String,java.lang.Integer>> getObservationsMatrixMap()
public java.lang.String[] getOutputNames()
public int[] getOutputObservationsArray()
public int getSampleCount()
public int[] getSampleCountGivenInput()
public int[] getSampleCountGivenOutput()
public int[][] getSortedObservationsMatrix(java.lang.String[] sortedInputNames, java.lang.String[] sortedOutputNames)
sortedInputNames
- sortedOutputNames
- public int getUniqueInputCount()
Observations
object.public int getUniqueOutputCount()
Observations
object.public boolean hasSufficientInputs()
public boolean hasSufficientOutputs()
public boolean hasSufficientSamplesForMEL()
public boolean hasSufficientSamplesForMI()
public double largestInterval()
public static double[][] observationsToJPMF(int[][] observationsMatrix)
observationsMatrix
- observations matrixpublic static double[] observationsToPMF(int[] observedCounts)
observedCounts
- array of observed countspublic static void printDist(int[] array, java.lang.String message)
public void printJointFrequencyMatrix()
public void printObservationsMatrix()