hbayes-0.4: Inference with Discrete Bayesian Networks

Safe HaskellSafe-Infered

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) 

type EliminationOrder dv = [dv]Source

Elimination order

class IsBucketItem f whereSource

Operations needed to process a bucket items

Functions

createBucketsSource

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

updateBucketSource

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 fSource

Add a factor to the right bucket

removeFromBucket :: DV -> Buckets f -> Buckets fSource

Remove a variable from the bucket