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 BayesianFactorcombine(BayesianFactor other)Combine this factor with the provided one and return the result as a new factor.BayesianFactorcopy()BayesianFactordivide(BayesianFactor factor)BayesianFactorfilter(int variable, int state)Filter the factor by selecting only the values where the specified variable is in the specified state.double[]getData()StridesgetDataDomain()The domain of the rest of the domain.StridesgetDomain()doublegetLogValue(int... states)doublegetLogValueAt(int index)StridesgetSeparatingDomain()The domain of the separated part.doublegetValue(int... states)doublegetValueAt(int index)doublelogProb(gnu.trove.map.TIntIntMap[] data, int leftVar)BayesianFactormarginalize(int variable)Sum out a variable from the factor.ObservationBuildersample()-
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:
getDomainin interfaceGenericFactor- Returns:
- The domain of the factor. This includes variables, sizes and strides.
-
getDataDomain
Strides getDataDomain()
Description copied from interface:SeparatelySpecifiedThe domain of the rest of the domain. Together withSeparatelySpecified.getSeparatingDomain()it will form the complete domain of the object.- Specified by:
getDataDomainin interfaceSeparatelySpecified<BayesianFactor>- Returns:
-
getSeparatingDomain
Strides getSeparatingDomain()
Description copied from interface:SeparatelySpecifiedThe 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:
getSeparatingDomainin 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:
copyin interfaceGenericFactor- Returns:
- a copy of the factor
-
filter
BayesianFactor filter(int variable, int state)
Description copied from interface:OperableFactorFilter 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:
filterin interfaceFilterableFactor<BayesianFactor>- Specified by:
filterin 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:OperableFactorCombine this factor with the provided one and return the result as a new factor.- Specified by:
combinein 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:OperableFactorSum out a variable from the factor.- Specified by:
marginalizein 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:
dividein 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)
-
-