Interface BayesianFactor

    • Method Detail

      • getDomain

        Strides getDomain()
        Specified by:
        getDomain in interface GenericFactor
        Returns:
        The domain of the factor. This includes variables, sizes and strides.
      • getValue

        double getValue​(int... states)
        Parameters:
        states - specified in the order of the factor's domain
        Returns:
        the value associated to the given states
      • getValueAt

        double getValueAt​(int index)
        Parameters:
        index - offset based on the factor's domain
        Returns:
        the value associated to the given states
      • getLogValue

        double getLogValue​(int... states)
        Parameters:
        states - specified in the order of the factor's domain
        Returns:
        the value associated to the given states in log format
      • getLogValueAt

        double getLogValueAt​(int index)
        Parameters:
        index - offset based on the factor's domain
        Returns:
        the value associated to the given states in log format
      • getData

        double[] getData()
      • filter

        BayesianFactor filter​(int variable,
                              int state)
        Description copied from interface: OperableFactor

        Filter the factor by selecting only the values where the specified variable is in the specified state.

        Should return this if the variable is not part of the domain of the factor.

        Specified by:
        filter in interface FilterableFactor<BayesianFactor>
        Specified by:
        filter in interface OperableFactor<BayesianFactor>
        Parameters:
        variable - variable to filter
        state - state of the variable to filter
        Returns:
        a new factor where the given variable in the given state has been filtered out
      • marginalize

        BayesianFactor marginalize​(int variable)
        Description copied from interface: OperableFactor
        Sum out a variable from the factor.
        Specified by:
        marginalize in interface OperableFactor<BayesianFactor>
        Parameters:
        variable - variable to be marginalize out from this factor
        Returns:
        a new factor without the given variable
      • logProb

        double logProb​(gnu.trove.map.TIntIntMap[] data,
                       int leftVar)