Package com.bayesserver
Class CLGaussian
- java.lang.Object
-
- com.bayesserver.CLGaussian
-
- All Implemented Interfaces:
Distribution
public final class CLGaussian extends Object implements Distribution
Represents a Conditional Linear Gaussian probability distribution. The distribution contains aTable
distribution which represents any discrete combinations, and for each combination there exists a multivariate Gaussian distribution and weight/regression coefficients. Note that head variables are those that appear to the left of the bar in the expression P(A|B) and tail variables are those to the right.
-
-
Constructor Summary
Constructors Constructor Description CLGaussian(CLGaussian source)
Initializes a new instance of theCLGaussian
class, copying the source distribution.CLGaussian(CLGaussian source, Integer timeShift)
Initializes a new instance of theCLGaussian
class, copying the source distribution but shifting any times by the specified number of units.CLGaussian(Node node)
Initializes a new instance of theCLGaussian
class with the variables of a single node.CLGaussian(Node node, Integer time)
Initializes a new instance of theCLGaussian
class with the variables of a single node at the specified time.CLGaussian(Variable variable)
Initializes a new instance of theCLGaussian
class with a single variable.CLGaussian(Variable[] variables)
Initializes a new instance of theCLGaussian
class with the specified variables.CLGaussian(VariableContext variableContext)
Initializes a new instance of theCLGaussian
class from a singleVariableContext
.CLGaussian(VariableContext[] variableContexts)
Initializes a new instance of theCLGaussian
class with [count] variables specified in [variableContexts].CLGaussian(VariableContext[] variableContexts, int count)
Initializes a new instance of theCLGaussian
class with [count] variables specified in [variableContexts].CLGaussian(VariableContext[] variableContexts, int count, HeadTail headTail)
Initializes a new instance of theCLGaussian
class with [count] variables specified in [variableContexts].CLGaussian(Variable variable, Integer time)
Initializes a new instance of theCLGaussian
class with a single variable at the specified time.CLGaussian(List<Variable> variables, Integer time)
Initializes a new instance of theCLGaussian
class with the specified variables at a particular time.CLGaussian(List<Variable> variables, Integer time, HeadTail headTail)
Initializes a new instance of theCLGaussian
class with the specified variables.CLGaussian(List<VariableContext> variableContexts)
Initializes a new instance of theCLGaussian
class with the variables specified in [variableContexts].CLGaussian(List<VariableContext> variableContexts, HeadTail headTail)
Initializes a new instance of theCLGaussian
class with the variables specified in [variableContexts].
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Distribution
copy()
Creates a copy of the distribution.Distribution
copy(Integer timeShift)
Creates a copy of the distribution, and shifts any times associated with variables by the specified amount.void
copyFrom(CLGaussian source)
Copies the values from the [source] distribution to this instance.CLGaussian
divide(CLGaussian subset)
Creates a new distribution by dividing this instance by the [subset].Distribution
divide(Distribution subset)
Creates a new distribution by dividing this instance by the [subset].double
getCovariance(int index, int sortedContinuousHeadA, int sortedContinuousHeadB)
Gets the covariance of the Gaussian distribution at the specified [index] in theTable
of discrete combinations.double
getCovariance(VariableContext continuousHeadA, VariableContext continuousHeadB, State... discrete)
Gets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).double
getCovariance(VariableContext continuousHeadA, VariableContext continuousHeadB, StateContext... discrete)
Gets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).double
getCovariance(VariableContext continuousHeadA, VariableContext continuousHeadB, TableIterator iterator)
Gets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).double
getCovariance(Variable continuousHeadA, Variable continuousHeadB)
Gets the covariance of a Gaussian distribution with no discrete variables between [continuousHeadA] and [continuousHeadB].double
getCovariance(Variable continuousHeadA, Variable continuousHeadB, State... discrete)
Gets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).double
getCovariance(Variable continuousHeadA, Variable continuousHeadB, StateContext... discrete)
Gets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).double
getCovariance(Variable continuousHeadA, Variable continuousHeadB, TableIterator iterator)
Gets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).double
getCovariance(Variable continuousHeadA, Integer timeA, Variable continuousHeadB, Integer timeB)
Gets the covariance of a Gaussian distribution with no discrete variables between [continuousHeadA] and [continuousHeadB].double
getCovariance(Variable continuousHeadA, Integer timeA, Variable continuousHeadB, Integer timeB, State... discrete)
Gets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).double
getCovariance(Variable continuousHeadA, Integer timeA, Variable continuousHeadB, Integer timeB, StateContext... discrete)
Gets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).double
getCovariance(Variable continuousHeadA, Integer timeA, Variable continuousHeadB, Integer timeB, TableIterator iterator)
Gets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).boolean
getLocked()
Locks or unlocks a distribution.double
getMean(int index, int sortedContinuousHead)
Gets the mean of the Gaussian distribution at the specified [index] in theTable
of discrete combinations.double
getMean(Variable continuousHead)
Gets the mean value of a Gaussian distribution with no discrete variables for the specified [continuousHead] variable.double
getMean(VariableContext continuousHead, State... discrete)
Gets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the [discrete] combination.double
getMean(VariableContext continuousHead, StateContext... discrete)
Gets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the [discrete] combination.double
getMean(VariableContext continuousHead, TableIterator iterator)
Gets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the discrete combination.double
getMean(Variable continuousHead, State... discrete)
Gets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the [discrete] combination.double
getMean(Variable continuousHead, StateContext... discrete)
Gets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the [discrete] combination.double
getMean(Variable continuousHead, TableIterator iterator)
Gets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the discrete combination.double
getMean(Variable continuousHead, Integer time)
Gets the mean value of a Gaussian distribution with no discrete variables for the specified [continuousHead] variable and time.double
getMean(Variable continuousHead, Integer time, State... discrete)
Gets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the [discrete] combination.double
getMean(Variable continuousHead, Integer time, StateContext... discrete)
Gets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the [discrete] combination.double
getMean(Variable continuousHead, Integer time, TableIterator iterator)
Gets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the discrete combination.Distribution
getOuter()
Returns the parent distribution, if this instance is aggregated by another distribution.Node
getOwner()
Gets the current owner, if assigned to a node.VariableContextCollection
getSortedContinuousHead()
Gets the collection of continuous head variables in the distribution, sorted by time (which may be null) and the order in which variables were created.VariableContextCollection
getSortedContinuousTail()
Gets the collection of continuous tail variables in the distribution, sorted by time (which may be null) and the order in which variables were created.VariableContextCollection
getSortedVariables()
Gets the collection of variables in the distribution, sorted by time (which may be null) and the order in which variables were created.Table
getTable()
Gets theTable
which specifies the distribution over any discrete variables.double
getVariance(int index, int sortedContinuousHead)
Gets the variance of the Gaussian distribution at the specified [index] in theTable
of discrete combinations.double
getVariance(Variable continuousHead)
Gets the variance of a Gaussian distribution with no discrete variables for the specified [continuousHead] variable.double
getVariance(VariableContext continuousHead, State... discrete)
Gets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).double
getVariance(VariableContext continuousHead, StateContext... discrete)
Gets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).double
getVariance(VariableContext continuousHead, TableIterator iterator)
Gets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).double
getVariance(Variable continuousHead, State... discrete)
Gets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).double
getVariance(Variable continuousHead, StateContext... discrete)
Gets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).double
getVariance(Variable continuousHead, TableIterator iterator)
Gets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).double
getVariance(Variable continuousHead, Integer time)
Gets the variance of a Gaussian distribution with no discrete variables for the specified [continuousHead] variable.double
getVariance(Variable continuousHead, Integer time, State... discrete)
Gets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).double
getVariance(Variable continuousHead, Integer time, StateContext... discrete)
Gets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).double
getVariance(Variable continuousHead, Integer time, TableIterator iterator)
Gets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).double
getWeight(int index, int sortedContinuousHead, int sortedContinuousTail)
Gets the weight (regression coefficient) of the Gaussian distribution at the specified [index] in theTable
of discrete combinations.double
getWeight(VariableContext continuousHead, VariableContext continuousTail, State... discrete)
Gets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).double
getWeight(VariableContext continuousHead, VariableContext continuousTail, StateContext... discrete)
Gets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).double
getWeight(VariableContext continuousHead, VariableContext continuousTail, TableIterator iterator)
Gets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).double
getWeight(Variable continuousHead, Variable continuousTail)
Gets the weight/regression coefficient of a Gaussian distribution with no discrete variables between the [continuousTail] and [continuousHead].double
getWeight(Variable continuousHead, Variable continuousTail, State... discrete)
Gets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).double
getWeight(Variable continuousHead, Variable continuousTail, StateContext... discrete)
Gets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).double
getWeight(Variable continuousHead, Variable continuousTail, TableIterator iterator)
Gets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).double
getWeight(Variable continuousHead, Integer timeHead, Variable continuousTail, Integer timeTail)
Gets the weight/regression coefficient of a Gaussian distribution with no discrete variables between the [continuousTail] and [continuousHead].double
getWeight(Variable continuousHead, Integer timeHead, Variable continuousTail, Integer timeTail, State... discrete)
Gets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).double
getWeight(Variable continuousHead, Integer timeHead, Variable continuousTail, Integer timeTail, StateContext... discrete)
Gets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).double
getWeight(Variable continuousHead, Integer timeHead, Variable continuousTail, Integer timeTail, TableIterator iterator)
Gets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).CLGaussian
instantiate(Variable variable, double value)
Calculates the distribution which results from instantiating a particular variable.CLGaussian
instantiate(Variable variable, double value, Integer time)
Calculates the distribution which results from instantiating a particular variable at a specified time.Distribution
instantiate(Double[] values)
Calculates the distribution which results from instantiating a number of variables.CLGaussian
instantiateDiscrete(Integer[] discreteValues)
Instantiates discrete variables.Table
instantiateHead(double[] headValues, double[] logPdf)
Instantiates all continuous head variable contexts.CLGaussian
instantiateHead(Variable variable, double value, Integer time)
Calculates the distribution which results from instantiating a particular continuous head variable at a specified time.CLGaussian
instantiateHead(Variable variable, double value, Integer time, double[] logPdf)
Calculates the distribution which results from instantiating a particular continuous head variable at a specified time.Distribution
instantiateHeads(Double[] headValues, double[] logPdf)
Instantiates continuous head variable contexts.CLGaussian
instantiateTails(Double[] tailValues)
Calculates the distribution which results from instantiating continuous tail variables.boolean
isReadOnly()
Indicates whether the distribution is read only.void
marginalize(CLGaussian superset)
Marginalizes (sums/integrates) the [superset] into this instance.void
marginalize(Distribution superset)
Marginalizes (integrates) the [superset] into this instance.void
marginalize(Distribution superset, PropagationMethod propagation)
Marginalizes (integrates) the [superset] into this instance.void
marginalizeTo(Table table)
Marginalizes (sums/integrates) out all continuous variables from this instance into the specified table.void
marginalizeTo(Table table, PropagationMethod propagation)
Marginalizes (sums/integrates) out all continuous variables from this instance into the specified table.CLGaussian
multiply(CLGaussian gaussian)
Multiplies this instance by anotherCLGaussian
distribution.Distribution
multiply(Distribution distribution)
Multiplies this instance by another distribution.void
reset()
Resets all mean, covariance and weight entries to zero.void
setCovariance(int index, int sortedContinuousHeadA, int sortedContinuousHeadB, double value)
Sets the covariance value of the Gaussian distribution at the specified [index] in theTable
of discrete combinations.void
setCovariance(VariableContext continuousHeadA, VariableContext continuousHeadB, double value)
Sets the covariance of a Gaussian distribution with no discrete variables between [continuousHeadA] and [continuousHeadB].void
setCovariance(VariableContext continuousHeadA, VariableContext continuousHeadB, double value, State... discrete)
Sets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).void
setCovariance(VariableContext continuousHeadA, VariableContext continuousHeadB, double value, StateContext... discrete)
Sets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).void
setCovariance(VariableContext continuousHeadA, VariableContext continuousHeadB, double value, TableIterator iterator)
Sets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).void
setCovariance(Variable continuousHeadA, Variable continuousHeadB, double value)
Sets the covariance of a Gaussian distribution with no discrete variables between [continuousHeadA] and [continuousHeadB]void
setCovariance(Variable continuousHeadA, Variable continuousHeadB, double value, State... discrete)
Sets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).void
setCovariance(Variable continuousHeadA, Variable continuousHeadB, double value, StateContext... discrete)
Sets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).void
setCovariance(Variable continuousHeadA, Variable continuousHeadB, double value, TableIterator iterator)
Sets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).void
setCovariance(Variable continuousHeadA, Integer timeA, Variable continuousHeadB, Integer timeB, double value)
Sets the covariance of a Gaussian distribution with no discrete variables between [continuousHeadA] and [continuousHeadB]void
setCovariance(Variable continuousHeadA, Integer timeA, Variable continuousHeadB, Integer timeB, double value, State... discrete)
Sets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).void
setCovariance(Variable continuousHeadA, Integer timeA, Variable continuousHeadB, Integer timeB, double value, StateContext... discrete)
Sets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).void
setCovariance(Variable continuousHeadA, Integer timeA, Variable continuousHeadB, Integer timeB, double value, TableIterator iterator)
Sets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).void
setLocked(boolean value)
Locks or unlocks a distribution.void
setMean(int index, int sortedContinuousHead, double value)
Sets the mean value of the Gaussian distribution at the specified [index] in theTable
of discrete combinations.void
setMean(VariableContext continuousHead, double value, State... discrete)
Sets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the [discrete] combination.void
setMean(VariableContext continuousHead, double value, StateContext... discrete)
Sets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the [discrete] combination.void
setMean(VariableContext continuousHead, double value, TableIterator iterator)
Sets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the discrete combination.void
setMean(Variable continuousHead, double value)
Sets the mean value of a Gaussian distribution with no discrete variables for the specified [continuousHead] variable.void
setMean(Variable continuousHead, double value, State... discrete)
Sets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the [discrete] combination.void
setMean(Variable continuousHead, double value, StateContext... discrete)
Sets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the [discrete] combination.void
setMean(Variable continuousHead, double value, TableIterator iterator)
Sets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the discrete combination.void
setMean(Variable continuousHead, Integer time, double value)
Sets the mean value of a Gaussian distribution with no discrete variables for the specified [continuousHead] variable.void
setMean(Variable continuousHead, Integer time, double value, State... discrete)
Sets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the [discrete] combination.void
setMean(Variable continuousHead, Integer time, double value, StateContext... discrete)
Sets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the [discrete] combination.void
setMean(Variable continuousHead, Integer time, double value, TableIterator iterator)
Sets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the discrete combination.void
setVariance(int index, int sortedContinuousHead, double value)
Sets the variance value of the Gaussian distribution at the specified [index] in theTable
of discrete combinations.void
setVariance(VariableContext continuousHead, double value, State... discrete)
Sets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).void
setVariance(VariableContext continuousHead, double value, StateContext... discrete)
Sets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).void
setVariance(VariableContext continuousHead, double value, TableIterator iterator)
Sets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).void
setVariance(Variable continuousHead, double value)
Sets the variance of a Gaussian distribution with no discrete variables for the specified [continuousHead] variable.void
setVariance(Variable continuousHead, double value, State... discrete)
Sets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).void
setVariance(Variable continuousHead, double value, StateContext... discrete)
Sets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).void
setVariance(Variable continuousHead, double value, TableIterator iterator)
Sets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).void
setVariance(Variable continuousHead, Integer time, double value)
Sets the variance of a Gaussian distribution with no discrete variables for the specified [continuousHead] variable.void
setVariance(Variable continuousHead, Integer time, double value, State... discrete)
Sets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).void
setVariance(Variable continuousHead, Integer time, double value, StateContext... discrete)
Sets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).void
setVariance(Variable continuousHead, Integer time, double value, TableIterator iterator)
Sets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).void
setWeight(int index, int sortedContinuousHead, int sortedContinuousTail, double value)
Sets the weight/regression coefficient of the Gaussian distribution at the specified [index] in theTable
of discrete combinations.void
setWeight(VariableContext continuousHead, VariableContext continuousTail, double value, State... discrete)
Sets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).void
setWeight(VariableContext continuousHead, VariableContext continuousTail, double value, StateContext... discrete)
Sets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).void
setWeight(VariableContext continuousHead, VariableContext continuousTail, double value, TableIterator iterator)
Sets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).void
setWeight(Variable continuousHead, Variable continuousTail, double value)
Sets the weight/regression coefficient of a Gaussian distribution with no discrete variables between the [continuousTail] and [continuousHead].void
setWeight(Variable continuousHead, Variable continuousTail, double value, State... discrete)
Sets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).void
setWeight(Variable continuousHead, Variable continuousTail, double value, StateContext... discrete)
Sets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).void
setWeight(Variable continuousHead, Variable continuousTail, double value, TableIterator iterator)
Sets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).void
setWeight(Variable continuousHead, Integer timeHead, Variable continuousTail, Integer timeTail, double value)
Sets the weight/regression coefficient of a Gaussian distribution with no discrete variables between the [continuousTail] and [continuousHead].void
setWeight(Variable continuousHead, Integer timeHead, Variable continuousTail, Integer timeTail, double value, State... discrete)
Sets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).void
setWeight(Variable continuousHead, Integer timeHead, Variable continuousTail, Integer timeTail, double value, StateContext... discrete)
Sets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).void
setWeight(Variable continuousHead, Integer timeHead, Variable continuousTail, Integer timeTail, double value, TableIterator iterator)
Sets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).void
timeShift(int units)
Shifts any times associated with the distribution variables by the specified number of time units.String
toString()
-
-
-
Constructor Detail
-
CLGaussian
public CLGaussian(List<VariableContext> variableContexts)
Initializes a new instance of theCLGaussian
class with the variables specified in [variableContexts]. Each variable, if it belongs to a temporal node can have an associated time. A variable is also marked as either head or tail. Head variables are those on the left, and tail variables are those on the right in the expression P(A|B).- Parameters:
variableContexts
- The variable contexts containing the distribution variables.- Throws:
NullPointerException
- Raised if [variableContexts] is null.
-
CLGaussian
public CLGaussian(List<VariableContext> variableContexts, HeadTail headTail)
Initializes a new instance of theCLGaussian
class with the variables specified in [variableContexts]. Each variable, if it belongs to a temporal node can have an associated time. A variable is also marked as either head or tail. Head variables are those on the left, and tail variables are those on the right in the expression P(A|B).- Parameters:
variableContexts
- The variable contexts containing the distribution variables.headTail
- Overrides the Head or Tail value found in eachVariableContext
.- Throws:
NullPointerException
- Raised if [variableContexts] is null.
-
CLGaussian
public CLGaussian(VariableContext[] variableContexts)
Initializes a new instance of theCLGaussian
class with [count] variables specified in [variableContexts]. Each variable, if it belongs to a temporal node can have an associated time. A variable is also marked as either head or tail. Head variables are those on the left, and tail variables are those on the right in the expression P(A|B).- Parameters:
variableContexts
- The variable contexts containing the distribution variables.- Throws:
NullPointerException
- Raised if [variableContexts] is null.
-
CLGaussian
public CLGaussian(VariableContext[] variableContexts, int count)
Initializes a new instance of theCLGaussian
class with [count] variables specified in [variableContexts]. Each variable, if it belongs to a temporal node can have an associated time. A variable is also marked as either head or tail. Head variables are those on the left, and tail variables are those on the right in the expression P(A|B).- Parameters:
variableContexts
- The variable contexts containing the distribution variables.count
- The number of items to include from [variableContexts].- Throws:
NullPointerException
- Raised if [variableContexts] is null.
-
CLGaussian
public CLGaussian(VariableContext[] variableContexts, int count, HeadTail headTail)
Initializes a new instance of theCLGaussian
class with [count] variables specified in [variableContexts]. Each variable, if it belongs to a temporal node can have an associated time. A variable is also marked as either head or tail. Head variables are those on the left, and tail variables are those on the right in the expression P(A|B).- Parameters:
variableContexts
- The variable contexts containing the distribution variables.count
- The number of items to include from [variableContexts].headTail
- Overrides the Head or Tail value found in eachVariableContext
.- Throws:
NullPointerException
- Raised if [variableContexts] is null.
-
CLGaussian
public CLGaussian(Node node, Integer time)
Initializes a new instance of theCLGaussian
class with the variables of a single node at the specified time. Variables are assumed to be head variables.- Parameters:
node
- The node whose variables will belong to the new distribution.time
- The time for any temporal nodes/variables.- Throws:
NullPointerException
- Raised if [node] is null.
-
CLGaussian
public CLGaussian(List<Variable> variables, Integer time)
Initializes a new instance of theCLGaussian
class with the specified variables at a particular time. Variables are assumed to be head variables.- Parameters:
variables
- The variables for the new distribution.time
- The time for any temporal nodes/variables.- Throws:
NullPointerException
- Raised if [variables] is null.IllegalArgumentException
- Raised if an element of [variables] is null or a variable does not belong to a network.
-
CLGaussian
public CLGaussian(List<Variable> variables, Integer time, HeadTail headTail)
Initializes a new instance of theCLGaussian
class with the specified variables.- Parameters:
variables
- The variables for the new distribution.time
- The time for any temporal nodes/variables.headTail
- Specifies whether the variables should be marked as Head or Tail.- Throws:
NullPointerException
- Raised if [variables] is null.IllegalArgumentException
- Raised if an element of [variables] is null or a variable does not belong to a network.
-
CLGaussian
public CLGaussian(Variable[] variables)
Initializes a new instance of theCLGaussian
class with the specified variables. Variables are assumed to be head variables.- Parameters:
variables
- The variables for the new distribution.
-
CLGaussian
public CLGaussian(Node node)
Initializes a new instance of theCLGaussian
class with the variables of a single node. Variables are assumed to be head variables.- Parameters:
node
- The node whose variables will belong to the new distribution.
-
CLGaussian
public CLGaussian(Variable variable)
Initializes a new instance of theCLGaussian
class with a single variable. The variable is assumed to be a head variable.- Parameters:
variable
- The variable that will belong to the new distribution.
-
CLGaussian
public CLGaussian(VariableContext variableContext)
Initializes a new instance of theCLGaussian
class from a singleVariableContext
.- Parameters:
variableContext
- The variable context.- Throws:
NullPointerException
- Raised when [variableContext] is null.
-
CLGaussian
public CLGaussian(Variable variable, Integer time)
Initializes a new instance of theCLGaussian
class with a single variable at the specified time. The variable is assumed to be a head variable.- Parameters:
variable
- The variable that will belong to the new distribution.time
- The time associated with the variable.- Throws:
NullPointerException
- Raised if [variable] is null.
-
CLGaussian
public CLGaussian(CLGaussian source)
Initializes a new instance of theCLGaussian
class, copying the source distribution.- Parameters:
source
- The distribution to copy.
-
CLGaussian
public CLGaussian(CLGaussian source, Integer timeShift)
Initializes a new instance of theCLGaussian
class, copying the source distribution but shifting any times by the specified number of units.- Parameters:
source
- The distribution to copy.timeShift
- The number of units to adjust any times associated with variables.
-
-
Method Detail
-
reset
public void reset()
Resets all mean, covariance and weight entries to zero.
-
timeShift
public void timeShift(int units)
Shifts any times associated with the distribution variables by the specified number of time units.- Specified by:
timeShift
in interfaceDistribution
- Parameters:
units
- The number of time units to shift. Can be negative if required.
-
getLocked
public boolean getLocked()
Locks or unlocks a distribution. The distribution cannot be modified if eitherDistribution.getLocked()
istrue
orDistribution.getOwner()
is not null.- Specified by:
getLocked
in interfaceDistribution
- Returns:
true
if locked; otherwise,false
.
-
setLocked
public void setLocked(boolean value)
Locks or unlocks a distribution. The distribution cannot be modified if eitherDistribution.getLocked()
istrue
orDistribution.getOwner()
is not null.- Specified by:
setLocked
in interfaceDistribution
- Parameters:
value
-true
if locked; otherwise,false
.
-
isReadOnly
public boolean isReadOnly()
Indicates whether the distribution is read only. A distribution is read only if it is locked or is assigned to aNode
.- Specified by:
isReadOnly
in interfaceDistribution
- Returns:
true
if read only; otherwise,false
.
-
copy
public Distribution copy()
Creates a copy of the distribution. The new distribution will not have an owner.- Specified by:
copy
in interfaceDistribution
- Returns:
- A copy of this instance.
-
copy
public Distribution copy(Integer timeShift)
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.- Specified by:
copy
in interfaceDistribution
- Parameters:
timeShift
- The amount to shift any times present in the distribution. Can be negative.- Returns:
- A copy of this instance, with shifted times.
-
getMean
public double getMean(int index, int sortedContinuousHead)
Gets the mean of the Gaussian distribution at the specified [index] in theTable
of discrete combinations.- Parameters:
index
- The index into the discrete table of combinations. If no discrete variables are present in the distribution, index will always be 0.sortedContinuousHead
- The position of the required continuous head variable.- Returns:
- The mean value.
-
getMean
public double getMean(Variable continuousHead, State... discrete)
Gets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the [discrete] combination.- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H) or P(H|T).discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).- Returns:
- The mean value.
-
getMean
public double getMean(Variable continuousHead)
Gets the mean value of a Gaussian distribution with no discrete variables for the specified [continuousHead] variable.- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H) or P(H|T).- Returns:
- The mean value.
-
getMean
public double getMean(Variable continuousHead, Integer time)
Gets the mean value of a Gaussian distribution with no discrete variables for the specified [continuousHead] variable and time.- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H) or P(H|T).time
- The time of the continuous head variable, or null if not a temporal variable.- Returns:
- The mean value.
-
getMean
public double getMean(Variable continuousHead, Integer time, State... discrete)
Gets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the [discrete] combination.- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H) or P(H|T).time
- The time of the continuous head variable, or null if not a temporal variable.discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).- Returns:
- The mean value.
-
getMean
public double getMean(VariableContext continuousHead, State... discrete)
Gets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the [discrete] combination.- Parameters:
continuousHead
- A continuous head variable and time (if any) from H in the expression P(H) or P(H|T).discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).- Returns:
- The mean value.
-
getMean
public double getMean(Variable continuousHead, StateContext... discrete)
Gets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the [discrete] combination.- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H) or P(H|T).discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).- Returns:
- The mean value.
-
getMean
public double getMean(Variable continuousHead, Integer time, StateContext... discrete)
Gets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the [discrete] combination.- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H) or P(H|T).time
- The time of the continuous head variable, or null if not a temporal variable.discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).- Returns:
- The mean value.
-
getMean
public double getMean(VariableContext continuousHead, StateContext... discrete)
Gets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the [discrete] combination.- Parameters:
continuousHead
- A continuous head variable and time (if any) from H in the expression P(H) or P(H|T).discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).- Returns:
- The mean value.
-
getMean
public double getMean(Variable continuousHead, TableIterator iterator)
Gets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the discrete combination.- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H) or P(H|T).iterator
- The discrete combination (mixture) identified by the position of the iterator.- Returns:
- The mean value.
-
getMean
public double getMean(Variable continuousHead, Integer time, TableIterator iterator)
Gets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the discrete combination.- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H) or P(H|T).time
- The time of the continuous head variable, or null if not a temporal variable.iterator
- The discrete combination (mixture) identified by the position of the iterator.- Returns:
- The mean value.
-
getMean
public double getMean(VariableContext continuousHead, TableIterator iterator)
Gets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the discrete combination.- Parameters:
continuousHead
- A continuous head variable and time (if any) from H in the expression P(H) or P(H|T).iterator
- The discrete combination (mixture) identified by the position of the iterator.- Returns:
- The mean value.
-
getVariance
public double getVariance(int index, int sortedContinuousHead)
Gets the variance of the Gaussian distribution at the specified [index] in theTable
of discrete combinations.- Parameters:
index
- The index into the discrete table of combinations. If no discrete variables are present in the distribution, index will always be 0.sortedContinuousHead
- The position of the required continuous head variable.- Returns:
- The variance.
-
getVariance
public double getVariance(Variable continuousHead, State... discrete)
Gets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H) or P(H|T).discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).- Returns:
- The variance value.
-
getVariance
public double getVariance(Variable continuousHead)
Gets the variance of a Gaussian distribution with no discrete variables for the specified [continuousHead] variable.- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H) or P(H|T).- Returns:
- The variance value.
-
getVariance
public double getVariance(Variable continuousHead, Integer time)
Gets the variance of a Gaussian distribution with no discrete variables for the specified [continuousHead] variable.- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H) or P(H|T).time
- The time of the continuous head variable, or null if not a temporal variable.- Returns:
- The variance value.
-
getVariance
public double getVariance(Variable continuousHead, Integer time, State... discrete)
Gets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H) or P(H|T).time
- The time of the continuous head variable, or null if not a temporal variable.discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).- Returns:
- The variance value.
-
getVariance
public double getVariance(VariableContext continuousHead, State... discrete)
Gets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable and time (if any) from H in the expression P(H) or P(H|T).discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).- Returns:
- The variance value.
-
getVariance
public double getVariance(Variable continuousHead, StateContext... discrete)
Gets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H) or P(H|T).discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).- Returns:
- The variance value.
-
getVariance
public double getVariance(Variable continuousHead, Integer time, StateContext... discrete)
Gets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H) or P(H|T).time
- The time of the continuous head variable, or null if not a temporal variable.discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).- Returns:
- The variance value.
-
getVariance
public double getVariance(VariableContext continuousHead, StateContext... discrete)
Gets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable and time (if any) from H in the expression P(H) or P(H|T).discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).- Returns:
- The variance value.
-
getVariance
public double getVariance(Variable continuousHead, TableIterator iterator)
Gets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H) or P(H|T).iterator
- The discrete combination (mixture) identified by the position of the iterator.- Returns:
- The variance value.
-
getVariance
public double getVariance(Variable continuousHead, Integer time, TableIterator iterator)
Gets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H) or P(H|T).time
- The time of the continuous head variable, or null if not a temporal variable.iterator
- The discrete combination (mixture) identified by the position of the iterator.- Returns:
- The variance value.
-
getVariance
public double getVariance(VariableContext continuousHead, TableIterator iterator)
Gets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable and time (if any) from H in the expression P(H) or P(H|T).iterator
- The discrete combination (mixture) identified by the position of the iterator.- Returns:
- The variance value.
-
getCovariance
public double getCovariance(int index, int sortedContinuousHeadA, int sortedContinuousHeadB)
Gets the covariance of the Gaussian distribution at the specified [index] in theTable
of discrete combinations.- Parameters:
index
- The index into the discrete table of combinations. If no discrete variables are present in the distribution, index will always be 0.sortedContinuousHeadA
- The position of the first continuous head variable.sortedContinuousHeadB
- The position of the second continuous head variable.- Returns:
- The covariance entry.
-
getCovariance
public double getCovariance(Variable continuousHeadA, Variable continuousHeadB, State... discrete)
Gets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).- Parameters:
continuousHeadA
- A continuous head variable from H in the expression P(H) or P(H|T).continuousHeadB
- A second continuous head variable from H in the expression P(H) or P(H|T).discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).- Returns:
- The covariance value.
-
getCovariance
public double getCovariance(Variable continuousHeadA, Variable continuousHeadB)
Gets the covariance of a Gaussian distribution with no discrete variables between [continuousHeadA] and [continuousHeadB].- Parameters:
continuousHeadA
- A continuous head variable from H in the expression P(H) or P(H|T).continuousHeadB
- A second continuous head variable from H in the expression P(H) or P(H|T).- Returns:
- The covariance value.
-
getCovariance
public double getCovariance(Variable continuousHeadA, Integer timeA, Variable continuousHeadB, Integer timeB)
Gets the covariance of a Gaussian distribution with no discrete variables between [continuousHeadA] and [continuousHeadB].- Parameters:
continuousHeadA
- A continuous head variable from H in the expression P(H) or P(H|T).timeA
- The time of the first continuous head variable, or null if not a temporal variable.continuousHeadB
- A second continuous head variable from H in the expression P(H) or P(H|T).timeB
- The time of the second continuous head variable, or null if not a temporal variable.- Returns:
- The covariance value.
-
getCovariance
public double getCovariance(Variable continuousHeadA, Variable continuousHeadB, StateContext... discrete)
Gets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).- Parameters:
continuousHeadA
- A continuous head variable from H in the expression P(H) or P(H|T).continuousHeadB
- A second continuous head variable from H in the expression P(H) or P(H|T).discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).- Returns:
- The covariance value.
-
getCovariance
public double getCovariance(Variable continuousHeadA, Integer timeA, Variable continuousHeadB, Integer timeB, State... discrete)
Gets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).- Parameters:
continuousHeadA
- A continuous head variable from H in the expression P(H) or P(H|T).timeA
- The time of the first continuous head variable, or null if not a temporal variable.continuousHeadB
- A second continuous head variable from H in the expression P(H) or P(H|T).timeB
- The time of the second continuous head variable, or null if not a temporal variable.discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).- Returns:
- The covariance value.
-
getCovariance
public double getCovariance(Variable continuousHeadA, Integer timeA, Variable continuousHeadB, Integer timeB, StateContext... discrete)
Gets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).- Parameters:
continuousHeadA
- A continuous head variable from H in the expression P(H) or P(H|T).timeA
- The time of the first continuous head variable, or null if not a temporal variable.continuousHeadB
- A second continuous head variable from H in the expression P(H) or P(H|T).timeB
- The time of the second continuous head variable, or null if not a temporal variable.discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).- Returns:
- The covariance value.
-
getCovariance
public double getCovariance(VariableContext continuousHeadA, VariableContext continuousHeadB, State... discrete)
Gets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).- Parameters:
continuousHeadA
- A continuous head variable and time (if any) from H in the expression P(H) or P(H|T).continuousHeadB
- A second continuous head variable and time (if any) from H in the expression P(H) or P(H|T).discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).- Returns:
- The covariance value.
-
getCovariance
public double getCovariance(VariableContext continuousHeadA, VariableContext continuousHeadB, StateContext... discrete)
Gets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).- Parameters:
continuousHeadA
- A continuous head variable and time (if any) from H in the expression P(H) or P(H|T).continuousHeadB
- A second continuous head variable and time (if any) from H in the expression P(H) or P(H|T).discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).- Returns:
- The covariance value.
-
getCovariance
public double getCovariance(Variable continuousHeadA, Variable continuousHeadB, TableIterator iterator)
Gets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).- Parameters:
continuousHeadA
- A continuous head variable from H in the expression P(H) or P(H|T).continuousHeadB
- A second continuous head variable from H in the expression P(H) or P(H|T).iterator
- The discrete combination (mixture) identified by the position of the iterator.- Returns:
- The covariance value.
-
getCovariance
public double getCovariance(Variable continuousHeadA, Integer timeA, Variable continuousHeadB, Integer timeB, TableIterator iterator)
Gets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).- Parameters:
continuousHeadA
- A continuous head variable from H in the expression P(H) or P(H|T).timeA
- The time of the first continuous head variable, or null if not a temporal variable.continuousHeadB
- A second continuous head variable from H in the expression P(H) or P(H|T).timeB
- The time of the second continuous head variable, or null if not a temporal variable.iterator
- The discrete combination (mixture) identified by the position of the iterator.- Returns:
- The covariance value.
-
getCovariance
public double getCovariance(VariableContext continuousHeadA, VariableContext continuousHeadB, TableIterator iterator)
Gets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).- Parameters:
continuousHeadA
- A continuous head variable and time (if any) from H in the expression P(H) or P(H|T).continuousHeadB
- A second continuous head variable and time (if any) from H in the expression P(H) or P(H|T).iterator
- The discrete combination (mixture) identified by the position of the iterator.- Returns:
- The covariance value.
-
getWeight
public double getWeight(int index, int sortedContinuousHead, int sortedContinuousTail)
Gets the weight (regression coefficient) of the Gaussian distribution at the specified [index] in theTable
of discrete combinations.- Parameters:
index
- The index into the discrete table of combinations. If no discrete variables are present in the distribution, index will always be 0.sortedContinuousHead
- The position of the required continuous head variable.sortedContinuousTail
- The position of the required continuous tail variable.- Returns:
- The weight / regression coefficient.
-
getWeight
public double getWeight(Variable continuousHead, Variable continuousTail, State... discrete)
Gets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H|T).continuousTail
- A continuous tail variable from T in the expression P(H|T).discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).- Returns:
- The weight/regression coefficient.
-
getWeight
public double getWeight(Variable continuousHead, Integer timeHead, Variable continuousTail, Integer timeTail, State... discrete)
Gets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H|T).timeHead
- The time of the continuous head variable, or null if not a temporal variable.continuousTail
- A continuous tail variable from T in the expression P(H|T).timeTail
- The time of the continuous tail variable, or null if not a temporal variable.discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).- Returns:
- The weight/regression coefficient.
-
getWeight
public double getWeight(VariableContext continuousHead, VariableContext continuousTail, State... discrete)
Gets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable and time (if any) from H in the expression P(H|T).continuousTail
- A continuous tail variable and time (if any) from T in the expression P(H|T).discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).- Returns:
- The weight/regression coefficient.
-
getWeight
public double getWeight(Variable continuousHead, Variable continuousTail, StateContext... discrete)
Gets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H|T).continuousTail
- A continuous tail variable from T in the expression P(H|T).discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).- Returns:
- The weight/regression coefficient.
-
getWeight
public double getWeight(Variable continuousHead, Variable continuousTail)
Gets the weight/regression coefficient of a Gaussian distribution with no discrete variables between the [continuousTail] and [continuousHead].- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H|T).continuousTail
- A continuous tail variable from T in the expression P(H|T).- Returns:
- The weight/regression coefficient.
-
getWeight
public double getWeight(Variable continuousHead, Integer timeHead, Variable continuousTail, Integer timeTail, StateContext... discrete)
Gets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H|T).timeHead
- The time of the continuous head variable, or null if not a temporal variable.continuousTail
- A continuous tail variable from T in the expression P(H|T).timeTail
- The time of the continuous tail variable, or null if not a temporal variable.discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).- Returns:
- The weight/regression coefficient.
-
getWeight
public double getWeight(Variable continuousHead, Integer timeHead, Variable continuousTail, Integer timeTail)
Gets the weight/regression coefficient of a Gaussian distribution with no discrete variables between the [continuousTail] and [continuousHead].- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H|T).timeHead
- The time of the continuous head variable, or null if not a temporal variable.continuousTail
- A continuous tail variable from T in the expression P(H|T).timeTail
- The time of the continuous tail variable, or null if not a temporal variable.- Returns:
- The weight/regression coefficient.
-
getWeight
public double getWeight(VariableContext continuousHead, VariableContext continuousTail, StateContext... discrete)
Gets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable and time (if any) from H in the expression P(H|T).continuousTail
- A continuous tail variable and time (if any) from T in the expression P(H|T).discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).- Returns:
- The weight/regression coefficient.
-
getWeight
public double getWeight(Variable continuousHead, Variable continuousTail, TableIterator iterator)
Gets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H|T).continuousTail
- A continuous tail variable from T in the expression P(H|T).iterator
- The discrete combination (mixture) identified by the position of the iterator.- Returns:
- The weight/regression coefficient.
-
getWeight
public double getWeight(Variable continuousHead, Integer timeHead, Variable continuousTail, Integer timeTail, TableIterator iterator)
Gets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H|T).timeHead
- The time of the continuous head variable, or null if not a temporal variable.continuousTail
- A continuous tail variable from T in the expression P(H|T).timeTail
- The time of the continuous tail variable, or null if not a temporal variable.iterator
- The discrete combination (mixture) identified by the position of the iterator.- Returns:
- The weight/regression coefficient.
-
getWeight
public double getWeight(VariableContext continuousHead, VariableContext continuousTail, TableIterator iterator)
Gets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable and time (if any) from H in the expression P(H|T).continuousTail
- A continuous tail variable from T in the expression P(H|T).iterator
- The discrete combination (mixture) identified by the position of the iterator.- Returns:
- The weight/regression coefficient.
-
setMean
public void setMean(int index, int sortedContinuousHead, double value)
Sets the mean value of the Gaussian distribution at the specified [index] in theTable
of discrete combinations.- Parameters:
index
- The index into the discrete table of combinations. If no discrete variables are present in the distribution, index will always be 0.sortedContinuousHead
- The position of the required continuous head variable.value
- The mean value.
-
setMean
public void setMean(Variable continuousHead, double value, State... discrete)
Sets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the [discrete] combination.- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H) or P(H|T).value
- The mean value.discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).
-
setMean
public void setMean(Variable continuousHead, Integer time, double value, State... discrete)
Sets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the [discrete] combination.- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H) or P(H|T).time
- The time of the continuous head variable, or null if not a temporal variable.value
- The mean value.discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).
-
setMean
public void setMean(VariableContext continuousHead, double value, State... discrete)
Sets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the [discrete] combination.- Parameters:
continuousHead
- A continuous head variable and time (if any) from H in the expression P(H) or P(H|T).value
- The mean value.discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).
-
setMean
public void setMean(Variable continuousHead, double value, StateContext... discrete)
Sets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the [discrete] combination.- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H) or P(H|T).value
- The mean value.discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).
-
setMean
public void setMean(Variable continuousHead, double value)
Sets the mean value of a Gaussian distribution with no discrete variables for the specified [continuousHead] variable.- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H) or P(H|T).value
- The mean value.
-
setMean
public void setMean(Variable continuousHead, Integer time, double value)
Sets the mean value of a Gaussian distribution with no discrete variables for the specified [continuousHead] variable.- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H) or P(H|T).time
- The time of the continuous head variable, or null if not a temporal variable.value
- The mean value.
-
setMean
public void setMean(Variable continuousHead, Integer time, double value, StateContext... discrete)
Sets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the [discrete] combination.- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H) or P(H|T).time
- The time of the continuous head variable, or null if not a temporal variable.value
- The mean value.discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).
-
setMean
public void setMean(VariableContext continuousHead, double value, StateContext... discrete)
Sets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the [discrete] combination.- Parameters:
continuousHead
- A continuous head variable and time (if any) from H in the expression P(H) or P(H|T).value
- The mean value.discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).
-
setMean
public void setMean(Variable continuousHead, double value, TableIterator iterator)
Sets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the discrete combination.- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H) or P(H|T).value
- The mean value.iterator
- The discrete combination (mixture) identified by the position of the iterator.
-
setMean
public void setMean(Variable continuousHead, Integer time, double value, TableIterator iterator)
Sets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the discrete combination.- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H) or P(H|T).time
- The time of the continuous head variable, or null if not a temporal variable.value
- The mean value.iterator
- The discrete combination (mixture) identified by the position of the iterator.
-
setMean
public void setMean(VariableContext continuousHead, double value, TableIterator iterator)
Sets the mean value of the Gaussian distribution for the specified [continuousHead] variable for the discrete combination.- Parameters:
continuousHead
- A continuous head variable and time (if any) from H in the expression P(H) or P(H|T).value
- The mean value.iterator
- The discrete combination (mixture) identified by the position of the iterator.
-
setCovariance
public void setCovariance(int index, int sortedContinuousHeadA, int sortedContinuousHeadB, double value)
Sets the covariance value of the Gaussian distribution at the specified [index] in theTable
of discrete combinations.- Parameters:
index
- The index into the discrete table of combinations. If no discrete variables are present in the distribution, index will always be 0.sortedContinuousHeadA
- The position of the first continuous head variable.sortedContinuousHeadB
- The position of the second continuous head variable.value
- The covariance value to copy.
-
setCovariance
public void setCovariance(Variable continuousHeadA, Variable continuousHeadB, double value, State... discrete)
Sets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).- Parameters:
continuousHeadA
- A continuous head variable from H in the expression P(H) or P(H|T).continuousHeadB
- A second continuous head variable from H in the expression P(H) or P(H|T).value
- The covariance value.discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).
-
setCovariance
public void setCovariance(Variable continuousHeadA, Integer timeA, Variable continuousHeadB, Integer timeB, double value, State... discrete)
Sets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).- Parameters:
continuousHeadA
- A continuous head variable from H in the expression P(H) or P(H|T).timeA
- The time of the first continuous head variable, or null if not a temporal variable.continuousHeadB
- A second continuous head variable from H in the expression P(H) or P(H|T).timeB
- The time of the second continuous head variable, or null if not a temporal variable.value
- The covariance value.discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).
-
setCovariance
public void setCovariance(VariableContext continuousHeadA, VariableContext continuousHeadB, double value, State... discrete)
Sets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).- Parameters:
continuousHeadA
- A continuous head variable and time (if any) from H in the expression P(H) or P(H|T).continuousHeadB
- A second continuous head variable and time (if any) from H in the expression P(H) or P(H|T).value
- The covariance value.discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).
-
setCovariance
public void setCovariance(Variable continuousHeadA, Variable continuousHeadB, double value, StateContext... discrete)
Sets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).- Parameters:
continuousHeadA
- A continuous head variable from H in the expression P(H) or P(H|T).continuousHeadB
- A second continuous head variable from H in the expression P(H) or P(H|T).value
- The covariance value.discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).
-
setCovariance
public void setCovariance(Variable continuousHeadA, Integer timeA, Variable continuousHeadB, Integer timeB, double value, StateContext... discrete)
Sets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).- Parameters:
continuousHeadA
- A continuous head variable from H in the expression P(H) or P(H|T).timeA
- The time of the first continuous head variable, or null if not a temporal variable.continuousHeadB
- A second continuous head variable from H in the expression P(H) or P(H|T).timeB
- The time of the second continuous head variable, or null if not a temporal variable.value
- The covariance value.discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).
-
setCovariance
public void setCovariance(Variable continuousHeadA, Integer timeA, Variable continuousHeadB, Integer timeB, double value)
Sets the covariance of a Gaussian distribution with no discrete variables between [continuousHeadA] and [continuousHeadB]- Parameters:
continuousHeadA
- A continuous head variable from H in the expression P(H) or P(H|T).timeA
- The time of the first continuous head variable, or null if not a temporal variable.continuousHeadB
- A second continuous head variable from H in the expression P(H) or P(H|T).timeB
- The time of the second continuous head variable, or null if not a temporal variable.value
- The covariance value.
-
setCovariance
public void setCovariance(Variable continuousHeadA, Variable continuousHeadB, double value)
Sets the covariance of a Gaussian distribution with no discrete variables between [continuousHeadA] and [continuousHeadB]- Parameters:
continuousHeadA
- A continuous head variable from H in the expression P(H) or P(H|T).continuousHeadB
- A second continuous head variable from H in the expression P(H) or P(H|T).value
- The covariance value.
-
setCovariance
public void setCovariance(VariableContext continuousHeadA, VariableContext continuousHeadB, double value, StateContext... discrete)
Sets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).- Parameters:
continuousHeadA
- A continuous head variable and time (if any) from H in the expression P(H) or P(H|T).continuousHeadB
- A second continuous head variable and time (if any) from H in the expression P(H) or P(H|T).value
- The covariance value.discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).
-
setCovariance
public void setCovariance(VariableContext continuousHeadA, VariableContext continuousHeadB, double value)
Sets the covariance of a Gaussian distribution with no discrete variables between [continuousHeadA] and [continuousHeadB].- Parameters:
continuousHeadA
- A continuous head variable and time (if any) from H in the expression P(H) or P(H|T).continuousHeadB
- A second continuous head variable and time (if any) from H in the expression P(H) or P(H|T).value
- The covariance value.
-
setCovariance
public void setCovariance(Variable continuousHeadA, Variable continuousHeadB, double value, TableIterator iterator)
Sets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).- Parameters:
continuousHeadA
- A continuous head variable from H in the expression P(H) or P(H|T).continuousHeadB
- A second continuous head variable from H in the expression P(H) or P(H|T).value
- The covariance value.iterator
- The discrete combination (mixture) identified by the position of the iterator.
-
setCovariance
public void setCovariance(Variable continuousHeadA, Integer timeA, Variable continuousHeadB, Integer timeB, double value, TableIterator iterator)
Sets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).- Parameters:
continuousHeadA
- A continuous head variable from H in the expression P(H) or P(H|T).timeA
- The time of the first continuous head variable, or null if not a temporal variable.continuousHeadB
- A second continuous head variable from H in the expression P(H) or P(H|T).timeB
- The time of the second continuous head variable, or null if not a temporal variable.value
- The covariance value.iterator
- The discrete combination (mixture) identified by the position of the iterator.
-
setCovariance
public void setCovariance(VariableContext continuousHeadA, VariableContext continuousHeadB, double value, TableIterator iterator)
Sets the covariance of the Gaussian distribution between [continuousHeadA] and [continuousHeadB] for a particular discrete combination (mixture).- Parameters:
continuousHeadA
- A continuous head variable and time (if any) from H in the expression P(H) or P(H|T).continuousHeadB
- A second continuous head variable and time (if any) from H in the expression P(H) or P(H|T).value
- The covariance value.iterator
- The discrete combination (mixture) identified by the position of the iterator.
-
setVariance
public void setVariance(int index, int sortedContinuousHead, double value)
Sets the variance value of the Gaussian distribution at the specified [index] in theTable
of discrete combinations.- Parameters:
index
- The index into the discrete table of combinations. If no discrete variables are present in the distribution, index will always be 0.sortedContinuousHead
- The position of the required continuous head variable.value
- The variance value to set.
-
setVariance
public void setVariance(Variable continuousHead, double value, State... discrete)
Sets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H) or P(H|T).value
- The variance value.discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).
-
setVariance
public void setVariance(Variable continuousHead, Integer time, double value, State... discrete)
Sets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H) or P(H|T).time
- The time of the continuous head variable, or null if not a temporal variable.value
- The variance value.discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).
-
setVariance
public void setVariance(VariableContext continuousHead, double value, State... discrete)
Sets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable and time (if any) from H in the expression P(H) or P(H|T).value
- The variance value.discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).
-
setVariance
public void setVariance(Variable continuousHead, double value, StateContext... discrete)
Sets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H) or P(H|T).value
- The variance value.discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).
-
setVariance
public void setVariance(Variable continuousHead, double value)
Sets the variance of a Gaussian distribution with no discrete variables for the specified [continuousHead] variable.- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H) or P(H|T).value
- The variance value.
-
setVariance
public void setVariance(Variable continuousHead, Integer time, double value)
Sets the variance of a Gaussian distribution with no discrete variables for the specified [continuousHead] variable.- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H) or P(H|T).time
- The time of the continuous head variable, or null if not a temporal variable.value
- The variance value.
-
setVariance
public void setVariance(Variable continuousHead, Integer time, double value, StateContext... discrete)
Sets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H) or P(H|T).time
- The time of the continuous head variable, or null if not a temporal variable.value
- The variance value.discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).
-
setVariance
public void setVariance(VariableContext continuousHead, double value, StateContext... discrete)
Sets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable and time (if any) from H in the expression P(H) or P(H|T).value
- The variance value.discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).
-
setVariance
public void setVariance(Variable continuousHead, double value, TableIterator iterator)
Sets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H) or P(H|T).value
- The variance value.iterator
- The discrete combination (mixture) identified by the position of the iterator.
-
setVariance
public void setVariance(Variable continuousHead, Integer time, double value, TableIterator iterator)
Sets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H) or P(H|T).time
- The time of the continuous head variable, or null if not a temporal variable.value
- The variance value.iterator
- The discrete combination (mixture) identified by the position of the iterator.
-
setVariance
public void setVariance(VariableContext continuousHead, double value, TableIterator iterator)
Sets the variance of the Gaussian distribution for the specified [continuousHead] variable for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable and time (if any) from H in the expression P(H) or P(H|T).value
- The variance value.iterator
- The discrete combination (mixture) identified by the position of the iterator.
-
setWeight
public void setWeight(int index, int sortedContinuousHead, int sortedContinuousTail, double value)
Sets the weight/regression coefficient of the Gaussian distribution at the specified [index] in theTable
of discrete combinations.- Parameters:
index
- The index into the discrete table of combinations. If no discrete variables are present in the distribution, index will always be 0.sortedContinuousHead
- The position of the required continuous head variable.sortedContinuousTail
- The position of the required continuous tail variable.value
- The weight to copy.
-
setWeight
public void setWeight(Variable continuousHead, Variable continuousTail, double value, State... discrete)
Sets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H|T).continuousTail
- A continuous tail variable from T in the expression P(H|T).value
- The weight/regression coefficient.discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).
-
setWeight
public void setWeight(Variable continuousHead, Integer timeHead, Variable continuousTail, Integer timeTail, double value, State... discrete)
Sets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H|T).timeHead
- The time of the continuous head variable, or null if not a temporal variable.continuousTail
- A continuous tail variable from T in the expression P(H|T).timeTail
- The time of the continuous tail variable, or null if not a temporal variable.value
- The weight/regression coefficient.discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).
-
setWeight
public void setWeight(VariableContext continuousHead, VariableContext continuousTail, double value, State... discrete)
Sets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable and associated time (if any) from H in the expression P(H|T).continuousTail
- A continuous tail variable and associated time (if any) from T in the expression P(H|T).value
- The weight/regression coefficient.discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).
-
setWeight
public void setWeight(Variable continuousHead, Variable continuousTail, double value, StateContext... discrete)
Sets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H|T).continuousTail
- A continuous tail variable from T in the expression P(H|T).value
- The weight/regression coefficient.discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).
-
setWeight
public void setWeight(Variable continuousHead, Variable continuousTail, double value)
Sets the weight/regression coefficient of a Gaussian distribution with no discrete variables between the [continuousTail] and [continuousHead].- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H|T).continuousTail
- A continuous tail variable from T in the expression P(H|T).value
- The weight/regression coefficient.
-
setWeight
public void setWeight(Variable continuousHead, Integer timeHead, Variable continuousTail, Integer timeTail, double value, StateContext... discrete)
Sets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H|T).timeHead
- The time of the continuous head variable, or null if not a temporal variable.continuousTail
- A continuous tail variable from T in the expression P(H|T).timeTail
- The time of the continuous tail variable, or null if not a temporal variable.value
- The weight/regression coefficient.discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).
-
setWeight
public void setWeight(Variable continuousHead, Integer timeHead, Variable continuousTail, Integer timeTail, double value)
Sets the weight/regression coefficient of a Gaussian distribution with no discrete variables between the [continuousTail] and [continuousHead].- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H|T).timeHead
- The time of the continuous head variable, or null if not a temporal variable.continuousTail
- A continuous tail variable from T in the expression P(H|T).timeTail
- The time of the continuous tail variable, or null if not a temporal variable.value
- The weight/regression coefficient.
-
setWeight
public void setWeight(VariableContext continuousHead, VariableContext continuousTail, double value, StateContext... discrete)
Sets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable and associated time (if any) from H in the expression P(H|T).continuousTail
- A continuous tail variable and associated time (if any) from T in the expression P(H|T).value
- The weight/regression coefficient.discrete
- The discrete combination (mixture). Can be empty if this distribution has no discrete variables (i.e. the Gaussian is not a mixture of Gaussians).
-
setWeight
public void setWeight(Variable continuousHead, Variable continuousTail, double value, TableIterator iterator)
Sets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H|T).continuousTail
- A continuous tail variable from T in the expression P(H|T).value
- The weight/regression coefficient.iterator
- The discrete combination (mixture) identified by the position of the iterator.
-
setWeight
public void setWeight(Variable continuousHead, Integer timeHead, Variable continuousTail, Integer timeTail, double value, TableIterator iterator)
Sets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable from H in the expression P(H|T).timeHead
- The time of the continuous head variable, or null if not a temporal variable.continuousTail
- A continuous tail variable from T in the expression P(H|T).timeTail
- The time of the continuous tail variable, or null if not a temporal variable.value
- The weight/regression coefficient.iterator
- The discrete combination (mixture) identified by the position of the iterator.
-
setWeight
public void setWeight(VariableContext continuousHead, VariableContext continuousTail, double value, TableIterator iterator)
Sets the weight/regression coefficient of the Gaussian distribution between the [continuousTail] and [continuousHead] for a particular discrete combination (mixture).- Parameters:
continuousHead
- A continuous head variable and associated time (if any) from H in the expression P(H|T).continuousTail
- A continuous tail variable and associated time (if any) from T in the expression P(H|T).value
- The weight/regression coefficient.iterator
- The discrete combination (mixture) identified by the position of the iterator.
-
getSortedVariables
public VariableContextCollection getSortedVariables()
Gets the collection of variables in the distribution, sorted by time (which may be null) and the order in which variables were created.- Specified by:
getSortedVariables
in interfaceDistribution
- Returns:
- Variables sorted by time and the order in which variables were created.
-
getSortedContinuousHead
public VariableContextCollection getSortedContinuousHead()
Gets the collection of continuous head variables in the distribution, sorted by time (which may be null) and the order in which variables were created. Note that head variables are those that appear to the left of the bar in the expression P(A|B) and tail variables are those to the right.- Returns:
- Continuous head variables sorted by time, and the order in which variables were created.
- See Also:
VariableMap
-
getSortedContinuousTail
public VariableContextCollection getSortedContinuousTail()
Gets the collection of continuous tail variables in the distribution, sorted by time (which may be null) and the order in which variables were created. Note that head variables are those that appear to the left of the bar in the expression P(A|B) and tail variables are those to the right.- Returns:
- Continuous tail variables sorted by time and the order in which variables were created.
- See Also:
VariableMap
-
getOwner
public Node getOwner()
Gets the current owner, if assigned to a node. A distribution cannot be modified when it is assigned to a node.- Specified by:
getOwner
in interfaceDistribution
- Returns:
- The owner, or null if not assigned to a node.
-
getOuter
public Distribution getOuter()
Description copied from interface:Distribution
Returns the parent distribution, if this instance is aggregated by another distribution.- Specified by:
getOuter
in interfaceDistribution
-
getTable
public Table getTable()
Gets theTable
which specifies the distribution over any discrete variables.- Specified by:
getTable
in interfaceDistribution
- Returns:
- The table.
-
copyFrom
public void copyFrom(CLGaussian source)
Copies the values from the [source] distribution to this instance. The variable counts between distributions must match but the variable contexts need not be equal.- Parameters:
source
- The source distribution from which values are copied.
-
divide
public Distribution divide(Distribution subset)
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.- Specified by:
divide
in interfaceDistribution
- Parameters:
subset
- The subset to divide by.- Returns:
- The new distribution (complement).
- Throws:
NullPointerException
- Raised if [subset] is null.UnsupportedOperationException
- If subset is not a subset of variables in this instance.
-
divide
public CLGaussian divide(CLGaussian subset)
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.- Parameters:
subset
- The subset to divide by.- Returns:
- The new distribution (complement).
- Throws:
NullPointerException
- Raised if [subset] is null.UnsupportedOperationException
- If subset is not a subset of variables in this instance.
-
instantiateDiscrete
public CLGaussian instantiateDiscrete(Integer[] discreteValues)
Instantiates discrete variables.- Parameters:
discreteValues
- A discrete value (or null) for each discrete variable in the Gaussian table.- Returns:
- The instantiated distribution.
-
instantiate
public Distribution instantiate(Double[] values)
Calculates the distribution which results from instantiating a number of variables. [values] should contain one entry for each- Specified by:
instantiate
in interfaceDistribution
- Parameters:
values
- The instantiated values. Entries can be null.- Returns:
- The instantiated distribution.
- See Also:
in the distribution, however entries can be null.
-
instantiateHeads
public Distribution instantiateHeads(Double[] headValues, double[] logPdf)
Instantiates continuous head variable contexts.- Parameters:
headValues
- The value (or null) for each continuous head variable context.logPdf
- Optional array of lengthTable.size()
that is filled with the logged pdf values, useful when pdf values are zero.- Returns:
- The instantiated distribution.
-
instantiateTails
public CLGaussian instantiateTails(Double[] tailValues)
Calculates the distribution which results from instantiating continuous tail variables.- Parameters:
tailValues
- The value (or null) for each continuous tail.- Returns:
- The instantiated distribution.
-
instantiate
public CLGaussian instantiate(Variable variable, double value)
Calculates the distribution which results from instantiating a particular variable.- Parameters:
variable
- The variable to instantiate.value
- The instantiated value.- Returns:
- The instantiated distribution.
- Throws:
NullPointerException
- Raised if [variable] is null.
-
instantiate
public CLGaussian instantiate(Variable variable, double value, Integer time)
Calculates the distribution which results from instantiating a particular variable at a specified time.- Parameters:
variable
- The variable to instantiate.value
- The instantiated value.time
- The time associated with the variable. Can be null.- Returns:
- The instantiated distribution.
- Throws:
NullPointerException
- Raised if [variable] is null.
-
instantiateHead
public CLGaussian instantiateHead(Variable variable, double value, Integer time)
Calculates the distribution which results from instantiating a particular continuous head variable at a specified time.- Parameters:
variable
- The variable to instantiate.value
- The instantiated value.time
- The time associated with the variable. Can be null.- Returns:
- The instantiated distribution.
- Throws:
NullPointerException
- Raised if [variable] is null.
-
instantiateHead
public CLGaussian instantiateHead(Variable variable, double value, Integer time, double[] logPdf)
Calculates the distribution which results from instantiating a particular continuous head variable at a specified time.- Parameters:
variable
- The variable to instantiate.value
- The instantiated value.time
- The time associated with the variable. Can be null.logPdf
- A buffer of lengthTable.size()
that is filled with the log of the pdf values calculated during instantiation. Can be null.- Returns:
- The instantiated distribution.
- Throws:
NullPointerException
- Raised if [variable] is null.
-
instantiateHead
public Table instantiateHead(double[] headValues, double[] logPdf)
Instantiates all continuous head variable contexts.- Parameters:
headValues
- The values for the continuous head variable contexts.logPdf
- Optional array of lengthTable.size()
that is filled with the logged pdf values, useful when pdf values are zero.- Returns:
- The instantiated distribution.
-
marginalize
public void marginalize(Distribution superset)
Marginalizes (integrates) the [superset] into this instance.- Specified by:
marginalize
in interfaceDistribution
- Parameters:
superset
- A distribution whose variables form a superset of the variables in this instance.- Throws:
NullPointerException
- Raised if [superset] is null.IllegalStateException
- Raised if this instance is read only, or if any variables are no longer correctly due to modifications of the network.IllegalArgumentException
- Raised if [superset] does not contain all the variables in this instance.
-
marginalize
public void marginalize(Distribution superset, PropagationMethod propagation)
Marginalizes (integrates) the [superset] into this instance.- Specified by:
marginalize
in interfaceDistribution
- Parameters:
superset
- A distribution whose variables form a superset of the variables in this instance.propagation
- The propagation method to use during marginalization.- Throws:
NullPointerException
- Raised if [superset] is null.IllegalStateException
- Raised if this instance is read only, or if any variables are no longer correctly due to modifications of the network.IllegalArgumentException
- Raised if [superset] does not contain all the variables in this instance.
-
marginalize
public void marginalize(CLGaussian superset)
Marginalizes (sums/integrates) the [superset] into this instance.- Parameters:
superset
- ACLGaussian
whose variables form a superset of the variables in this instance.- Throws:
NullPointerException
- Raised if [superset] is null.IllegalStateException
- Raised if this instance is read only, or if any variables are no longer sorted correctly due to modifications of the network.IllegalArgumentException
- Raised if [superset] does not contain all the variables in this instance.
-
marginalizeTo
public void marginalizeTo(Table table)
Marginalizes (sums/integrates) out all continuous variables from this instance into the specified table.- Parameters:
table
- ATable
whose variables form a subset of discrete variables in this instance.- Throws:
NullPointerException
- Raised if [table] is null.
-
marginalizeTo
public void marginalizeTo(Table table, PropagationMethod propagation)
Marginalizes (sums/integrates) out all continuous variables from this instance into the specified table.- Parameters:
table
- ATable
whose variables form a subset of discrete variables in this instance.propagation
- The propagation method to use during marginalization.- Throws:
NullPointerException
- Raised if [table] is null.
-
multiply
public CLGaussian multiply(CLGaussian gaussian)
Multiplies this instance by anotherCLGaussian
distribution.- Parameters:
gaussian
- The distribution to combine.- Returns:
- The combined distribution.
- Throws:
NullPointerException
- Raised if [gaussian] is null.
-
multiply
public Distribution multiply(Distribution distribution)
Multiplies this instance by another distribution.- Specified by:
multiply
in interfaceDistribution
- Parameters:
distribution
- The distribution to combine.- Returns:
- The combined distribution.
- Throws:
NullPointerException
- Raised if [distribution] is null.
-
-