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

DG

Directed graphs


Description

Defines the adjacency of a directed graph.

Usage

DG(...)

Arguments

...

a sequence of model formulae

Details

The directed graph is defined by a sequence of models formulae. For each formula the response defines a node of the graph and its parents. The graph contains no loops.

Value

the adjacency matrix of the directed graph, i.e., a square Boolean matrix of order equal to the number of nodes of the graph and a one in position (i,j) if there is an arrow from i to j and zero otherwise. The dimnames of the adjacency matrix are the labels for the nodes of the graph.

Author(s)

G. M. Marchetti

References

Lauritzen, S. (1996). Graphical models. Oxford: Clarendon Press.

See Also

Examples

## A DAG
DG(y ~ x, x ~ z, z ~ u)

## A cyclic directed graph
DG(y ~ x, x ~ z, z ~ y)

## A graph with two arrows between two nodes
DG(y ~ x, x ~ y)

## There can be isolated nodes
DG(y ~ x, x ~ x)

ggm

Graphical Markov Models with Mixed Graphs

v2.5
GPL-2
Authors
Giovanni M. Marchetti, Mathias Drton, Kayvan Sadeghi
Initial release
2020-02-014

We don't support your browser anymore

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