hbayes-0.4.1: Inference with Discrete Bayesian Networks

Safe HaskellSafe-Infered

Bayes.VariableElimination

Contents

Description

Algorithms for variable elimination

Synopsis

Inferences

priorMarginalSource

Arguments

:: (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) )

posteriorMarginalSource

Arguments

:: (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

marginalSource

Arguments

:: (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) )

mpemarginalSource

Arguments

:: [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

mpeSource

Arguments

:: (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