Learn R Programming

gRain (version 1.4.5)

grain_propagate: 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 grain
propagate(object, details = object$details, engine = "cpp", ...)

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

Value

A compiled and propagated grain object.

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.

Author

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

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.

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

Run this code

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 

Run the code above in your browser using DataLab