Class

infcalcs.tables

ContingencyTable

Related Doc: package tables

Permalink

class ContingencyTable[A] extends CTable[A]

Class for building a contingency table from scratch

Linear Supertypes
CTable[A], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ContingencyTable
  2. CTable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ContingencyTable(t: Vector[Vector[A]])(implicit n: Numeric[A])

    Permalink

    t

    two dimensional table of values

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def apply(s: String): Double

    Permalink

    Makes CTable callable, retrieving values according to String keys in ctVals

    Makes CTable callable, retrieving values according to String keys in ctVals

    s

    string present in ctVals' keys

    Definition Classes
    CTable
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. lazy val cTableWithDoubles: ContingencyTable[Double]

    Permalink
    Definition Classes
    CTable
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. lazy val cols: Int

    Permalink

    The number of columns in the table.

    The number of columns in the table.

    Definition Classes
    ContingencyTableCTable
  9. lazy val condColEntropy: Double

    Permalink

    Conditional entropy of the column variable, H(Col|Row).

    Conditional entropy of the column variable, H(Col|Row).

    Definition Classes
    CTable
  10. def condEntropy(t: Vector[Vector[A]]): Double

    Permalink

    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).

    t

    2-dimensional vector of integer vectors

    returns

    conditional entropy

    Definition Classes
    CTable
  11. lazy val condRowEntropy: Double

    Permalink

    Conditional entropy of the row variable, H(Row|Col).

    Conditional entropy of the row variable, H(Row|Col).

    Definition Classes
    CTable
  12. lazy val ctVals: Map[String, Double]

    Permalink

    Map of strings to various CTable values

    Map of strings to various CTable values

    Definition Classes
    CTable
  13. def eTerm(prob: Double): Double

    Permalink

    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)].

    Definition Classes
    CTable
  14. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  15. def equals(ct: Any): Boolean

    Permalink

    Checks two contingency tables for equality.

    Checks two contingency tables for equality.

    Definition Classes
    CTable → AnyRef → Any
  16. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. def generateCtPos(rand: Boolean = false): List[CtPos]

    Permalink

    Converts the probability table to a list of CtPos instances for sorting by probability

    Converts the probability table to a list of CtPos instances for sorting by probability

    Definition Classes
    CTable
  18. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  19. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  20. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  21. lazy val jointProbTable: Vector[Vector[Double]]

    Permalink

    table entries as frequencies

    table entries as frequencies

    Definition Classes
    CTable
  22. def mapNegSum[T](f: (T) ⇒ Double): (TraversableOnce[T]) ⇒ Double

    Permalink

    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

    f

    function to apply to numerical data

    returns

    function which applies f to a data set and calculates the negation of the resulting sum

    Definition Classes
    CTable
  23. lazy val margColEntropy: Double

    Permalink

    Marginal entropy of the column variable.

    Marginal entropy of the column variable.

    Definition Classes
    CTable
  24. def margEntFunc: (Vector[A]) ⇒ Double

    Permalink

    Composition to produce marginal entropy function

    Composition to produce marginal entropy function

    Definition Classes
    CTable
  25. def margEntropy(t: Vector[Vector[A]]): Double

    Permalink

    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).

    t

    2-dimensional vector of integer vectors

    returns

    marginal entropy

    Definition Classes
    CTable
  26. lazy val margRowEntropy: Double

    Permalink

    Marginal entropy of the row variable.

    Marginal entropy of the row variable.

    Definition Classes
    CTable
  27. lazy val mutualInformation: Double

    Permalink

    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).

    Definition Classes
    CTable
  28. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  29. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  30. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  31. val numSamples: A

    Permalink

    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.

    Definition Classes
    CTable
  32. def probVect: (Vector[A]) ⇒ Double

    Permalink

    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.

    Definition Classes
    CTable
  33. lazy val rows: Int

    Permalink

    The number of rows in the table.

    The number of rows in the table.

    Definition Classes
    ContingencyTableCTable
  34. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  35. lazy val table: Vector[Vector[A]]

    Permalink

    The table of counts, as a matrix of integers.

    The table of counts, as a matrix of integers.

    Definition Classes
    ContingencyTableCTable
  36. def tableToFile(f: String): Unit

    Permalink

    Writes a contingency table to a file (with space-delimited columns).

    Writes a contingency table to a file (with space-delimited columns).

    Definition Classes
    CTable
  37. lazy val tableWithDoubles: Vector[Vector[Double]]

    Permalink

    table with doubles

    table with doubles

    Definition Classes
    CTable
  38. def toString(): String

    Permalink

    Pretty-prints contingency table to string

    Pretty-prints contingency table to string

    Definition Classes
    CTable → AnyRef → Any
  39. lazy val transferEfficiency: Double

    Permalink

    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.

    Definition Classes
    CTable
  40. lazy val ttable: Vector[Vector[A]]

    Permalink

    The table of counts, transposed.

    The table of counts, transposed.

    Definition Classes
    CTable
  41. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  43. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from CTable[A]

Inherited from AnyRef

Inherited from Any

Ungrouped