Class BayesianFactorFactory


  • public class BayesianFactorFactory
    extends Object
    Author: Claudio "Dna" Bonesana Project: crema Date: 16.04.2021 11:11
    • Method Detail

      • one

        public static BayesianDefaultFactor one​(int var)
        Parameters:
        var - the variable associated with this factor. This variable will be considered binary
        Returns:
        a BayesianDefaultFactor where state 1 has probability 1.0.
      • zero

        public static BayesianDefaultFactor zero​(int var)
        Parameters:
        var - the variable associated with this factor. This variable will be considered binary
        Returns:
        a BayesianDefaultFactor where state 0 has probability 1.0.
      • domain

        public BayesianFactorFactory domain​(int[] domain,
                                            int[] sizes)
        Parameters:
        domain - the variables that defines the domain
        sizes - the sizes of each variable
        Returns:
        a BayesianFactorFactory object that can be used to chain multiple commands.
      • data

        public BayesianFactorFactory data​(double[] data)
        Parameters:
        data - an array of values that will be directly used
        Returns:
        a BayesianFactorFactory object that can be used to chain multiple commands.
      • logData

        public BayesianFactorFactory logData​(double[] data)
        Parameters:
        data - an array of values in log-space that will be directly used
        Returns:
        a BayesianFactorFactory object that can be used to chain multiple commands.
      • data

        public BayesianFactorFactory data​(int[] domain,
                                          double[] data)
        Parameters:
        domain - the order of the variables that defines the values
        data - the values to use specified with the given domain order
        Returns:
        a BayesianFactorFactory object that can be used to chain multiple commands.
      • value

        public BayesianFactorFactory value​(double value,
                                           int... states)
        Parameters:
        value - a single value to set
        states - the states that defines this value
        Returns:
        a BayesianFactorFactory object that can be used to chain multiple commands.
      • valueAt

        public BayesianFactorFactory valueAt​(double d,
                                             int index)
        Parameters:
        d - a single value to set
        index - the index (or offset) of the value to set
        Returns:
        a BayesianFactorFactory object that can be used to chain multiple commands.
      • valuesAt

        public BayesianFactorFactory valuesAt​(double[] d,
                                              int index)
        Parameters:
        d - a single value to set
        index - the index (or offset) of the value to set
        Returns:
        a BayesianFactorFactory object that can be used to chain multiple commands.
      • set

        public BayesianFactorFactory set​(double value,
                                         int... states)
        Parameters:
        value - a single value to set
        states - the states that defines this value
        Returns:
        a BayesianFactorFactory object that can be used to chain multiple commands.
      • not

        public BayesianNotFactor not​(int parent)
        Requires a pre-defined Domain.
        Parameters:
        parent - variable that is the parent of this factor
        Returns:
        a logic BayesianNotFactor
      • not

        public BayesianAndFactor not​(int parent,
                                     int trueState)
        Requires a pre-defined Domain.
        Parameters:
        parent - variable that is the parent of this factor
        trueState - index of the state to be considered as TRUE for the given parent
        Returns:
        a logic BayesianAndFactor
      • and

        public BayesianAndFactor and​(int... parents)
        Requires a pre-defined Domain.
        Parameters:
        parents - variables that are parents of this factor
        Returns:
        a logic BayesianAndFactor
      • and

        public BayesianAndFactor and​(int[] parents,
                                     int[] trueStates)
        Requires a pre-defined Domain.
        Parameters:
        trueStates - index of the state to be considered as TRUE for each given parent
        parents - variables that are parents of this factor
        Returns:
        a logic BayesianAndFactor
      • or

        public BayesianOrFactor or​(int... parents)
        Requires a pre-defined Domain.
        Parameters:
        parents - variables that are parents of this factor
        Returns:
        a logic BayesianOrFactor
      • or

        public BayesianOrFactor or​(int[] parents,
                                   int[] trueStates)
        Requires a pre-defined Domain.
        Parameters:
        trueStates - index of the state to be considered as TRUE for each given parent
        parents - variables that are parents of this factor
        Returns:
        a logic BayesianOrFactor
      • noisyOr

        public BayesianNoisyOrFactor noisyOr​(int[] parents,
                                             double[] strengths)
        Requires a pre-defined Domain.
        Parameters:
        parents - variables that are parents of this factor
        strengths - values for the inhibition strength for each given parent
        Returns:
        a logic BayesianNoisyOrFactor
      • noisyOr

        public BayesianNoisyOrFactor noisyOr​(int[] parents,
                                             int[] trueStates,
                                             double[] strengths)
        Requires a pre-defined Domain.
        Parameters:
        parents - variables that are parents of this factor
        trueStates - index of the state to be considered as TRUE for each given parent
        strengths - values for the inhibition strength for each given parent
        Returns:
        a logic BayesianNoisyOrFactor