Makes CTable callable, retrieving values according to String keys in ctVals
The number of columns in the table.
The number of columns in the table.
Conditional entropy of the column variable, H(Col|Row).
Conditional entropy of the column variable, H(Col|Row).
Returns the conditional entropy of a 2D table (rows conditioned on cols).
Returns the conditional entropy of a 2D table (rows conditioned on cols).
For a contingency table for two random variables X = {x1, x2, x3 ...} and Y = {y1, y2, y3 ...}, of the form
| y1 y2 y3 ... | x1 . . . ... | x2 . . . ... | x3 . . . ... | ...
this function calculates the entropy of the row variable X conditional on the column variable Y, H(X|Y).
2-dimensional vector of integer vectors
conditional entropy
Conditional entropy of the row variable, H(Row|Col).
Conditional entropy of the row variable, H(Row|Col).
Map of strings to various CTable values
Calculates an entropy term from a probability.
Calculates an entropy term from a probability.
Note that this function returns the term p*log2(p) for a probability p, which is always negative. Callers of this function must therefore take the negative of sums of entropies calculated using this function, as the definition of entropy is E[-log(P(X)].
Checks two contingency tables for equality.
Checks two contingency tables for equality.
Converts the probability table to a list of CtPos instances for sorting by probability
table entries as frequencies
table entries as frequencies
Higher order function that returns a function for calculating the negated sum of a numerical data set that has a another function applied to it
Higher order function that returns a function for calculating the negated sum of a numerical data set that has a another function applied to it
function to apply to numerical data
function which applies f to a data set and calculates the negation of the resulting sum
Marginal entropy of the column variable.
Marginal entropy of the column variable.
Composition to produce marginal entropy function
Composition to produce marginal entropy function
Returns the marginal entropy (marginalized across columns) of a 2D table.
Returns the marginal entropy (marginalized across columns) of a 2D table.
For a contingency table for two random variables X = {x1, x2, x3 ...} and Y = {y1, y2, y3 ...}, of the form
| y1 y2 y3 ... | x1 . . . ... | x2 . . . ... | x3 . . . ... | ...
this function calculates the marginal entropy of the row variable X, H(X).
2-dimensional vector of integer vectors
marginal entropy
Marginal entropy of the row variable.
Marginal entropy of the row variable.
Mutual information calculated via entropies.
Mutual information calculated via entropies.
Since mutual information is symmetric, it can be calculated either in terms of the row variable or the column variable (here it is calculated in terms of the row variable).
The total number of samples (the sum of all counts in the table).
The total number of samples (the sum of all counts in the table).
Note: depending on the weighting scheme being used, this number may be 0, leading to NaN in output.
Converts a vector of counts to a marginal probability.
Converts a vector of counts to a marginal probability.
Takes the sum of all counts in the vector and divides by the total number of samples in the table to give the probability of observing any of the events tabulated in that vector.
The number of rows in the table.
The number of rows in the table.
The table of counts, as a matrix of integers.
The table of counts, as a matrix of integers.
Writes a contingency table to a file (with space-delimited columns).
Writes a contingency table to a file (with space-delimited columns).
table with doubles
table with doubles
Pretty-prints contingency table to string
Pretty-prints contingency table to string
The transfer efficiency is the amount of information transmitted, normalized by the maximum possible information transfer, ie, the marginal entropy of the input distribution.
The transfer efficiency is the amount of information transmitted, normalized by the maximum possible information transfer, ie, the marginal entropy of the input distribution.
The table of counts, transposed.
The table of counts, transposed.
Class for building a contingency table from scratch