perfSets {gRapHD}R Documentation

Find a perfect sequence

Description

Find a perfect sequence, returning the cliques, histories, residuals, and separators of a given triangulated graph.

Usage

  perfSets(model=NULL,edges=NULL,p=NULL,varType=0,from=0)

Arguments

model gRapHD object.
edges matrix with 2 columns, each row representing one edge, and each column one of the vertices in the edge.
p number of vertices.
varType vector indicating the type of each variable: 0 if continuous, or 1 if discrete.
from initial vertex to be used in MCS.

Details

Based on the perfect numbering of mcs, returns the perfect sequnece.
The sequence is given by the cliques in the graph: Cj=closure(α(j)) intersection {α(1),...,α(j)}, j>=1.
The other sets are given by:
- Histories: Hj=C1 union ... union Cj
- Residuals: Rj=Cj \ H(j-1)
- Separators: Sj=H(j-1) intersection Cj

Value

A list containing:

cliques list.
histories list.
residuals list.
separators list.

Author(s)

Gabriel Coelho Goncalves de Abreu (Gabriel.Abreu@agrsci.dk)
Rodrigo Labouriau (Rodrigo.Labouriau@agrsci.dk)
David Edwards (David.Edwards@agrsci.dk)

References

Lauritzen, S.L. (1996) Graphical Models, Oxford University Press.

Examples

  edges <- matrix(c(1,2,2,3,2,4,2,5,2,6,3,4,4,5,5,6),ncol=2,byrow=TRUE)
  setList <- perfSets(edges=edges, p=6, varType=0, from=1)
  #    > str(setList)
  #    List of 4
  #     $ cliques   :List of 4
  #      ..$ : int [1:2] 1 2
  #      ..$ : int [1:3] 2 3 4
  #      ..$ : int [1:3] 2 4 5
  #      ..$ : int [1:3] 2 5 6
  #     $ histories :List of 4
  #      ..$ : int [1:2] 1 2
  #      ..$ : int [1:4] 1 2 3 4
  #      ..$ : int [1:5] 1 2 3 4 5
  #      ..$ : int [1:6] 1 2 3 4 5 6
  #     $ separators:List of 4
  #      ..$ : NULL
  #      ..$ : int 2
  #      ..$ : int [1:2] 2 4
  #      ..$ : int [1:2] 2 5
  #     $ residuals :List of 4
  #      ..$ : int [1:2] 1 2
  #      ..$ : int [1:2] 3 4
  #      ..$ : int 5
  #      ..$ : int 6

[Package gRapHD version 0.1.0 Index]