hbayes-0.5.2: Bayesian Networks

Safe HaskellNone
LanguageHaskell2010

Bayes.VariableElimination.Buckets

Contents

Description

Bucket algorithms for variable elimination with enough flexibility to also work with influence diagrams.

Synopsis

Types

data Buckets f Source

Used for bucket elimination. Factor are organized by their first DV

Constructors

Buckets !(EliminationOrder DV) !(Map DV [f]) 

Instances

Show f => Show (Buckets f) Source 

type EliminationOrder dv = [dv] Source

Elimination order

class IsBucketItem f where Source

Operations needed to process a bucket items

Functions

createBuckets Source

Arguments

:: IsBucketItem f 
=> [f]

Factor to use for computing the marginal one

-> EliminationOrder DV

Variables to eliminate

-> EliminationOrder DV

Remaining variables

-> Buckets f 

getBucket :: DV -> Buckets f -> [f] Source

Get the factors for a bucket

updateBucket Source

Arguments

:: IsBucketItem f 
=> DV

Variable that was eliminated

-> f

New factor resulting from this elimination

-> Buckets f 
-> Buckets f 

Update bucket

addBucket :: IsBucketItem f => Buckets f -> f -> Buckets f Source

Add a factor to the right bucket

removeFromBucket :: DV -> Buckets f -> Buckets f Source

Remove a variable from the bucket