remove_arcs {gmgm}R Documentation

Remove arcs from a Gaussian mixture graphical model

Description

This function removes arcs from a Gaussian mixture graphical model.

Usage

remove_arcs(gmgm, arcs)

Arguments

gmgm

An object of class gmbn or gmdbn.

arcs

A data frame containing the removed arcs. The column from describes the start node, the column to the end node and the column lag the time lag between them. Missing values in from or to are interpreted as "all possible nodes", which allows to quickly define large set of arcs that share common attributes. Missing values in lag are replaced by 0. If gmgm is a gmdbn object, the same arcs are removed from each of its gmbn elements. This constraint can be overcome by passing a list of data frames named after some of these elements (b_1, ...) and containing arcs specifically removed from them.

Value

The gmbn or gmdbn object after removing the arcs.

See Also

add_arcs, add_nodes, relevant, remove_nodes, rename_nodes

Examples

data(gmbn_body)
gmbn_1 <- remove_arcs(gmbn_body,
                      data.frame(from = c("HEIGHT", "AGE"),
                                 to = c("FAT", "WAIST")))

data(gmdbn_air)
gmdbn_1 <- remove_arcs(gmdbn_air,
                       list(b_2 = data.frame(from = c("NO2", "TEMP"),
                                             to = c("O3", "O3"), lag = c(1, 1)),
                            b_13 = data.frame(from = "TEMP", to = "O3",
                                              lag = 1)))


[Package gmgm version 1.1.2 Index]