Safe Haskell | Safe-Infered |
---|
Algorithms for variable elimination
- priorMarginal :: (Graph g, IsBucketItem f, Factor f, Show f, BayesianDiscreteVariable dva, BayesianDiscreteVariable dvb) => BayesianNetwork g f -> EliminationOrder dva -> EliminationOrder dvb -> f
- posteriorMarginal :: (Graph g, IsBucketItem f, Factor f, Show f, BayesianDiscreteVariable dva, BayesianDiscreteVariable dvb) => BayesianNetwork g f -> EliminationOrder dva -> EliminationOrder dvb -> [DVI] -> f
- interactionGraph :: (FoldableWithVertex g, Factor f, UndirectedGraph g') => BayesianNetwork g f -> g' () DV
- degreeOrder :: (FoldableWithVertex g, Factor f, Graph g) => BayesianNetwork g f -> EliminationOrder DV -> Int
- minDegreeOrder :: (Graph g, Factor f, FoldableWithVertex g) => BayesianNetwork g f -> EliminationOrder DV
- minFillOrder :: (Graph g, Factor f, FoldableWithVertex g) => BayesianNetwork g f -> EliminationOrder DV
- allVariables :: (Graph g, Factor f) => BayesianNetwork g f -> [DV]
- marginal :: (IsBucketItem f, Factor f) => [f] -> EliminationOrder DV -> EliminationOrder DV -> [DVI] -> f
- mpemarginal :: [CPT] -> EliminationOrder DV -> EliminationOrder DV -> [DVI] -> MAXCPT
- mpe :: (Graph g, BayesianDiscreteVariable dva, BayesianDiscreteVariable dvb) => BayesianNetwork g CPT -> EliminationOrder dva -> EliminationOrder dvb -> [DVI] -> [DVISet]
- type EliminationOrder dv = [dv]
Inferences
:: (Graph g, IsBucketItem f, Factor f, Show f, BayesianDiscreteVariable dva, BayesianDiscreteVariable dvb) | |
=> BayesianNetwork g f | Bayesian Network |
-> EliminationOrder dva | Ordering of variables to marginalize |
-> EliminationOrder dvb | Ordering of remaining to keep in result |
-> f |
Compute the prior marginal. All the variables in the elimination order are conditionning variables ( p( . | conditionning variables) )
:: (Graph g, IsBucketItem f, Factor f, Show f, BayesianDiscreteVariable dva, BayesianDiscreteVariable dvb) | |
=> BayesianNetwork g f | Bayesian Network |
-> EliminationOrder dva | Ordering of variables to marginzalie |
-> EliminationOrder dvb | Ordering of remaining variables |
-> [DVI] | Assignment for some factors in variables to marginalize |
-> f |
Interaction graph and elimination order
interactionGraph :: (FoldableWithVertex g, Factor f, UndirectedGraph g') => BayesianNetwork g f -> g' () DVSource
Compute the interaction graph of the BayesianNetwork
degreeOrder :: (FoldableWithVertex g, Factor f, Graph g) => BayesianNetwork g f -> EliminationOrder DV -> IntSource
Compute the degree order of an elimination order
minDegreeOrder :: (Graph g, Factor f, FoldableWithVertex g) => BayesianNetwork g f -> EliminationOrder DVSource
Elimination order minimizing the degree
minFillOrder :: (Graph g, Factor f, FoldableWithVertex g) => BayesianNetwork g f -> EliminationOrder DVSource
Elimination order minimizing the filling
allVariables :: (Graph g, Factor f) => BayesianNetwork g f -> [DV]Source
Get all variables from a Bayesian Network
:: (IsBucketItem f, Factor f) | |
=> [f] | Bayesian Network |
-> EliminationOrder DV | Ordering of variables to marginalize |
-> EliminationOrder DV | Ordering of remaining variables |
-> [DVI] | Assignment for some factors in variables to marginalize |
-> f |
Compute the prior marginal. All the variables in the elimination order are conditionning variables ( p( . | conditionning variables) )
:: [CPT] | Bayesian Network |
-> EliminationOrder DV | Ordering of variables to marginalize |
-> EliminationOrder DV | Ordering of remaining variables |
-> [DVI] | Assignment for some factors in variables to marginalize |
-> MAXCPT |
Compute the prior marginal. All the variables in the elimination order are conditionning variables ( p( . | conditionning variables) ) First we sum, then we maximize for the remaining variables
:: (Graph g, BayesianDiscreteVariable dva, BayesianDiscreteVariable dvb) | |
=> BayesianNetwork g CPT | Bayesian network defining the factors |
-> EliminationOrder dva | Ordering of variables to sum out (should contain evidence variables) |
-> EliminationOrder dvb | Ordering of remaining variables (to maximize) |
-> [DVI] | Assignment |
-> [DVISet] | MPE or MAP instantiation |
Most Probable Explanation (or Maximum A Posteriori estimator) when restricted to a subest of variables in output
type EliminationOrder dv = [dv]Source
Elimination order