hbayes-0.2.1: Inference with Discrete Bayesian Networks

Safe HaskellSafe-Infered

Bayes.VariableElimination

Contents

Description

Algorithms for variable elimination

Synopsis

Inferences

priorMarginalSource

Arguments

:: (Graph g, Factor f, Show f) 
=> BayesianNetwork g f

Bayesian Network

-> EliminationOrder

Ordering of variables to marginalize

-> EliminationOrder

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, Factor f, Show f) 
=> BayesianNetwork g f

Bayesian Network

-> EliminationOrder

Ordering of variables to marginzalie

-> EliminationOrder

Ordering of remaining variables

-> [DVI Int]

Assignment for some factors in vaiables 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 -> IntSource

Compute the degree order of an elimination order

minDegreeOrder :: (Graph g, Factor f, FoldableWithVertex g) => BayesianNetwork g f -> EliminationOrderSource

Elimination order minimizing the degree

minFillOrder :: (Graph g, Factor f, FoldableWithVertex g) => BayesianNetwork g f -> EliminationOrderSource

Elimination order minimizing the filling

allVariables :: (Graph g, Factor f) => BayesianNetwork g f -> [DV]Source

Get all variables from a Bayesian Network

marginalSource

Arguments

:: Factor f 
=> [f]

Bayesian Network

-> EliminationOrder

Ordering of variables to marginzalie

-> EliminationOrder

Ordering of remaining variables

-> [DVI Int]

Assignment for some factors in vaiables to marginalize

-> f 

Compute the prior marginal. All the variables in the elimination order are conditionning variables ( p( . | conditionning variables) )

type EliminationOrder = [DV]Source

Elimination order