grain_propagate: Propagate in a Bayesian network

grain_propagateR Documentation

Propagate in a Bayesian network

Description

Propagation refers to calibrating the cliques of the junction tree so that the clique potentials are consistent on their intersections; refer to the reference below for details.

Usage

## S3 method for class 'grain'
propagate(object, details = object$details, engine = "cpp", ...)

propagateLS(cq_pot_list, rip, initialize = TRUE, details = 0)

Arguments

object

A grain object

details

For debugging info

engine

Either "R" or "cpp"; "cpp" is the default and the fastest.

...

Currently not used

cq_pot_list

List of clique potentials

rip

A rip ordering

initialize

Always true.

Details

The propagate method invokes propagateLS which is a pure R implementation of the Lauritzen-Spiegelhalter algorithm. The c++ based version is several times faster than the purely R based version.

Value

A compiled and propagated grain object.

Author(s)

Søren Højsgaard, sorenh@math.aau.dk

References

Søren Højsgaard (2012). Graphical Independence Networks with the gRain Package for R. Journal of Statistical Software, 46(10), 1-26. https://www.jstatsoft.org/v46/i10/.

See Also

grain, compile

Examples


example("grain")

## Uncompiled and unpropageted network:
bn0  <- grain(chest_cpt, compile=FALSE)
bn0
## Compiled but unpropageted network:
bn1  <- compile(bn0, propagate=FALSE)
## Compiled and propagated network
bn2  <- propagate(bn1)
bn2
## Default is that networks are compiled but not propagated at creation time:
bn3  <- grain(chest_cpt) 
bn3 

gRain documentation built on Oct. 18, 2024, 1:07 a.m.