Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

find.unsh.triple

Find all Unshielded Triples in an Undirected Graph


Description

Find all unshielded triples in an undirected graph, q, i.e., the ordered ((x,y,z) with x < z) list of all the triples in the graph.

Usage

find.unsh.triple(g, check=TRUE)

Arguments

g

adjacency matrix of type amat.cpdag representing the skeleton; since a skeleton consists only of undirected edges, g must be symmetric.

check

logical indicating that the symmetry of g should be checked.

Details

A triple of nodes x, y and z is “unshielded”, if (all of these are true):

(i)

x and y are connected;

(ii)

y and z are connected;

(iii)

x and z are not connected.

Value

unshTripl

Matrix with 3 rows containing in each column an unshielded triple

unshVect

Vector containing the unique number for each column in unshTripl (for internal use only)

Author(s)

Diego Colombo, Markus Kalisch (kalisch@stat.math.ethz.ch), and Martin Maechler

Examples

data(gmG)
if (require(Rgraphviz)) {
  ## show graph
  plot(gmG$g, main = "True DAG")
}

## prepare skeleton use in example
g <- wgtMatrix(gmG$g) ## compute weight matrix
g <- 1*(g != 0) # wgts --> 0/1; still lower triangular
print.table(g, zero.print=".")
skel <- g + t(g) ## adjacency matrix of skeleton

## estimate unshielded triples -- there are  13 :
(uTr <- find.unsh.triple(skel))

pcalg

Methods for Graphical Models and Causal Inference

v2.7-2
GPL (>= 2)
Authors
Markus Kalisch [aut, cre], Alain Hauser [aut], Martin Maechler [aut], Diego Colombo [ctb], Doris Entner [ctb], Patrik Hoyer [ctb], Antti Hyttinen [ctb], Jonas Peters [ctb], Nicoletta Andri [ctb], Emilija Perkovic [ctb], Preetam Nandy [ctb], Philipp Ruetimann [ctb], Daniel Stekhoven [ctb], Manuel Schuerch [ctb], Marco Eigenmann [ctb], Leonard Henckel [ctb], Joris Mooij [ctb]
Initial release
2021-4-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.