Package ch.idsia.crema.factor.bayesian
Interface BayesianFactor
-
- All Superinterfaces:
FilterableFactor<BayesianFactor>
,GenericFactor
,OperableFactor<BayesianFactor>
,SeparatelySpecified<BayesianFactor>
- All Known Implementing Classes:
BayesianAbstractFactor
,BayesianAndFactor
,BayesianDefaultFactor
,BayesianDeterministicFactor
,BayesianFunctionFactor
,BayesianFunctionLogFactor
,BayesianLogFactor
,BayesianLogicFactor
,BayesianNoisyOrFactor
,BayesianNotFactor
,BayesianOrFactor
public interface BayesianFactor extends OperableFactor<BayesianFactor>, SeparatelySpecified<BayesianFactor>
Author: Claudio "Dna" Bonesana Project: crema Date: 17.03.2021 13:18
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BayesianFactor
combine(BayesianFactor other)
Combine this factor with the provided one and return the result as a new factor.BayesianFactor
copy()
BayesianFactor
divide(BayesianFactor factor)
BayesianFactor
filter(int variable, int state)
Filter the factor by selecting only the values where the specified variable is in the specified state.double[]
getData()
Strides
getDataDomain()
The domain of the rest of the domain.Strides
getDomain()
double
getLogValue(int... states)
double
getLogValueAt(int index)
Strides
getSeparatingDomain()
The domain of the separated part.double
getValue(int... states)
double
getValueAt(int index)
double
logProb(gnu.trove.map.TIntIntMap[] data, int leftVar)
BayesianFactor
marginalize(int variable)
Sum out a variable from the factor.ObservationBuilder
sample()
-
Methods inherited from interface ch.idsia.crema.factor.FilterableFactor
filter
-
Methods inherited from interface ch.idsia.crema.factor.GenericFactor
isLog
-
Methods inherited from interface ch.idsia.crema.factor.OperableFactor
combine, combine, marginalize, normalize
-
-
-
-
Method Detail
-
getDomain
Strides getDomain()
- Specified by:
getDomain
in interfaceGenericFactor
- Returns:
- The domain of the factor. This includes variables, sizes and strides.
-
getDataDomain
Strides getDataDomain()
Description copied from interface:SeparatelySpecified
The domain of the rest of the domain. Together withSeparatelySpecified.getSeparatingDomain()
it will form the complete domain of the object.- Specified by:
getDataDomain
in interfaceSeparatelySpecified<BayesianFactor>
- Returns:
-
getSeparatingDomain
Strides getSeparatingDomain()
Description copied from interface:SeparatelySpecified
The domain of the separated part. This is usually the conditioning of the Factor. This side must not overlap with the data domain returned bySeparatelySpecified.getDataDomain()
.- Specified by:
getSeparatingDomain
in interfaceSeparatelySpecified<BayesianFactor>
- Returns:
-
getValue
double getValue(int... states)
- Parameters:
states
- specified in the order of the factor's domain- Returns:
- the value associated to the given states
-
getValueAt
double getValueAt(int index)
- Parameters:
index
- offset based on the factor's domain- Returns:
- the value associated to the given states
-
getLogValue
double getLogValue(int... states)
- Parameters:
states
- specified in the order of the factor's domain- Returns:
- the value associated to the given states in log format
-
getLogValueAt
double getLogValueAt(int index)
- Parameters:
index
- offset based on the factor's domain- Returns:
- the value associated to the given states in log format
-
getData
double[] getData()
-
copy
BayesianFactor copy()
- Specified by:
copy
in interfaceGenericFactor
- Returns:
- a copy of the factor
-
filter
BayesianFactor filter(int variable, int state)
Description copied from interface:OperableFactor
Filter the factor by selecting only the values where the specified variable is in the specified state.
Should return this if the variable is not part of the domain of the factor.
- Specified by:
filter
in interfaceFilterableFactor<BayesianFactor>
- Specified by:
filter
in interfaceOperableFactor<BayesianFactor>
- Parameters:
variable
- variable to filterstate
- state of the variable to filter- Returns:
- a new factor where the given variable in the given state has been filtered out
-
combine
BayesianFactor combine(BayesianFactor other)
Description copied from interface:OperableFactor
Combine this factor with the provided one and return the result as a new factor.- Specified by:
combine
in interfaceOperableFactor<BayesianFactor>
- Parameters:
other
- other factor to combine with this one- Returns:
- a new factor combination of this with the given one
-
marginalize
BayesianFactor marginalize(int variable)
Description copied from interface:OperableFactor
Sum out a variable from the factor.- Specified by:
marginalize
in interfaceOperableFactor<BayesianFactor>
- Parameters:
variable
- variable to be marginalize out from this factor- Returns:
- a new factor without the given variable
-
divide
BayesianFactor divide(BayesianFactor factor)
- Specified by:
divide
in interfaceOperableFactor<BayesianFactor>
- Parameters:
factor
- given factor to divide by- Returns:
- a new factor resulting in the division of this factor by the given one
-
sample
ObservationBuilder sample()
-
logProb
double logProb(gnu.trove.map.TIntIntMap[] data, int leftVar)
-
-