jBNC Toolbox

jbnc.util
Class FrequencyCalc

java.lang.Object
  extended byjbnc.util.FrequencyCalc

public class FrequencyCalc
extends java.lang.Object

Calculate variable frequencies given a dataset.

Since:
June 1, 1999
Author:
Jarek Sacha

Field Summary
protected  Dataset dataset
           
protected  int[][] freqX
          Frequency of variable values X.
protected  int[][][][] freqXY
          Joint frequency of variable values X and Y.
protected  int[][][][][] freqXYZ
          Joint frequency of variable values X, Y and Z.
 AttributeSpecs[] names
          Specs for variables in the dataset from which the frequecies were calculated.
 int nbCases
          Number of cases in the dataset the dataset.
 
Constructor Summary
FrequencyCalc(DatasetInt dataset)
          Constructor for the FrequencyCalc object
 
Method Summary
protected  void calcFreqXY_X()
          Calculate values of freqX and freqXY.
protected  void calcFreqXYZ()
          Calculate values of freqXYZ
protected  void init(Dataset dataset)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nbCases

public int nbCases
Number of cases in the dataset the dataset.


names

public AttributeSpecs[] names
Specs for variables in the dataset from which the frequecies were calculated.


freqXYZ

protected int[][][][][] freqXYZ
Joint frequency of variable values X, Y and Z. X corresponds any attribute with index [0,nbAttrib-1]. Y corresponds any attribute with index [0,nbAttrib-1]. Index of X is always less or iqual to Y, since relation is symetric. Z is the last variable, so its index is implicit (equal to nbAttrib).

Note that elements on the diagonal are used only for calculation of p(x,z), they are not used guring computation of p(x,y,z).
 freqXYZ[index_x][index_y][state_x][state_y][state_z]
 


freqXY

protected int[][][][] freqXY
Joint frequency of variable values X and Y. X corresponds variable with index [0,nbAttrib]. Y corresponds variable with index [0,nbAttrib].
 freqXY[index_x][index_y][state_x][state_y]
 


freqX

protected int[][] freqX
Frequency of variable values X. X corresponds any variable, with index [0,nbAttrib].
 freqX[index_x][state_x]
 


dataset

protected Dataset dataset
Constructor Detail

FrequencyCalc

public FrequencyCalc(DatasetInt dataset)
Constructor for the FrequencyCalc object

Parameters:
dataset - Description of Parameter
Method Detail

init

protected void init(Dataset dataset)
Parameters:
dataset - Description of Parameter

calcFreqXYZ

protected void calcFreqXYZ()
Calculate values of freqXYZ


calcFreqXY_X

protected void calcFreqXY_X()
Calculate values of freqX and freqXY.


SourceForge.net Logo