gmbn {gmgm}R Documentation

Create a Gaussian mixture Bayesian network

Description

This function creates a Gaussian mixture Bayesian network as an object of S3 class gmbn. A Bayesian network is a probabilistic graphical model that represents the conditional dependencies and independencies between random variables by a directed acyclic graph. It encodes a global joint distribution over the nodes, which decomposes into a product of local conditional distributions:

p(X_1, \dots , X_n) = \prod_{i = 1}^n p(X_i | Pa(X_i))

where Pa(X_i) is the set of parents of X_i in the graph. In a Gaussian mixture Bayesian network, each local joint distribution over a node and its parents is described by a Gaussian mixture model, which means that the global distribution is a product of local conditional Gaussian mixture models (Davies and Moore, 2000). The gmbn class can be extended to the time factor by regarding the nodes as the state of the system at a given time slice t (denoted by X^{(t)}) and allowing them to have parents at previous time slices. This makes it possible to create a (k + 1)-slice temporal Bayesian network that encodes the transition distribution p(X^{(t)} | X^{(t - 1)}, \dots , X^{(t - k)}) (Hulst, 2006). Finally, note that a Gaussian mixture Bayesian network can be created with functions add_nodes (by passing NULL as argument gmgm) and add_arcs, which allows to quickly initialize a gmbn object that can be passed to a learning function.

Usage

gmbn(...)

Arguments

...

Objects of class gmm describing the local joint distributions over the nodes and their parents. Each gmm object must be named after the node whose distribution it describes and contain variables named after this node and its parents. Two types of parents are accepted: other nodes (whose gmm objects must be defined) and instantiations of nodes at previous time slices (if the created gmbn object is a temporal Bayesian network). In the second case, the time lag must be added at the end of the variable name after a period . (e.g. the instantiation of a node X at time slice t - 1 is represented by the variable X.1).

Value

A list of class gmbn containing the gmm objects passed as arguments.

References

Davies, S. and Moore, A. (2000). Mix-nets: Factored Mixtures of Gaussians in Bayesian Networks with Mixed Continuous And Discrete Variables. In Proceedings of the 16th Conference on Uncertainty in Artificial Intelligence, pages 168–175, Stanford, CA, USA.

Hulst, J. (2006). Modeling physiological processes with dynamic Bayesian networks. Master's thesis, Delft University of Technology.

See Also

gmdbn, gmm

Examples

data(data_body)
gmbn_1 <- gmbn(
  AGE = split_comp(add_var(NULL, data_body[, "AGE"]), n_sub = 3),
  FAT = split_comp(add_var(NULL,
                           data_body[, c("FAT", "GENDER", "HEIGHT", "WEIGHT")]),
                   n_sub = 2),
  GENDER = split_comp(add_var(NULL, data_body[, "GENDER"]), n_sub = 2),
  GLYCO = split_comp(add_var(NULL, data_body[, c("GLYCO", "AGE", "WAIST")]),
                     n_sub = 2),
  HEIGHT = split_comp(add_var(NULL, data_body[, c("HEIGHT", "GENDER")])),
  WAIST = split_comp(add_var(NULL,
                             data_body[, c("WAIST", "AGE", "FAT", "HEIGHT",
                                           "WEIGHT")]),
                     n_sub = 3),
  WEIGHT = split_comp(add_var(NULL, data_body[, c("WEIGHT", "HEIGHT")]),
                      n_sub = 2)
)

library(dplyr)
data(data_air)
data <- data_air %>%
  group_by(DATE) %>%
  mutate(NO2.1 = lag(NO2), O3.1 = lag(O3), TEMP.1 = lag(TEMP),
         WIND.1 = lag(WIND)) %>%
  ungroup()
gmbn_2 <- gmbn(
  NO2 = split_comp(add_var(NULL, data[, c("NO2", "NO2.1", "WIND")]), n_sub = 3),
  O3 = split_comp(add_var(NULL,
                          data[, c("O3", "NO2", "NO2.1", "O3.1", "TEMP",
                                   "TEMP.1")]),
                  n_sub = 3),
  TEMP = split_comp(add_var(NULL, data[, c("TEMP", "TEMP.1")]), n_sub = 3),
  WIND = split_comp(add_var(NULL, data[, c("WIND", "WIND.1")]), n_sub = 3)
)


[Package gmgm version 1.1.2 Index]