Package edu.cmu.tetrad.data
Interface CellTable
- All Known Implementing Classes:
CellTableAdTree,CellTableCountSample
public interface CellTable
Represents a cell table that stores the values of the cells in a table of arbitrary dimension, for use, e.g., in the
context of a contingency table--e.g. for chi-square or g-square tests.
- Author:
- josephramsey
-
Method Summary
Modifier and TypeMethodDescriptionintcalcMargin(int[] coords) Calculates the marginal sum for the cell table based on the given coordinates.intcalcMargin(int[] coords, int[] marginVars) Calculates the marginal sum for the cell table based on the given coordinates and margin variables.intgetDimension(int varIndex) Returns the dimension of the specified variable in the cell table.intgetValue(int[] coords) Returns the value of the cell specified by the given coordinates.
-
Method Details
-
getDimension
int getDimension(int varIndex) Returns the dimension of the specified variable in the cell table.- Parameters:
varIndex- the index of the variable.- Returns:
- the dimension of the variable.
-
calcMargin
int calcMargin(int[] coords) Calculates the marginal sum for the cell table based on the given coordinates.- Parameters:
coords- an array of coordinates where -1 indicates the variables over which marginal sums should be taken.- Returns:
- the marginal sum specified.
-
calcMargin
int calcMargin(int[] coords, int[] marginVars) Calculates the marginal sum for the cell table based on the given coordinates and margin variables.- Parameters:
coords- the array of coordinates where -1 indicates the variables over which marginal sums should be taken.marginVars- the array of indices of the margin variables.- Returns:
- the marginal sum specified.
-
getValue
int getValue(int[] coords) Returns the value of the cell specified by the given coordinates.- Parameters:
coords- the coordinates of the cell.- Returns:
- the value of the cell.
-