Initializes a new instance of the {@link com.bayesserver.Table} class, with the same structure as an existing [table], copying the values if requested.
The table to copy.
if set to true
the values from [table] are copied, otherwise all values are initialized to zero.
Initializes a new instance of the {@link com.bayesserver.Table} class, with the same structure as an existing [table], copying the values if requested, and optionally shifting any times.
The table to copy.
if set to true
the values from [table] are copied, otherwise all values are initialized to zero.
If supplied shifts any times embedded in the source table by the specified number of units.
Initializes a new instance of the {@link com.bayesserver.Table} class with a single {@link com.bayesserver.Variable}. All values are initialized to zero.
The variable.
Initializes a new instance of the {@link com.bayesserver.Table} class from a single {@link com.bayesserver.VariableContext}. All values are initialized to zero.
The variable context.
Initializes a new instance of the {@link com.bayesserver.Table} class with the specified variables, at an optional time. All values are initialized to zero.
The variables.
The time for the variables. Can be null.
Initializes a new instance of the {@link com.bayesserver.Table} class with the specified variables, at an optional time. All values are initialized to zero.
The variables.
The time for the variables. Can be null.
Specifies whether the variables should be marked as Head or Tail.
Initializes a new instance of the {@link com.bayesserver.Table} class with the variables specified in [variableContexts]. All values are initialized to zero.
The variables, times, and head/tail specifications to include in the distribution.
For internal use only.
The variables, times, and head/tail specifications to include in the distribution.
Initializes a new instance of the {@link com.bayesserver.Table} class, with the same structure as an existing [table], copying the values if requested. Initializes a new instance of the {@link com.bayesserver.Table} class, with the same structure as an existing [table], copying the values if requested, and optionally shifting any times. Initializes a new instance of the {@link com.bayesserver.Table} class with a single {@link com.bayesserver.Variable}. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class from a single {@link com.bayesserver.VariableContext}. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class with the specified variables, at an optional time. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class with the specified variables, at an optional time. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class with the variables specified in [variableContexts]. All values are initialized to zero. For internal use only. Initializes a new instance of the {@link com.bayesserver.Table} class with the specified variables. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class with [count] variable contexts taken from [buffer]. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class with [count] variable contexts taken from [buffer]. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class with the specified node variable at the specified time. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class with a single {@link com.bayesserver.Variable} and time. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class with all the variables from the supplied nodes. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class with all the variables from the supplied nodes. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class with all the variables from the supplied nodes. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class with all the variables from the supplied nodes. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class, copying the [table] passed in. Initializes a new instance of the {@link com.bayesserver.Table} class, copying the [table] passed in, however adjusting any times by the [timeShift]. Initializes a new instance of the {@link com.bayesserver.Table} class with the specified node variables. All values are initialized to zero.
The variables, times, and head/tail specifications to include in the distribution.
Initializes a new instance of the {@link com.bayesserver.Table} class, with the same structure as an existing [table], copying the values if requested. Initializes a new instance of the {@link com.bayesserver.Table} class, with the same structure as an existing [table], copying the values if requested, and optionally shifting any times. Initializes a new instance of the {@link com.bayesserver.Table} class with a single {@link com.bayesserver.Variable}. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class from a single {@link com.bayesserver.VariableContext}. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class with the specified variables, at an optional time. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class with the specified variables, at an optional time. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class with the variables specified in [variableContexts]. All values are initialized to zero. For internal use only. Initializes a new instance of the {@link com.bayesserver.Table} class with the specified variables. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class with [count] variable contexts taken from [buffer]. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class with [count] variable contexts taken from [buffer]. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class with the specified node variable at the specified time. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class with a single {@link com.bayesserver.Variable} and time. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class with all the variables from the supplied nodes. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class with all the variables from the supplied nodes. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class with all the variables from the supplied nodes. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class with all the variables from the supplied nodes. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class, copying the [table] passed in. Initializes a new instance of the {@link com.bayesserver.Table} class, copying the [table] passed in, however adjusting any times by the [timeShift]. Initializes a new instance of the {@link com.bayesserver.Table} class with the specified node variables. All values are initialized to zero.
The variables, times, and head/tail specifications to include in the distribution.
Initializes a new instance of the {@link com.bayesserver.Table} class, with the same structure as an existing [table], copying the values if requested. Initializes a new instance of the {@link com.bayesserver.Table} class, with the same structure as an existing [table], copying the values if requested, and optionally shifting any times. Initializes a new instance of the {@link com.bayesserver.Table} class with a single {@link com.bayesserver.Variable}. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class from a single {@link com.bayesserver.VariableContext}. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class with the specified variables, at an optional time. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class with the specified variables, at an optional time. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class with the variables specified in [variableContexts]. All values are initialized to zero. For internal use only. Initializes a new instance of the {@link com.bayesserver.Table} class with the specified variables. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class with [count] variable contexts taken from [buffer]. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class with [count] variable contexts taken from [buffer]. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class with the specified node variable at the specified time. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class with a single {@link com.bayesserver.Variable} and time. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class with all the variables from the supplied nodes. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class with all the variables from the supplied nodes. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class with all the variables from the supplied nodes. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class with all the variables from the supplied nodes. All values are initialized to zero. Initializes a new instance of the {@link com.bayesserver.Table} class, copying the [table] passed in. Initializes a new instance of the {@link com.bayesserver.Table} class, copying the [table] passed in, however adjusting any times by the [timeShift]. Initializes a new instance of the {@link com.bayesserver.Table} class with the specified node variables. All values are initialized to zero.
The variables, times, and head/tail specifications to include in the distribution.
Specifies whether the variables should be marked as Head or Tail.
Initializes a new instance of the {@link com.bayesserver.Table} class with the specified variables. All values are initialized to zero.
The variables.
Initializes a new instance of the {@link com.bayesserver.Table} class with [count] variable contexts taken from [buffer]. All values are initialized to zero.
The buffer of {@link com.bayesserver.VariableContext} instances.
The number of items to read from [buffer].
Initializes a new instance of the {@link com.bayesserver.Table} class with [count] variable contexts taken from [buffer]. All values are initialized to zero.
The buffer of {@link com.bayesserver.VariableContext} instances.
The number of items to read from [buffer].
Specifies whether the variables should be marked as Head or Tail.
Initializes a new instance of the {@link com.bayesserver.Table} class with the specified node variable at the specified time. All values are initialized to zero.
The node whose variable is used to construct the {@link com.bayesserver.Table}.
The time for the variables. Can be null.
Initializes a new instance of the {@link com.bayesserver.Table} class with a single {@link com.bayesserver.Variable} and time. All values are initialized to zero.
The variable.
The time for the variables. Can be null.
Initializes a new instance of the {@link com.bayesserver.Table} class with all the variables from the supplied nodes. All values are initialized to zero.
Initializes a new instance of the {@link com.bayesserver.Table} class with all the variables from the supplied nodes. All values are initialized to zero.
The {@link com.bayesserver.Node} instances.
Initializes a new instance of the {@link com.bayesserver.Table} class with all the variables from the supplied nodes. All values are initialized to zero.
The {@link com.bayesserver.Node} instances.
Specifies whether the variables should be marked as Head or Tail.
Initializes a new instance of the {@link com.bayesserver.Table} class with all the variables from the supplied nodes. All values are initialized to zero.
The {@link com.bayesserver.Node} instances.
Specifies whether the variables should be marked as Head or Tail.
Initializes a new instance of the {@link com.bayesserver.Table} class, copying the [table] passed in.
The table to copy.
Initializes a new instance of the {@link com.bayesserver.Table} class, copying the [table] passed in, however adjusting any times by the [timeShift].
The table to copy.
If supplied shifts any times embedded in the source table by the specified number of units.
Initializes a new instance of the {@link com.bayesserver.Table} class with the specified node variables. All values are initialized to zero.
The node whose variable is used to construct the {@link com.bayesserver.Table}.
Gets the current owner, if assigned to a node. A distribution cannot be modified when it is assigned to a node.
The owner, or null if not assigned to a node.
The data count in the {@link com.bayesserver.Table}. Equals the product of states for each {@link com.bayesserver.Variable}.
The data count.
Gets the collection of variables in the distribution, sorted by time (which may be null) and the order in which variables were created.
All variables in each distribution are sorted, based on their creation order. This is for computational reasons. If you want to access the values with respect to a different variable ordering, see the {@link com.bayesserver.TableIterator} and {@link com.bayesserver.TableAccessor} classes.
Variables sorted by time and the order variables were created.
Adds the values from another table into this instance. Only the
A table whose
Adds the specified value onto all table elements.
The value to add. Can be negative.
Returns true if none of the values in the {@link com.bayesserver.Table} equal zero, or false otherwise.
True if none of the values are zero; false otherwise.
Creates a copy of the distribution. The new distribution will not have an owner.
A copy of this instance.
Creates a copy of the distribution, and shifts any times associated with variables by the specified amount. The new distribution will not have an owner.
The amount to shift any times present in the distribution. Can be negative.
A copy of this instance, with shifted times.
Copies values from the array into the table.
Values to copy. The array can be shorter or longer than the {@link com.bayesserver.Table#size}.
Copies all values from this instance to the destination {@link com.bayesserver.Table}.
The destination table, which can have a count greater than or equal to this instance.
Copies the table values to an array.
The destination array, which must have length equal to or greater than this the count of this instance.
Creates a new distribution by dividing this instance by the [subset]. Also known as the complement.
If the resulting distribution were subsequently multiplied by [subset], the result would be equivalent to this instance.
The subset to divide by.
The new distribution.
Divides this instance in place by the [subset]. Also known as the complement.
The term 'in place' means that this instance is modified, instead of creating a new distribution.
If the resulting distribution were subsequently multiplied by [subset], the result would be equivalent to this instance.The subset to divide by.
Gets the table value corresponding to the given states.
The variable states that together specify a unique value in this table.
For example, if the table represents P(A|B) we can access the value corresponding to P(A=True | B=False) by passing in the states A=True and B=False.
The table value.
Gets the table value corresponding to the given states and associated times.
The variable states and times that together specify a unique value in this table.
Gets the {@link com.bayesserver.Table} value at the specified index into the 1-dimensional array. See {@link com.bayesserver.Table} for information on how entries are stored.
The index into the underlying 1-dimensional array.
The value at the specified index.
Gets the maximum table value, and the index at which it occurs.
The maximum table value and the zero based index at which it occurs.
Gets the index of the table element that corresponds to a particular combination of states.
A state for each variable.
The index corresponding to the states.
Gets the index of the table element that corresponds to a particular combination of states and their times.
A state and time for each variable. Time can be null for non temporal variables.
The index corresponding to the states.
Creates a table with a subset of variables by setting hard evidence on one or more variables.
[values] should contain one entry for each
An array of nullable state indexes, one for each variable in this {@link com.bayesserver.Table} instance. Values are null for variables with no evidence.
The {@link com.bayesserver.Table} of instantiated values. I.e. The table after some variables have been set.
Marginalizes (sums) the [superset] into this instance.
This method initializes all values to zero before performing the marginalization. If you know that all the values are zero (e.g. when a {@link com.bayesserver.Table} is first created), call an overloaded version of this method.
A {@link com.bayesserver.Table} whose variables form a superset of the variables in this instance.
Marginalizes (sums) the [superset] into this instance.
This method initializes all values to zero before performing the marginalization. If you know that all the values are zero (e.g. when a {@link com.bayesserver.Table} is first created), call an overloaded version of this method.
A {@link com.bayesserver.Table} whose variables form a superset of the variables in this instance.
The propagation method to use during marginalization.
Marginalizes (sums) the [superset] into this instance.
This method initializes all values to zero before performing the marginalization. If you know that all the values are zero (e.g. when a {@link com.bayesserver.Table} is first created), call an overloaded version of this method.
A {@link com.bayesserver.Table} whose variables form a superset of the variables in this instance.
Marginalizes (sums) the [superset] into this instance.
This method initializes all values to zero before performing the marginalization. If you know that all the values are zero (e.g. when a {@link com.bayesserver.Table} is first created), call an overloaded version of this method.
A {@link com.bayesserver.Table} whose variables form a superset of the variables in this instance.
The propagation method to use during marginalization.
Marginalizes (sums) the [superset] into this instance.
By default all table values are zero, however if the {@link com.bayesserver.Table} values are not zero the [initialize] parameter avoids the need to initialize all values in the distribution to 0 before performing the marginalization.
A {@link com.bayesserver.Table} whose variables form a superset of the variables in this instance.
Set to true
if all values should be initialized to 0 before the marginalization.
Marginalizes (sums) the [superset] into this instance.
By default all table values are zero, however if the {@link com.bayesserver.Table} values are not zero the [initialize] parameter avoids the need to initialize all values in the distribution to 0 before performing the marginalization.
A {@link com.bayesserver.Table} whose variables form a superset of the variables in this instance.
Set to true
if all values should be initialized to 0 before the marginalization.
The propagation method to use during marginalization.
Marginalizes (sums) the combined [tables], without requiring the memory for the combined distribution.
This method uses very little memory, however in general will perform worse than the standard Marginalize routines.
The tables whose combined distribution you wish to marginalize.
Marginalizes (sums) the combined [tables], without requiring the memory for the combined distribution.
This method uses very little memory, however in general will perform worse than the standard Marginalize routines.
The tables whose combined distribution you wish to marginalize.
Options governing the method, including cancellation.
Creates a new distribution by multiplying this instance by another distribution.
A distribution to multiply by.
A new combined distribution.
Multiplies all values in the distribution by the specified value.
The value to multiply by.
Multiplies the [subset] into this instance.
The term 'in place' means that this instance is modified, instead of creating a new distribution.
By default all table values are zero, so if the {@link com.bayesserver.Table} needs to be initialized to 1 before multiplication use a different overload of this method.A {@link com.bayesserver.Table} whose variables form a subset of the variables in this instance.
Multiplies the [subset] into this instance.
The term 'in place' means that this instance is modified, instead of creating a new distribution.
By default all table values are zero, so the [initialize] parameter avoids the need to initialize all values in the distribution to 1 before performing the multiplication.A {@link com.bayesserver.Table} whose variables form a subset of the variables in this instance.
Set to true
if all values should be initialized to 1 before the multiplication.
Returns any non zero table values, keyed by index.
Normalizes the distribution such that each parent combination sums to 1.
If true, applies a uniform distribution to any parent combinations that sum to zero.
false
if a zero sum was found for any parent combination; true
otherwise
Normalizes the distribution such that each parent combination sums to 1.
false
if a zero sum was found for any parent combination; true
otherwise.
Randomizes the distribution such that each parent combination sums to 1.
Random number generator.
Sets the table value corresponding to the given states.
The variable states that together specify a unique value in this table.
For example, if the table represents P(A|B) we can access the value corresponding to P(A=True | B=False) by passing in the states A=True and B=False.
Sets the table value corresponding to the given states and associated times.
The variable states and times that together specify a unique value in this table.
Sets the {@link com.bayesserver.Table} value at the specified index into the 1-dimensional array. See {@link com.bayesserver.Table} for information on how entries are stored.
The index into the underlying 1-dimensional array.
Sets all values in the {@link com.bayesserver.Table} to a specified value.
The value to set all elements to.
Gets the number of states of a variable at the time this instance was constructed.
The index into {@link com.bayesserver.Table#getSortedVariables}.
The state count.
Gets the number of times each state is repeated for a {@link com.bayesserver.Variable} in the {@link com.bayesserver.Table} layout. See {@link com.bayesserver.Table} for details on layout.
The index into {@link com.bayesserver.Table#getSortedVariables}.
The repeat count for each state.
Calculates the sum of all values in the {@link com.bayesserver.Table}.
The sum of all table values.
Shifts any times associated with the table variables by the specified number of units.
The number of time units to shift. Can be negative if required.
Used to represent conditional probability distributions, joint probability distributions and more general potentials, over a number of discrete variables.
The variables in a {@link com.bayesserver.Table} are automatically sorted by time (if any) and {@link com.bayesserver.Variable}. This is for computational reasons.
The {@link com.bayesserver.Table} class stores it's values in a zero based 1-dimensional array, and the right most variable's states toggle fastest. For example if a {@link com.bayesserver.Table} contains 3 binary variables {A,B,C} all with states {T,F} the table layout would be as follows.
com.bayesserver.TableAccessor
com.bayesserver.TableIterator