Class BNSufficientStatistics

java.lang.Object
es.upm.fi.cig.multictbnc.learning.parameters.bn.BNSufficientStatistics
All Implemented Interfaces:
SufficientStatistics

public class BNSufficientStatistics extends Object implements SufficientStatistics
Compute and store the sufficient statistics of a discrete BN node. The sufficient statistics are:

(1) Nx: number of times a variable takes a certain state.

  • Constructor Details

    • BNSufficientStatistics

      public BNSufficientStatistics(double nHP)
      Constructs a BNSufficientStatistics by receiving the hyperparameter of the Dirichlet prior distribution.
      Parameters:
      nHP - number of times the variables are in a certain state while its parents take a certain instantiation (hyperparameter)
  • Method Details

    • getNx

      public double[][] getNx()
      Returns the sufficient statistics of the node. This is the number of times the variable is in a certain state while its parents take a certain instantiation.
      Returns:
      array with the number of appearances of each state of the node given an instantiation of the parents
    • getNxHyperparameter

      public double getNxHyperparameter()
      Returns the hyperparameter value of the Dirichlet prior distribution.
      Returns:
      hyperparameter value
    • computeSufficientStatistics

      public void computeSufficientStatistics(DiscreteStateNode node, Dataset dataset)
      Computes the sufficient statistics of a node in a BN. This is the number of times the variable is in a certain state while its parents take a certain instantiation.
      Specified by:
      computeSufficientStatistics in interface SufficientStatistics
      Parameters:
      dataset - dataset from which the sufficient statistics are extracted
      node - node whose sufficient statistics are computed