Defined by a hypergraph and specification of values for the variables.
Represents the set of all probability distributions which have a factored
representation whose hypergraph is the specifed one.
Since the hypergraph is not required to be simple it is not useful to
actually create objects of this class, hence it is an abstract class. The
most general model class is that of log-linear models (LLM objects, not
yet implemented) where the associated hypergraph is required to be
simple.
|
|
__init__(self,
factors=(),
domain=None,
new_domain_variables=None,
must_be_new=False,
check=False)
Initialise a hierarchical model |
source code
|
|
|
A Parameters.Factor object (for simple) or a list of
such objects (non-simple)
|
|
|
Iterator
|
|
|
Int
|
|
|
|
|
|
|
|
|
String
|
|
Same as self
|
__div__(self,
other)
Return the result of dividing a hierarchical model by a scalar |
source code
|
|
Same as self
|
|
Same as self
|
|
Same as self
|
__mul__(self,
other)
Return the result of multiplying a hierarchical model by a factor,
scalar or another FR |
source code
|
|
|
|
|
Same as self
|
condition(self,
condition,
keep_class=False)
Alter a distribution by effecting the restriction on variables given
by condition |
source code
|
|
Same type as self
|
copy(self,
copy_domain=False)
Return a deep copy of a hierarchical model |
source code
|
|
|
Parameters.CPT
|
cpt(self,
child,
parents=())
Return a conditional probability table for specified child and
parents |
source code
|
|
|
|
|
|
Parameters.Factor object
|
factor(self,
hyperedge)
Return the factor produced by multiplying all factors with variables
hyperedge |
source code
|
|
|
List
|
|
|
List
|
|
|
List
|
items(self)
Return sequence of factor.variables(),factor pairs for
each factor in the model. |
source code
|
|
|
|
|
|
Hypergraph
|
|
|
|
|
|
Graphs.UGraph
|
|
|
Boolean
|
|
|
DFR
|
|
|
|
marginal(self,
variables)
Alter a model to represent the marginal distibution on
variables |
source code
|
|
|
|
|
Class of self
|
|
|
|
makeDN(self,
allow_dummies=False)
Make a dependency network where the CPT for each variable is its
distribution conditional on its Markov blanket |
source code
|
|
|
Set
|
|
|
|
markov_blanket_cpt(self,
variable,
allow_dummies=False)
Create a CPT for the distribution of variable
conditional on its Markov blanket |
source code
|
|
|
|
num_factors_containing_variable(self,
variable)
Return the number of distincet factors containing a given variable |
source code
|
|
|
|
remove(self,
hyperedge)
Remove a factor or factors from a hierarchical model |
source code
|
|
|
List
|
red(self)
Reduce the model, returning any distinct redundant hyperedges |
source code
|
|
|
Boolean
|
|
|
|
|
|
Parameters.Factor object
|
|
Same as self
|
sumout(self,
variables)
Sum out (marginalise away) variables using maximum cardinality |
source code
|
|
Class of self
|
|
None or Float
|
|
|
Float
|
z(self)
Return the sum of values associated with each full joint
instantiation |
source code
|
|
|
|
zero(self)
Set all values in all factors to zero |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Inherited from Variables.SubDomain:
__add__,
__iadd__,
__isub__,
__rdiv__,
__rmul__,
__sub__,
drop_variable,
drop_variables,
inst2index,
insts,
insts_indices,
marginalise_onto,
table_size,
uses_default_domain,
variables,
varvalues
Inherited from Variables.Domain:
add_domain_variable,
add_domain_variables,
add_domain_variables_from_rawdata,
change_domain_variable,
change_domain_variables,
common_domain,
known_variable,
numvals,
values
Inherited from object:
__delattr__,
__getattribute__,
__hash__,
__new__,
__reduce__,
__reduce_ex__,
__setattr__
|